Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 123 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 123 : PyCodeObject *result;
667 123 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 123 : if (!empty_bytes) return NULL;
669 123 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 123 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 123 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 0 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 0 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 0 : if (res == NULL) PyErr_Clear();
928 0 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 9 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 9 : PyObject *module = PyImport_AddModule(name);
1116 9 : Py_XINCREF(module);
1117 9 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__linalg___decomp_interpolative
1220 : #define __PYX_HAVE_API__scipy__linalg___decomp_interpolative
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdio.h>
1224 :
1225 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1226 :
1227 : #include "numpy/arrayobject.h"
1228 : #include "numpy/ndarrayobject.h"
1229 : #include "numpy/ndarraytypes.h"
1230 : #include "numpy/arrayscalars.h"
1231 : #include "numpy/ufuncobject.h"
1232 : #include <math.h>
1233 : #include "pythread.h"
1234 : #include <stdlib.h>
1235 : #ifdef _OPENMP
1236 : #include <omp.h>
1237 : #endif /* _OPENMP */
1238 :
1239 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1240 : #define CYTHON_WITHOUT_ASSERTIONS
1241 : #endif
1242 :
1243 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1244 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1245 :
1246 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1248 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1249 : #define __PYX_DEFAULT_STRING_ENCODING ""
1250 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1251 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1252 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1253 : #define __Pyx_long_cast(x) ((long)x)
1254 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1255 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1256 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1257 : likely(v < (type)PY_SSIZE_T_MAX ||\
1258 : v == (type)PY_SSIZE_T_MAX) &&\
1259 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1260 : v == (type)PY_SSIZE_T_MIN))) ||\
1261 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1262 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1263 : v == (type)PY_SSIZE_T_MAX))) )
1264 0 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1265 0 : return (size_t) i < (size_t) limit;
1266 : }
1267 : #if defined (__cplusplus) && __cplusplus >= 201103L
1268 : #include <cstdlib>
1269 : #define __Pyx_sst_abs(value) std::abs(value)
1270 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1271 : #define __Pyx_sst_abs(value) abs(value)
1272 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1273 : #define __Pyx_sst_abs(value) labs(value)
1274 : #elif defined (_MSC_VER)
1275 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1276 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1277 : #define __Pyx_sst_abs(value) llabs(value)
1278 : #elif defined (__GNUC__)
1279 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1280 : #else
1281 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1282 : #endif
1283 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1284 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1285 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1286 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1287 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1288 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1289 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1290 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1291 : #if PY_MAJOR_VERSION < 3
1292 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1293 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1294 : #else
1295 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1296 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1297 : #endif
1298 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1299 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1304 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1305 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1309 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1310 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1311 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1312 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1313 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1314 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1315 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1316 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1317 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1318 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1319 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1320 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1321 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1322 : #define __Pyx_PySequence_Tuple(obj)\
1323 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1324 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1325 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1326 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1327 : #if CYTHON_ASSUME_SAFE_MACROS
1328 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1329 : #else
1330 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1331 : #endif
1332 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1333 : #if PY_MAJOR_VERSION >= 3
1334 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1335 : #else
1336 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1337 : #endif
1338 : #if CYTHON_USE_PYLONG_INTERNALS
1339 : #if PY_VERSION_HEX >= 0x030C00A7
1340 : #ifndef _PyLong_SIGN_MASK
1341 : #define _PyLong_SIGN_MASK 3
1342 : #endif
1343 : #ifndef _PyLong_NON_SIZE_BITS
1344 : #define _PyLong_NON_SIZE_BITS 3
1345 : #endif
1346 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1347 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1348 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1349 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1350 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1351 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1352 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1353 : #define __Pyx_PyLong_SignedDigitCount(x)\
1354 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1355 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1356 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1357 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1358 : #else
1359 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1360 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1361 : #endif
1362 : typedef Py_ssize_t __Pyx_compact_pylong;
1363 : typedef size_t __Pyx_compact_upylong;
1364 : #else
1365 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1366 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1367 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1368 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1369 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1370 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1371 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1372 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1373 : #define __Pyx_PyLong_CompactValue(x)\
1374 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1375 : typedef sdigit __Pyx_compact_pylong;
1376 : typedef digit __Pyx_compact_upylong;
1377 : #endif
1378 : #if PY_VERSION_HEX >= 0x030C00A5
1379 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1380 : #else
1381 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1382 : #endif
1383 : #endif
1384 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1385 : #include <string.h>
1386 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1387 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1388 : PyObject* sys;
1389 : PyObject* default_encoding = NULL;
1390 : PyObject* ascii_chars_u = NULL;
1391 : PyObject* ascii_chars_b = NULL;
1392 : const char* default_encoding_c;
1393 : sys = PyImport_ImportModule("sys");
1394 : if (!sys) goto bad;
1395 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1396 : Py_DECREF(sys);
1397 : if (!default_encoding) goto bad;
1398 : default_encoding_c = PyBytes_AsString(default_encoding);
1399 : if (!default_encoding_c) goto bad;
1400 : if (strcmp(default_encoding_c, "ascii") == 0) {
1401 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1402 : } else {
1403 : char ascii_chars[128];
1404 : int c;
1405 : for (c = 0; c < 128; c++) {
1406 : ascii_chars[c] = (char) c;
1407 : }
1408 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1409 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1410 : if (!ascii_chars_u) goto bad;
1411 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1412 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1413 : PyErr_Format(
1414 : PyExc_ValueError,
1415 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1416 : default_encoding_c);
1417 : goto bad;
1418 : }
1419 : Py_DECREF(ascii_chars_u);
1420 : Py_DECREF(ascii_chars_b);
1421 : }
1422 : Py_DECREF(default_encoding);
1423 : return 0;
1424 : bad:
1425 : Py_XDECREF(default_encoding);
1426 : Py_XDECREF(ascii_chars_u);
1427 : Py_XDECREF(ascii_chars_b);
1428 : return -1;
1429 : }
1430 : #endif
1431 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1432 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1433 : #else
1434 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1435 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1436 : #include <string.h>
1437 : static char* __PYX_DEFAULT_STRING_ENCODING;
1438 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1439 : PyObject* sys;
1440 : PyObject* default_encoding = NULL;
1441 : char* default_encoding_c;
1442 : sys = PyImport_ImportModule("sys");
1443 : if (!sys) goto bad;
1444 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1445 : Py_DECREF(sys);
1446 : if (!default_encoding) goto bad;
1447 : default_encoding_c = PyBytes_AsString(default_encoding);
1448 : if (!default_encoding_c) goto bad;
1449 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1450 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1451 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1452 : Py_DECREF(default_encoding);
1453 : return 0;
1454 : bad:
1455 : Py_XDECREF(default_encoding);
1456 : return -1;
1457 : }
1458 : #endif
1459 : #endif
1460 :
1461 :
1462 : /* Test for GCC > 2.95 */
1463 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1464 : #define likely(x) __builtin_expect(!!(x), 1)
1465 : #define unlikely(x) __builtin_expect(!!(x), 0)
1466 : #else /* !__GNUC__ or GCC < 2.95 */
1467 : #define likely(x) (x)
1468 : #define unlikely(x) (x)
1469 : #endif /* __GNUC__ */
1470 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1471 :
1472 : #if !CYTHON_USE_MODULE_STATE
1473 : static PyObject *__pyx_m = NULL;
1474 : #endif
1475 : static int __pyx_lineno;
1476 : static int __pyx_clineno = 0;
1477 : static const char * __pyx_cfilenm = __FILE__;
1478 : static const char *__pyx_filename;
1479 :
1480 : /* Header.proto */
1481 : #if !defined(CYTHON_CCOMPLEX)
1482 : #if defined(__cplusplus)
1483 : #define CYTHON_CCOMPLEX 1
1484 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1485 : #define CYTHON_CCOMPLEX 1
1486 : #else
1487 : #define CYTHON_CCOMPLEX 0
1488 : #endif
1489 : #endif
1490 : #if CYTHON_CCOMPLEX
1491 : #ifdef __cplusplus
1492 : #include <complex>
1493 : #else
1494 : #include <complex.h>
1495 : #endif
1496 : #endif
1497 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1498 : #undef _Complex_I
1499 : #define _Complex_I 1.0fj
1500 : #endif
1501 :
1502 : /* #### Code section: filename_table ### */
1503 :
1504 : static const char *__pyx_f[] = {
1505 : "_decomp_interpolative.pyx",
1506 : "<stringsource>",
1507 : "__init__.cython-30.pxd",
1508 : "type.pxd",
1509 : };
1510 : /* #### Code section: utility_code_proto_before_types ### */
1511 : /* ForceInitThreads.proto */
1512 : #ifndef __PYX_FORCE_INIT_THREADS
1513 : #define __PYX_FORCE_INIT_THREADS 0
1514 : #endif
1515 :
1516 : /* NoFastGil.proto */
1517 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1518 : #define __Pyx_PyGILState_Release PyGILState_Release
1519 : #define __Pyx_FastGIL_Remember()
1520 : #define __Pyx_FastGIL_Forget()
1521 : #define __Pyx_FastGilFuncInit()
1522 :
1523 : /* BufferFormatStructs.proto */
1524 : struct __Pyx_StructField_;
1525 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1526 : typedef struct {
1527 : const char* name;
1528 : struct __Pyx_StructField_* fields;
1529 : size_t size;
1530 : size_t arraysize[8];
1531 : int ndim;
1532 : char typegroup;
1533 : char is_unsigned;
1534 : int flags;
1535 : } __Pyx_TypeInfo;
1536 : typedef struct __Pyx_StructField_ {
1537 : __Pyx_TypeInfo* type;
1538 : const char* name;
1539 : size_t offset;
1540 : } __Pyx_StructField;
1541 : typedef struct {
1542 : __Pyx_StructField* field;
1543 : size_t parent_offset;
1544 : } __Pyx_BufFmt_StackElem;
1545 : typedef struct {
1546 : __Pyx_StructField root;
1547 : __Pyx_BufFmt_StackElem* head;
1548 : size_t fmt_offset;
1549 : size_t new_count, enc_count;
1550 : size_t struct_alignment;
1551 : int is_complex;
1552 : char enc_type;
1553 : char new_packmode;
1554 : char enc_packmode;
1555 : char is_valid_array;
1556 : } __Pyx_BufFmt_Context;
1557 :
1558 : /* Atomics.proto */
1559 : #include <pythread.h>
1560 : #ifndef CYTHON_ATOMICS
1561 : #define CYTHON_ATOMICS 1
1562 : #endif
1563 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1564 : #define __pyx_atomic_int_type int
1565 : #define __pyx_nonatomic_int_type int
1566 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1567 : (__STDC_VERSION__ >= 201112L) &&\
1568 : !defined(__STDC_NO_ATOMICS__))
1569 : #include <stdatomic.h>
1570 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1571 : (__cplusplus >= 201103L) ||\
1572 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1573 : #include <atomic>
1574 : #endif
1575 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1576 : (__STDC_VERSION__ >= 201112L) &&\
1577 : !defined(__STDC_NO_ATOMICS__) &&\
1578 : ATOMIC_INT_LOCK_FREE == 2)
1579 : #undef __pyx_atomic_int_type
1580 : #define __pyx_atomic_int_type atomic_int
1581 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1582 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1583 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1584 : #pragma message ("Using standard C atomics")
1585 : #elif defined(__PYX_DEBUG_ATOMICS)
1586 : #warning "Using standard C atomics"
1587 : #endif
1588 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1589 : (__cplusplus >= 201103L) ||\
1590 : \
1591 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1592 : ATOMIC_INT_LOCK_FREE == 2)
1593 : #undef __pyx_atomic_int_type
1594 : #define __pyx_atomic_int_type std::atomic_int
1595 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1596 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1597 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1598 : #pragma message ("Using standard C++ atomics")
1599 : #elif defined(__PYX_DEBUG_ATOMICS)
1600 : #warning "Using standard C++ atomics"
1601 : #endif
1602 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1603 : (__GNUC_MINOR__ > 1 ||\
1604 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1605 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1606 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1607 : #ifdef __PYX_DEBUG_ATOMICS
1608 : #warning "Using GNU atomics"
1609 : #endif
1610 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1611 : #include <intrin.h>
1612 : #undef __pyx_atomic_int_type
1613 : #define __pyx_atomic_int_type long
1614 : #undef __pyx_nonatomic_int_type
1615 : #define __pyx_nonatomic_int_type long
1616 : #pragma intrinsic (_InterlockedExchangeAdd)
1617 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1618 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1619 : #ifdef __PYX_DEBUG_ATOMICS
1620 : #pragma message ("Using MSVC atomics")
1621 : #endif
1622 : #else
1623 : #undef CYTHON_ATOMICS
1624 : #define CYTHON_ATOMICS 0
1625 : #ifdef __PYX_DEBUG_ATOMICS
1626 : #warning "Not using atomics"
1627 : #endif
1628 : #endif
1629 : #if CYTHON_ATOMICS
1630 : #define __pyx_add_acquisition_count(memview)\
1631 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1632 : #define __pyx_sub_acquisition_count(memview)\
1633 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1634 : #else
1635 : #define __pyx_add_acquisition_count(memview)\
1636 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1637 : #define __pyx_sub_acquisition_count(memview)\
1638 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1639 : #endif
1640 :
1641 : /* MemviewSliceStruct.proto */
1642 : struct __pyx_memoryview_obj;
1643 : typedef struct {
1644 : struct __pyx_memoryview_obj *memview;
1645 : char *data;
1646 : Py_ssize_t shape[8];
1647 : Py_ssize_t strides[8];
1648 : Py_ssize_t suboffsets[8];
1649 : } __Pyx_memviewslice;
1650 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1651 :
1652 : /* #### Code section: numeric_typedefs ### */
1653 :
1654 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1655 : * # in Cython to enable them only on the right systems.
1656 : *
1657 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1658 : * ctypedef npy_int16 int16_t
1659 : * ctypedef npy_int32 int32_t
1660 : */
1661 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1662 :
1663 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1664 : *
1665 : * ctypedef npy_int8 int8_t
1666 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1667 : * ctypedef npy_int32 int32_t
1668 : * ctypedef npy_int64 int64_t
1669 : */
1670 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1671 :
1672 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1673 : * ctypedef npy_int8 int8_t
1674 : * ctypedef npy_int16 int16_t
1675 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1676 : * ctypedef npy_int64 int64_t
1677 : * #ctypedef npy_int96 int96_t
1678 : */
1679 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1680 :
1681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1682 : * ctypedef npy_int16 int16_t
1683 : * ctypedef npy_int32 int32_t
1684 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1685 : * #ctypedef npy_int96 int96_t
1686 : * #ctypedef npy_int128 int128_t
1687 : */
1688 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1689 :
1690 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1691 : * #ctypedef npy_int128 int128_t
1692 : *
1693 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1694 : * ctypedef npy_uint16 uint16_t
1695 : * ctypedef npy_uint32 uint32_t
1696 : */
1697 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1698 :
1699 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1700 : *
1701 : * ctypedef npy_uint8 uint8_t
1702 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1703 : * ctypedef npy_uint32 uint32_t
1704 : * ctypedef npy_uint64 uint64_t
1705 : */
1706 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1707 :
1708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1709 : * ctypedef npy_uint8 uint8_t
1710 : * ctypedef npy_uint16 uint16_t
1711 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1712 : * ctypedef npy_uint64 uint64_t
1713 : * #ctypedef npy_uint96 uint96_t
1714 : */
1715 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1716 :
1717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1718 : * ctypedef npy_uint16 uint16_t
1719 : * ctypedef npy_uint32 uint32_t
1720 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1721 : * #ctypedef npy_uint96 uint96_t
1722 : * #ctypedef npy_uint128 uint128_t
1723 : */
1724 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1725 :
1726 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1727 : * #ctypedef npy_uint128 uint128_t
1728 : *
1729 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1730 : * ctypedef npy_float64 float64_t
1731 : * #ctypedef npy_float80 float80_t
1732 : */
1733 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1734 :
1735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1736 : *
1737 : * ctypedef npy_float32 float32_t
1738 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1739 : * #ctypedef npy_float80 float80_t
1740 : * #ctypedef npy_float128 float128_t
1741 : */
1742 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1743 :
1744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1745 : * ctypedef double complex complex128_t
1746 : *
1747 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1748 : * ctypedef npy_ulonglong ulonglong_t
1749 : *
1750 : */
1751 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1752 :
1753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1754 : *
1755 : * ctypedef npy_longlong longlong_t
1756 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1757 : *
1758 : * ctypedef npy_intp intp_t
1759 : */
1760 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1761 :
1762 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1763 : * ctypedef npy_ulonglong ulonglong_t
1764 : *
1765 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1766 : * ctypedef npy_uintp uintp_t
1767 : *
1768 : */
1769 : typedef npy_intp __pyx_t_5numpy_intp_t;
1770 :
1771 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1772 : *
1773 : * ctypedef npy_intp intp_t
1774 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1775 : *
1776 : * ctypedef npy_double float_t
1777 : */
1778 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1779 :
1780 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1781 : * ctypedef npy_uintp uintp_t
1782 : *
1783 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1784 : * ctypedef npy_double double_t
1785 : * ctypedef npy_longdouble longdouble_t
1786 : */
1787 : typedef npy_double __pyx_t_5numpy_float_t;
1788 :
1789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1790 : *
1791 : * ctypedef npy_double float_t
1792 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1793 : * ctypedef npy_longdouble longdouble_t
1794 : *
1795 : */
1796 : typedef npy_double __pyx_t_5numpy_double_t;
1797 :
1798 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1799 : * ctypedef npy_double float_t
1800 : * ctypedef npy_double double_t
1801 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1802 : *
1803 : * ctypedef float complex cfloat_t
1804 : */
1805 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1806 :
1807 : /* "scipy/linalg/cython_lapack.pxd":17
1808 : * # The original libraries should be linked directly.
1809 : *
1810 : * ctypedef float s # <<<<<<<<<<<<<<
1811 : * ctypedef double d
1812 : * ctypedef float complex c
1813 : */
1814 : typedef float __pyx_t_5scipy_6linalg_13cython_lapack_s;
1815 :
1816 : /* "scipy/linalg/cython_lapack.pxd":18
1817 : *
1818 : * ctypedef float s
1819 : * ctypedef double d # <<<<<<<<<<<<<<
1820 : * ctypedef float complex c
1821 : * ctypedef double complex z
1822 : */
1823 : typedef double __pyx_t_5scipy_6linalg_13cython_lapack_d;
1824 :
1825 : /* "scipy/linalg/cython_blas.pxd":17
1826 : * # The original libraries should be linked directly.
1827 : *
1828 : * ctypedef float s # <<<<<<<<<<<<<<
1829 : * ctypedef double d
1830 : * ctypedef float complex c
1831 : */
1832 : typedef float __pyx_t_5scipy_6linalg_11cython_blas_s;
1833 :
1834 : /* "scipy/linalg/cython_blas.pxd":18
1835 : *
1836 : * ctypedef float s
1837 : * ctypedef double d # <<<<<<<<<<<<<<
1838 : * ctypedef float complex c
1839 : * ctypedef double complex z
1840 : */
1841 : typedef double __pyx_t_5scipy_6linalg_11cython_blas_d;
1842 : /* #### Code section: complex_type_declarations ### */
1843 : /* Declarations.proto */
1844 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1845 : #ifdef __cplusplus
1846 : typedef ::std::complex< double > __pyx_t_double_complex;
1847 : #else
1848 : typedef double _Complex __pyx_t_double_complex;
1849 : #endif
1850 : #else
1851 : typedef struct { double real, imag; } __pyx_t_double_complex;
1852 : #endif
1853 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1854 :
1855 : /* Declarations.proto */
1856 : #if CYTHON_CCOMPLEX && (1) && (!1 || __cplusplus)
1857 : #ifdef __cplusplus
1858 : typedef ::std::complex< npy_float64 > __pyx_t_npy_float64_complex;
1859 : #else
1860 : typedef npy_float64 _Complex __pyx_t_npy_float64_complex;
1861 : #endif
1862 : #else
1863 : typedef struct { npy_float64 real, imag; } __pyx_t_npy_float64_complex;
1864 : #endif
1865 : static CYTHON_INLINE __pyx_t_npy_float64_complex __pyx_t_npy_float64_complex_from_parts(npy_float64, npy_float64);
1866 :
1867 : /* Declarations.proto */
1868 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1869 : #ifdef __cplusplus
1870 : typedef ::std::complex< float > __pyx_t_float_complex;
1871 : #else
1872 : typedef float _Complex __pyx_t_float_complex;
1873 : #endif
1874 : #else
1875 : typedef struct { float real, imag; } __pyx_t_float_complex;
1876 : #endif
1877 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1878 :
1879 : /* Declarations.proto */
1880 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1881 : #ifdef __cplusplus
1882 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1883 : #else
1884 : typedef long double _Complex __pyx_t_long_double_complex;
1885 : #endif
1886 : #else
1887 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1888 : #endif
1889 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1890 :
1891 : /* #### Code section: type_declarations ### */
1892 :
1893 : /*--- Type declarations ---*/
1894 : struct __pyx_array_obj;
1895 : struct __pyx_MemviewEnum_obj;
1896 : struct __pyx_memoryview_obj;
1897 : struct __pyx_memoryviewslice_obj;
1898 :
1899 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1900 : *
1901 : * # Iterator API added in v1.6
1902 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1903 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1904 : *
1905 : */
1906 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1907 :
1908 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1909 : * # Iterator API added in v1.6
1910 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1911 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1912 : *
1913 : * cdef extern from "numpy/arrayobject.h":
1914 : */
1915 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1916 :
1917 : /* "scipy/linalg/cython_lapack.pxd":24
1918 : * # Function pointer type declarations for
1919 : * # gees and gges families of functions.
1920 : * ctypedef bint cselect1(c*) # <<<<<<<<<<<<<<
1921 : * ctypedef bint cselect2(c*, c*)
1922 : * ctypedef bint dselect2(d*, d*)
1923 : */
1924 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect1(__pyx_t_float_complex *);
1925 :
1926 : /* "scipy/linalg/cython_lapack.pxd":25
1927 : * # gees and gges families of functions.
1928 : * ctypedef bint cselect1(c*)
1929 : * ctypedef bint cselect2(c*, c*) # <<<<<<<<<<<<<<
1930 : * ctypedef bint dselect2(d*, d*)
1931 : * ctypedef bint dselect3(d*, d*, d*)
1932 : */
1933 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect2(__pyx_t_float_complex *, __pyx_t_float_complex *);
1934 :
1935 : /* "scipy/linalg/cython_lapack.pxd":26
1936 : * ctypedef bint cselect1(c*)
1937 : * ctypedef bint cselect2(c*, c*)
1938 : * ctypedef bint dselect2(d*, d*) # <<<<<<<<<<<<<<
1939 : * ctypedef bint dselect3(d*, d*, d*)
1940 : * ctypedef bint sselect2(s*, s*)
1941 : */
1942 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect2(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1943 :
1944 : /* "scipy/linalg/cython_lapack.pxd":27
1945 : * ctypedef bint cselect2(c*, c*)
1946 : * ctypedef bint dselect2(d*, d*)
1947 : * ctypedef bint dselect3(d*, d*, d*) # <<<<<<<<<<<<<<
1948 : * ctypedef bint sselect2(s*, s*)
1949 : * ctypedef bint sselect3(s*, s*, s*)
1950 : */
1951 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect3(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1952 :
1953 : /* "scipy/linalg/cython_lapack.pxd":28
1954 : * ctypedef bint dselect2(d*, d*)
1955 : * ctypedef bint dselect3(d*, d*, d*)
1956 : * ctypedef bint sselect2(s*, s*) # <<<<<<<<<<<<<<
1957 : * ctypedef bint sselect3(s*, s*, s*)
1958 : * ctypedef bint zselect1(z*)
1959 : */
1960 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect2(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1961 :
1962 : /* "scipy/linalg/cython_lapack.pxd":29
1963 : * ctypedef bint dselect3(d*, d*, d*)
1964 : * ctypedef bint sselect2(s*, s*)
1965 : * ctypedef bint sselect3(s*, s*, s*) # <<<<<<<<<<<<<<
1966 : * ctypedef bint zselect1(z*)
1967 : * ctypedef bint zselect2(z*, z*)
1968 : */
1969 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect3(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1970 :
1971 : /* "scipy/linalg/cython_lapack.pxd":30
1972 : * ctypedef bint sselect2(s*, s*)
1973 : * ctypedef bint sselect3(s*, s*, s*)
1974 : * ctypedef bint zselect1(z*) # <<<<<<<<<<<<<<
1975 : * ctypedef bint zselect2(z*, z*)
1976 : *
1977 : */
1978 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect1(__pyx_t_double_complex *);
1979 :
1980 : /* "scipy/linalg/cython_lapack.pxd":31
1981 : * ctypedef bint sselect3(s*, s*, s*)
1982 : * ctypedef bint zselect1(z*)
1983 : * ctypedef bint zselect2(z*, z*) # <<<<<<<<<<<<<<
1984 : *
1985 : * cdef void cbbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, int *m, int *p, int *q, s *theta, s *phi, c *u1, int *ldu1, c *u2, int *ldu2, c *v1t, int *ldv1t, c *v2t, int *ldv2t, s *b11d, s *b11e, s *b12d, s *b12e, s *b21d, s *b21e, s *b22d, s *b22e, s *rwork, int *lrwork, int *info) noexcept nogil
1986 : */
1987 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect2(__pyx_t_double_complex *, __pyx_t_double_complex *);
1988 :
1989 : /* "View.MemoryView":114
1990 : * @cython.collection_type("sequence")
1991 : * @cname("__pyx_array")
1992 : * cdef class array: # <<<<<<<<<<<<<<
1993 : *
1994 : * cdef:
1995 : */
1996 : struct __pyx_array_obj {
1997 : PyObject_HEAD
1998 : struct __pyx_vtabstruct_array *__pyx_vtab;
1999 : char *data;
2000 : Py_ssize_t len;
2001 : char *format;
2002 : int ndim;
2003 : Py_ssize_t *_shape;
2004 : Py_ssize_t *_strides;
2005 : Py_ssize_t itemsize;
2006 : PyObject *mode;
2007 : PyObject *_format;
2008 : void (*callback_free_data)(void *);
2009 : int free_data;
2010 : int dtype_is_object;
2011 : };
2012 :
2013 :
2014 : /* "View.MemoryView":302
2015 : *
2016 : * @cname('__pyx_MemviewEnum')
2017 : * cdef class Enum(object): # <<<<<<<<<<<<<<
2018 : * cdef object name
2019 : * def __init__(self, name):
2020 : */
2021 : struct __pyx_MemviewEnum_obj {
2022 : PyObject_HEAD
2023 : PyObject *name;
2024 : };
2025 :
2026 :
2027 : /* "View.MemoryView":337
2028 : *
2029 : * @cname('__pyx_memoryview')
2030 : * cdef class memoryview: # <<<<<<<<<<<<<<
2031 : *
2032 : * cdef object obj
2033 : */
2034 : struct __pyx_memoryview_obj {
2035 : PyObject_HEAD
2036 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2037 : PyObject *obj;
2038 : PyObject *_size;
2039 : PyObject *_array_interface;
2040 : PyThread_type_lock lock;
2041 : __pyx_atomic_int_type acquisition_count;
2042 : Py_buffer view;
2043 : int flags;
2044 : int dtype_is_object;
2045 : __Pyx_TypeInfo *typeinfo;
2046 : };
2047 :
2048 :
2049 : /* "View.MemoryView":952
2050 : * @cython.collection_type("sequence")
2051 : * @cname('__pyx_memoryviewslice')
2052 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2053 : * "Internal class for passing memoryview slices to Python"
2054 : *
2055 : */
2056 : struct __pyx_memoryviewslice_obj {
2057 : struct __pyx_memoryview_obj __pyx_base;
2058 : __Pyx_memviewslice from_slice;
2059 : PyObject *from_object;
2060 : PyObject *(*to_object_func)(char *);
2061 : int (*to_dtype_func)(char *, PyObject *);
2062 : };
2063 :
2064 :
2065 :
2066 : /* "View.MemoryView":114
2067 : * @cython.collection_type("sequence")
2068 : * @cname("__pyx_array")
2069 : * cdef class array: # <<<<<<<<<<<<<<
2070 : *
2071 : * cdef:
2072 : */
2073 :
2074 : struct __pyx_vtabstruct_array {
2075 : PyObject *(*get_memview)(struct __pyx_array_obj *);
2076 : };
2077 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2078 :
2079 :
2080 : /* "View.MemoryView":337
2081 : *
2082 : * @cname('__pyx_memoryview')
2083 : * cdef class memoryview: # <<<<<<<<<<<<<<
2084 : *
2085 : * cdef object obj
2086 : */
2087 :
2088 : struct __pyx_vtabstruct_memoryview {
2089 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2090 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2091 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2092 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2093 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2094 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2095 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2096 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2097 : };
2098 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2099 :
2100 :
2101 : /* "View.MemoryView":952
2102 : * @cython.collection_type("sequence")
2103 : * @cname('__pyx_memoryviewslice')
2104 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2105 : * "Internal class for passing memoryview slices to Python"
2106 : *
2107 : */
2108 :
2109 : struct __pyx_vtabstruct__memoryviewslice {
2110 : struct __pyx_vtabstruct_memoryview __pyx_base;
2111 : };
2112 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2113 : /* #### Code section: utility_code_proto ### */
2114 :
2115 : /* --- Runtime support code (head) --- */
2116 : /* Refnanny.proto */
2117 : #ifndef CYTHON_REFNANNY
2118 : #define CYTHON_REFNANNY 0
2119 : #endif
2120 : #if CYTHON_REFNANNY
2121 : typedef struct {
2122 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2123 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2124 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2125 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2126 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2127 : void (*FinishContext)(void**);
2128 : } __Pyx_RefNannyAPIStruct;
2129 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2130 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2131 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2132 : #ifdef WITH_THREAD
2133 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2134 : if (acquire_gil) {\
2135 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2136 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2137 : PyGILState_Release(__pyx_gilstate_save);\
2138 : } else {\
2139 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2140 : }
2141 : #define __Pyx_RefNannyFinishContextNogil() {\
2142 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2143 : __Pyx_RefNannyFinishContext();\
2144 : PyGILState_Release(__pyx_gilstate_save);\
2145 : }
2146 : #else
2147 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2148 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2149 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2150 : #endif
2151 : #define __Pyx_RefNannyFinishContextNogil() {\
2152 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2153 : __Pyx_RefNannyFinishContext();\
2154 : PyGILState_Release(__pyx_gilstate_save);\
2155 : }
2156 : #define __Pyx_RefNannyFinishContext()\
2157 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2158 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2159 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2160 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2161 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2162 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2163 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2164 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2165 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2166 : #else
2167 : #define __Pyx_RefNannyDeclarations
2168 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2169 : #define __Pyx_RefNannyFinishContextNogil()
2170 : #define __Pyx_RefNannyFinishContext()
2171 : #define __Pyx_INCREF(r) Py_INCREF(r)
2172 : #define __Pyx_DECREF(r) Py_DECREF(r)
2173 : #define __Pyx_GOTREF(r)
2174 : #define __Pyx_GIVEREF(r)
2175 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2176 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2177 : #define __Pyx_XGOTREF(r)
2178 : #define __Pyx_XGIVEREF(r)
2179 : #endif
2180 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2181 : PyObject *tmp = (PyObject *) r;\
2182 : r = v; Py_XDECREF(tmp);\
2183 : } while (0)
2184 : #define __Pyx_XDECREF_SET(r, v) do {\
2185 : PyObject *tmp = (PyObject *) r;\
2186 : r = v; __Pyx_XDECREF(tmp);\
2187 : } while (0)
2188 : #define __Pyx_DECREF_SET(r, v) do {\
2189 : PyObject *tmp = (PyObject *) r;\
2190 : r = v; __Pyx_DECREF(tmp);\
2191 : } while (0)
2192 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2193 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2194 :
2195 : /* PyErrExceptionMatches.proto */
2196 : #if CYTHON_FAST_THREAD_STATE
2197 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2198 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2199 : #else
2200 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2201 : #endif
2202 :
2203 : /* PyThreadStateGet.proto */
2204 : #if CYTHON_FAST_THREAD_STATE
2205 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2206 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2207 : #if PY_VERSION_HEX >= 0x030C00A6
2208 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2209 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2210 : #else
2211 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2212 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2213 : #endif
2214 : #else
2215 : #define __Pyx_PyThreadState_declare
2216 : #define __Pyx_PyThreadState_assign
2217 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2218 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2219 : #endif
2220 :
2221 : /* PyErrFetchRestore.proto */
2222 : #if CYTHON_FAST_THREAD_STATE
2223 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2224 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2225 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2226 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2227 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2228 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2229 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2230 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2231 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2232 : #else
2233 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2234 : #endif
2235 : #else
2236 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2237 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2238 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2239 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2240 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2241 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2242 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2243 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2244 : #endif
2245 :
2246 : /* PyObjectGetAttrStr.proto */
2247 : #if CYTHON_USE_TYPE_SLOTS
2248 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2249 : #else
2250 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2251 : #endif
2252 :
2253 : /* PyObjectGetAttrStrNoError.proto */
2254 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2255 :
2256 : /* GetBuiltinName.proto */
2257 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2258 :
2259 : /* TupleAndListFromArray.proto */
2260 : #if CYTHON_COMPILING_IN_CPYTHON
2261 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2262 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2263 : #endif
2264 :
2265 : /* IncludeStringH.proto */
2266 : #include <string.h>
2267 :
2268 : /* BytesEquals.proto */
2269 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2270 :
2271 : /* UnicodeEquals.proto */
2272 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2273 :
2274 : /* fastcall.proto */
2275 : #if CYTHON_AVOID_BORROWED_REFS
2276 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2277 : #elif CYTHON_ASSUME_SAFE_MACROS
2278 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2279 : #else
2280 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2281 : #endif
2282 : #if CYTHON_AVOID_BORROWED_REFS
2283 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2284 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2285 : #else
2286 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2287 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2288 : #endif
2289 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2290 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2291 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2292 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2293 : #if CYTHON_METH_FASTCALL
2294 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2295 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2296 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2297 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2298 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2299 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2300 : #else
2301 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2302 : #endif
2303 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2304 : to have the same reference counting */
2305 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2306 : #else
2307 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2308 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2309 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2310 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2311 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2312 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2313 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2314 : #endif
2315 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2316 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2317 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2318 : #else
2319 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2320 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2321 : #endif
2322 :
2323 : /* RaiseArgTupleInvalid.proto */
2324 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2325 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2326 :
2327 : /* RaiseDoubleKeywords.proto */
2328 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2329 :
2330 : /* ParseKeywords.proto */
2331 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2332 : PyObject **argnames[],
2333 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2334 : const char* function_name);
2335 :
2336 : /* ArgTypeTest.proto */
2337 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2338 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2339 : __Pyx__ArgTypeTest(obj, type, name, exact))
2340 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2341 :
2342 : /* RaiseException.proto */
2343 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2344 :
2345 : /* PyFunctionFastCall.proto */
2346 : #if CYTHON_FAST_PYCALL
2347 : #if !CYTHON_VECTORCALL
2348 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2349 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2350 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2351 : #endif
2352 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2353 : (sizeof(char [1 - 2*!(cond)]) - 1)
2354 : #ifndef Py_MEMBER_SIZE
2355 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2356 : #endif
2357 : #if !CYTHON_VECTORCALL
2358 : #if PY_VERSION_HEX >= 0x03080000
2359 : #include "frameobject.h"
2360 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2361 : #ifndef Py_BUILD_CORE
2362 : #define Py_BUILD_CORE 1
2363 : #endif
2364 : #include "internal/pycore_frame.h"
2365 : #endif
2366 : #define __Pxy_PyFrame_Initialize_Offsets()
2367 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2368 : #else
2369 : static size_t __pyx_pyframe_localsplus_offset = 0;
2370 : #include "frameobject.h"
2371 : #define __Pxy_PyFrame_Initialize_Offsets()\
2372 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2373 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2374 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2375 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2376 : #endif
2377 : #endif
2378 : #endif
2379 :
2380 : /* PyObjectCall.proto */
2381 : #if CYTHON_COMPILING_IN_CPYTHON
2382 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2383 : #else
2384 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2385 : #endif
2386 :
2387 : /* PyObjectCallMethO.proto */
2388 : #if CYTHON_COMPILING_IN_CPYTHON
2389 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2390 : #endif
2391 :
2392 : /* PyObjectFastCall.proto */
2393 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2394 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2395 :
2396 : /* RaiseUnexpectedTypeError.proto */
2397 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2398 :
2399 : /* GCCDiagnostics.proto */
2400 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2401 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2402 : #endif
2403 :
2404 : /* BuildPyUnicode.proto */
2405 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2406 : int prepend_sign, char padding_char);
2407 :
2408 : /* CIntToPyUnicode.proto */
2409 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2410 :
2411 : /* CIntToPyUnicode.proto */
2412 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2413 :
2414 : /* JoinPyUnicode.proto */
2415 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2416 : Py_UCS4 max_char);
2417 :
2418 : /* StrEquals.proto */
2419 : #if PY_MAJOR_VERSION >= 3
2420 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2421 : #else
2422 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2423 : #endif
2424 :
2425 : /* PyObjectFormatSimple.proto */
2426 : #if CYTHON_COMPILING_IN_PYPY
2427 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2428 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2429 : PyObject_Format(s, f))
2430 : #elif PY_MAJOR_VERSION < 3
2431 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2432 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2433 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2434 : PyObject_Format(s, f))
2435 : #elif CYTHON_USE_TYPE_SLOTS
2436 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2437 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2438 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2439 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2440 : PyObject_Format(s, f))
2441 : #else
2442 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2443 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2444 : PyObject_Format(s, f))
2445 : #endif
2446 :
2447 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2448 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2449 : /* GetAttr.proto */
2450 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2451 :
2452 : /* GetItemInt.proto */
2453 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2454 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2455 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2456 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2457 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2458 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2459 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2460 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2461 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2462 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2463 : int wraparound, int boundscheck);
2464 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2465 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2466 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2467 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2468 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2469 : int wraparound, int boundscheck);
2470 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2471 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2472 : int is_list, int wraparound, int boundscheck);
2473 :
2474 : /* PyObjectCallOneArg.proto */
2475 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2476 :
2477 : /* ObjectGetItem.proto */
2478 : #if CYTHON_USE_TYPE_SLOTS
2479 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2480 : #else
2481 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2482 : #endif
2483 :
2484 : /* KeywordStringCheck.proto */
2485 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2486 :
2487 : /* DivInt[Py_ssize_t].proto */
2488 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2489 :
2490 : /* UnaryNegOverflows.proto */
2491 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2492 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2493 :
2494 : /* GetAttr3.proto */
2495 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2496 :
2497 : /* PyDictVersioning.proto */
2498 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2499 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2500 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2501 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2502 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2503 : (cache_var) = (value);
2504 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2505 : static PY_UINT64_T __pyx_dict_version = 0;\
2506 : static PyObject *__pyx_dict_cached_value = NULL;\
2507 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2508 : (VAR) = __pyx_dict_cached_value;\
2509 : } else {\
2510 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2511 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2512 : }\
2513 : }
2514 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2515 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2516 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2517 : #else
2518 : #define __PYX_GET_DICT_VERSION(dict) (0)
2519 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2520 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2521 : #endif
2522 :
2523 : /* GetModuleGlobalName.proto */
2524 : #if CYTHON_USE_DICT_VERSIONS
2525 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2526 : static PY_UINT64_T __pyx_dict_version = 0;\
2527 : static PyObject *__pyx_dict_cached_value = NULL;\
2528 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2529 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2530 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2531 : } while(0)
2532 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2533 : PY_UINT64_T __pyx_dict_version;\
2534 : PyObject *__pyx_dict_cached_value;\
2535 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2536 : } while(0)
2537 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2538 : #else
2539 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2540 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2541 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2542 : #endif
2543 :
2544 : /* AssertionsEnabled.proto */
2545 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2546 : #define __Pyx_init_assertions_enabled() (0)
2547 : #define __pyx_assertions_enabled() (1)
2548 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2549 : static int __pyx_assertions_enabled_flag;
2550 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2551 3 : static int __Pyx_init_assertions_enabled(void) {
2552 3 : PyObject *builtins, *debug, *debug_str;
2553 3 : int flag;
2554 3 : builtins = PyEval_GetBuiltins();
2555 3 : if (!builtins) goto bad;
2556 3 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2557 3 : if (!debug_str) goto bad;
2558 3 : debug = PyObject_GetItem(builtins, debug_str);
2559 3 : Py_DECREF(debug_str);
2560 3 : if (!debug) goto bad;
2561 3 : flag = PyObject_IsTrue(debug);
2562 3 : Py_DECREF(debug);
2563 3 : if (flag == -1) goto bad;
2564 3 : __pyx_assertions_enabled_flag = flag;
2565 3 : return 0;
2566 0 : bad:
2567 0 : __pyx_assertions_enabled_flag = 1;
2568 0 : return -1;
2569 : }
2570 : #else
2571 : #define __Pyx_init_assertions_enabled() (0)
2572 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2573 : #endif
2574 :
2575 : /* RaiseTooManyValuesToUnpack.proto */
2576 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2577 :
2578 : /* RaiseNeedMoreValuesToUnpack.proto */
2579 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2580 :
2581 : /* RaiseNoneIterError.proto */
2582 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2583 :
2584 : /* ExtTypeTest.proto */
2585 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2586 :
2587 : /* GetTopmostException.proto */
2588 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2589 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2590 : #endif
2591 :
2592 : /* SaveResetException.proto */
2593 : #if CYTHON_FAST_THREAD_STATE
2594 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2595 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2596 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2597 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2598 : #else
2599 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2600 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2601 : #endif
2602 :
2603 : /* GetException.proto */
2604 : #if CYTHON_FAST_THREAD_STATE
2605 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2606 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2607 : #else
2608 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2609 : #endif
2610 :
2611 : /* SwapException.proto */
2612 : #if CYTHON_FAST_THREAD_STATE
2613 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2614 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2615 : #else
2616 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2617 : #endif
2618 :
2619 : /* Import.proto */
2620 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2621 :
2622 : /* ImportDottedModule.proto */
2623 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2624 : #if PY_MAJOR_VERSION >= 3
2625 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2626 : #endif
2627 :
2628 : /* FastTypeChecks.proto */
2629 : #if CYTHON_COMPILING_IN_CPYTHON
2630 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2631 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2632 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2633 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2634 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2635 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2636 : #else
2637 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2638 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2639 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2640 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2641 : #endif
2642 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2643 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2644 :
2645 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2646 : /* ListCompAppend.proto */
2647 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2648 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2649 0 : PyListObject* L = (PyListObject*) list;
2650 0 : Py_ssize_t len = Py_SIZE(list);
2651 0 : if (likely(L->allocated > len)) {
2652 0 : Py_INCREF(x);
2653 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2654 : L->ob_item[len] = x;
2655 : #else
2656 0 : PyList_SET_ITEM(list, len, x);
2657 : #endif
2658 0 : __Pyx_SET_SIZE(list, len + 1);
2659 0 : return 0;
2660 : }
2661 0 : return PyList_Append(list, x);
2662 : }
2663 : #else
2664 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2665 : #endif
2666 :
2667 : /* PySequenceMultiply.proto */
2668 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2669 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2670 :
2671 : /* SetItemInt.proto */
2672 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2673 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2674 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2675 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2676 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2677 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2678 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2679 : int is_list, int wraparound, int boundscheck);
2680 :
2681 : /* RaiseUnboundLocalError.proto */
2682 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2683 :
2684 : /* DivInt[long].proto */
2685 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2686 :
2687 : /* PySequenceContains.proto */
2688 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2689 0 : int result = PySequence_Contains(seq, item);
2690 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2691 : }
2692 :
2693 : /* ImportFrom.proto */
2694 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2695 :
2696 : /* HasAttr.proto */
2697 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2698 :
2699 : /* RaiseKeywordRequired.proto */
2700 : static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name);
2701 :
2702 : /* IsLittleEndian.proto */
2703 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2704 :
2705 : /* BufferFormatCheck.proto */
2706 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2707 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2708 : __Pyx_BufFmt_StackElem* stack,
2709 : __Pyx_TypeInfo* type);
2710 :
2711 : /* BufferGetAndValidate.proto */
2712 : #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2713 : ((obj == Py_None || obj == NULL) ?\
2714 : (__Pyx_ZeroBuffer(buf), 0) :\
2715 : __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2716 : static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2717 : __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2718 : static void __Pyx_ZeroBuffer(Py_buffer* buf);
2719 : static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2720 : static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2721 : static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2722 :
2723 : /* BufferFallbackError.proto */
2724 : static void __Pyx_RaiseBufferFallbackError(void);
2725 :
2726 : #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
2727 : #define __Pyx_BufPtrCContig3d(type, buf, i0, s0, i1, s1, i2, s2) ((type)((char*)buf + i0 * s0 + i1 * s1) + i2)
2728 : #define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
2729 : /* PyObjectCall2Args.proto */
2730 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2731 :
2732 : /* MatrixMultiply.proto */
2733 : #if PY_VERSION_HEX >= 0x03050000
2734 : #define __Pyx_PyNumber_MatrixMultiply(x,y) PyNumber_MatrixMultiply(x,y)
2735 : #define __Pyx_PyNumber_InPlaceMatrixMultiply(x,y) PyNumber_InPlaceMatrixMultiply(x,y)
2736 : #else
2737 : #define __Pyx_PyNumber_MatrixMultiply(x,y) __Pyx__PyNumber_MatrixMultiply(x, y, "@")
2738 : static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y, const char* op_name);
2739 : static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y);
2740 : #endif
2741 :
2742 : /* CIntToPyUnicode.proto */
2743 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);
2744 :
2745 : /* IterFinish.proto */
2746 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2747 :
2748 : /* UnpackItemEndCheck.proto */
2749 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2750 :
2751 : #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2752 : #define __Pyx_BufPtrFortranContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i1 * s1) + i0)
2753 : /* SliceObject.proto */
2754 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2755 : PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2756 : PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2757 : int has_cstart, int has_cstop, int wraparound);
2758 :
2759 : /* PyIntCompare.proto */
2760 : static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2761 :
2762 : #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
2763 : /* PyIntBinop.proto */
2764 : #if !CYTHON_COMPILING_IN_PYPY
2765 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2766 : #else
2767 : #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2768 : (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2769 : #endif
2770 :
2771 : /* PyIntBinop.proto */
2772 : #if !CYTHON_COMPILING_IN_PYPY
2773 : static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2774 : #else
2775 : #define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
2776 : (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
2777 : #endif
2778 :
2779 : /* PyIntBinop.proto */
2780 : #if !CYTHON_COMPILING_IN_PYPY
2781 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2782 : #else
2783 : #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
2784 : (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
2785 : #endif
2786 :
2787 : /* PyIntCompare.proto */
2788 : static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2789 :
2790 : /* PyIntBinop.proto */
2791 : #if !CYTHON_COMPILING_IN_PYPY
2792 : static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2793 : #else
2794 : #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
2795 : (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2796 : #endif
2797 :
2798 : /* SliceObject.proto */
2799 : #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
2800 : __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
2801 : static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
2802 : PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
2803 : PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2804 : int has_cstart, int has_cstop, int wraparound);
2805 :
2806 : /* PyFloatBinop.proto */
2807 : #if !CYTHON_COMPILING_IN_PYPY
2808 : static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2809 : #else
2810 : #define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace, zerodivision_check)\
2811 : (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
2812 : #endif
2813 :
2814 : /* PyObject_GenericGetAttrNoDict.proto */
2815 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2816 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2817 : #else
2818 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2819 : #endif
2820 :
2821 : /* PyObject_GenericGetAttr.proto */
2822 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2823 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2824 : #else
2825 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2826 : #endif
2827 :
2828 : /* IncludeStructmemberH.proto */
2829 : #include <structmember.h>
2830 :
2831 : /* FixUpExtensionType.proto */
2832 : #if CYTHON_USE_TYPE_SPECS
2833 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2834 : #endif
2835 :
2836 : /* PyObjectCallNoArg.proto */
2837 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2838 :
2839 : /* PyObjectGetMethod.proto */
2840 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2841 :
2842 : /* PyObjectCallMethod0.proto */
2843 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2844 :
2845 : /* ValidateBasesTuple.proto */
2846 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2847 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2848 : #endif
2849 :
2850 : /* PyType_Ready.proto */
2851 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2852 :
2853 : /* SetVTable.proto */
2854 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2855 :
2856 : /* GetVTable.proto */
2857 : static void* __Pyx_GetVtable(PyTypeObject *type);
2858 :
2859 : /* MergeVTables.proto */
2860 : #if !CYTHON_COMPILING_IN_LIMITED_API
2861 : static int __Pyx_MergeVtables(PyTypeObject *type);
2862 : #endif
2863 :
2864 : /* SetupReduce.proto */
2865 : #if !CYTHON_COMPILING_IN_LIMITED_API
2866 : static int __Pyx_setup_reduce(PyObject* type_obj);
2867 : #endif
2868 :
2869 : /* TypeImport.proto */
2870 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2871 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2872 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2873 : #include <stdalign.h>
2874 : #endif
2875 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2876 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2877 : #else
2878 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2879 : #endif
2880 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2881 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2882 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2883 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2884 : };
2885 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2886 : #endif
2887 :
2888 : /* FetchSharedCythonModule.proto */
2889 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2890 :
2891 : /* FetchCommonType.proto */
2892 : #if !CYTHON_USE_TYPE_SPECS
2893 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2894 : #else
2895 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2896 : #endif
2897 :
2898 : /* PyMethodNew.proto */
2899 : #if CYTHON_COMPILING_IN_LIMITED_API
2900 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2901 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2902 : CYTHON_UNUSED_VAR(typ);
2903 : if (!self)
2904 : return __Pyx_NewRef(func);
2905 : typesModule = PyImport_ImportModule("types");
2906 : if (!typesModule) return NULL;
2907 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2908 : Py_DECREF(typesModule);
2909 : if (!methodType) return NULL;
2910 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2911 : Py_DECREF(methodType);
2912 : return result;
2913 : }
2914 : #elif PY_MAJOR_VERSION >= 3
2915 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2916 0 : CYTHON_UNUSED_VAR(typ);
2917 0 : if (!self)
2918 0 : return __Pyx_NewRef(func);
2919 0 : return PyMethod_New(func, self);
2920 : }
2921 : #else
2922 : #define __Pyx_PyMethod_New PyMethod_New
2923 : #endif
2924 :
2925 : /* PyVectorcallFastCallDict.proto */
2926 : #if CYTHON_METH_FASTCALL
2927 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2928 : #endif
2929 :
2930 : /* CythonFunctionShared.proto */
2931 : #define __Pyx_CyFunction_USED
2932 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2933 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2934 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2935 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2936 : #define __Pyx_CyFunction_GetClosure(f)\
2937 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2938 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2939 : #define __Pyx_CyFunction_GetClassObj(f)\
2940 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2941 : #else
2942 : #define __Pyx_CyFunction_GetClassObj(f)\
2943 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2944 : #endif
2945 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2946 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2947 : #define __Pyx_CyFunction_Defaults(type, f)\
2948 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2949 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2950 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2951 : typedef struct {
2952 : #if CYTHON_COMPILING_IN_LIMITED_API
2953 : PyObject_HEAD
2954 : PyObject *func;
2955 : #elif PY_VERSION_HEX < 0x030900B1
2956 : PyCFunctionObject func;
2957 : #else
2958 : PyCMethodObject func;
2959 : #endif
2960 : #if CYTHON_BACKPORT_VECTORCALL
2961 : __pyx_vectorcallfunc func_vectorcall;
2962 : #endif
2963 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2964 : PyObject *func_weakreflist;
2965 : #endif
2966 : PyObject *func_dict;
2967 : PyObject *func_name;
2968 : PyObject *func_qualname;
2969 : PyObject *func_doc;
2970 : PyObject *func_globals;
2971 : PyObject *func_code;
2972 : PyObject *func_closure;
2973 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2974 : PyObject *func_classobj;
2975 : #endif
2976 : void *defaults;
2977 : int defaults_pyobjects;
2978 : size_t defaults_size;
2979 : int flags;
2980 : PyObject *defaults_tuple;
2981 : PyObject *defaults_kwdict;
2982 : PyObject *(*defaults_getter)(PyObject *);
2983 : PyObject *func_annotations;
2984 : PyObject *func_is_coroutine;
2985 : } __pyx_CyFunctionObject;
2986 : #undef __Pyx_CyOrPyCFunction_Check
2987 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2988 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2989 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2990 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2991 : #undef __Pyx_IsSameCFunction
2992 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2993 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2994 : int flags, PyObject* qualname,
2995 : PyObject *closure,
2996 : PyObject *module, PyObject *globals,
2997 : PyObject* code);
2998 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2999 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
3000 : size_t size,
3001 : int pyobjects);
3002 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3003 : PyObject *tuple);
3004 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3005 : PyObject *dict);
3006 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3007 : PyObject *dict);
3008 : static int __pyx_CyFunction_init(PyObject *module);
3009 : #if CYTHON_METH_FASTCALL
3010 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3011 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3012 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3013 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3014 : #if CYTHON_BACKPORT_VECTORCALL
3015 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
3016 : #else
3017 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3018 : #endif
3019 : #endif
3020 :
3021 : /* CythonFunction.proto */
3022 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3023 : int flags, PyObject* qualname,
3024 : PyObject *closure,
3025 : PyObject *module, PyObject *globals,
3026 : PyObject* code);
3027 :
3028 : /* CLineInTraceback.proto */
3029 : #ifdef CYTHON_CLINE_IN_TRACEBACK
3030 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3031 : #else
3032 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3033 : #endif
3034 :
3035 : /* CodeObjectCache.proto */
3036 : #if !CYTHON_COMPILING_IN_LIMITED_API
3037 : typedef struct {
3038 : PyCodeObject* code_object;
3039 : int code_line;
3040 : } __Pyx_CodeObjectCacheEntry;
3041 : struct __Pyx_CodeObjectCache {
3042 : int count;
3043 : int max_count;
3044 : __Pyx_CodeObjectCacheEntry* entries;
3045 : };
3046 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3047 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3048 : static PyCodeObject *__pyx_find_code_object(int code_line);
3049 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3050 : #endif
3051 :
3052 : /* AddTraceback.proto */
3053 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
3054 : int py_line, const char *filename);
3055 :
3056 : #if PY_MAJOR_VERSION < 3
3057 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3058 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
3059 : #else
3060 : #define __Pyx_GetBuffer PyObject_GetBuffer
3061 : #define __Pyx_ReleaseBuffer PyBuffer_Release
3062 : #endif
3063 :
3064 :
3065 : /* BufferStructDeclare.proto */
3066 : typedef struct {
3067 : Py_ssize_t shape, strides, suboffsets;
3068 : } __Pyx_Buf_DimInfo;
3069 : typedef struct {
3070 : size_t refcount;
3071 : Py_buffer pybuffer;
3072 : } __Pyx_Buffer;
3073 : typedef struct {
3074 : __Pyx_Buffer *rcbuffer;
3075 : char *data;
3076 : __Pyx_Buf_DimInfo diminfo[8];
3077 : } __Pyx_LocalBuf_ND;
3078 :
3079 : /* MemviewSliceIsContig.proto */
3080 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3081 :
3082 : /* OverlappingSlices.proto */
3083 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3084 : __Pyx_memviewslice *slice2,
3085 : int ndim, size_t itemsize);
3086 :
3087 : /* RealImag.proto */
3088 : #if CYTHON_CCOMPLEX
3089 : #ifdef __cplusplus
3090 : #define __Pyx_CREAL(z) ((z).real())
3091 : #define __Pyx_CIMAG(z) ((z).imag())
3092 : #else
3093 : #define __Pyx_CREAL(z) (__real__(z))
3094 : #define __Pyx_CIMAG(z) (__imag__(z))
3095 : #endif
3096 : #else
3097 : #define __Pyx_CREAL(z) ((z).real)
3098 : #define __Pyx_CIMAG(z) ((z).imag)
3099 : #endif
3100 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3101 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3102 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3103 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3104 : #else
3105 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3106 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3107 : #endif
3108 :
3109 : /* Arithmetic.proto */
3110 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3111 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
3112 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
3113 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
3114 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
3115 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3116 : #define __Pyx_c_neg_double(a) (-(a))
3117 : #ifdef __cplusplus
3118 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3119 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3120 : #if 1
3121 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3122 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3123 : #endif
3124 : #else
3125 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3126 : #define __Pyx_c_conj_double(z) (conj(z))
3127 : #if 1
3128 : #define __Pyx_c_abs_double(z) (cabs(z))
3129 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3130 : #endif
3131 : #endif
3132 : #else
3133 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3134 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3135 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3136 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3137 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3138 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3139 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3140 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3141 : #if 1
3142 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3143 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3144 : #endif
3145 : #endif
3146 :
3147 : /* TypeInfoCompare.proto */
3148 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3149 :
3150 : /* MemviewSliceValidateAndInit.proto */
3151 : static int __Pyx_ValidateAndInit_memviewslice(
3152 : int *axes_specs,
3153 : int c_or_f_flag,
3154 : int buf_flags,
3155 : int ndim,
3156 : __Pyx_TypeInfo *dtype,
3157 : __Pyx_BufFmt_StackElem stack[],
3158 : __Pyx_memviewslice *memviewslice,
3159 : PyObject *original_obj);
3160 :
3161 : /* ObjectToMemviewSlice.proto */
3162 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3163 :
3164 : /* ObjectToMemviewSlice.proto */
3165 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3166 :
3167 : /* ObjectToMemviewSlice.proto */
3168 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject *, int writable_flag);
3169 :
3170 : /* ToPy.proto */
3171 : #define __pyx_PyComplex_FromComplex(z)\
3172 : PyComplex_FromDoubles((double)__Pyx_CREAL(z),\
3173 : (double)__Pyx_CIMAG(z))
3174 :
3175 : /* ObjectToMemviewSlice.proto */
3176 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *, int writable_flag);
3177 :
3178 : /* RealImag_Cy.proto */
3179 : #define __Pyx_CREAL_Cy(z) ((z).real)
3180 : #define __Pyx_CIMAG_Cy(z) ((z).imag)
3181 : #define __Pyx_SET_CREAL_Cy(z,x) __Pyx_CREAL_Cy(z) = (x)
3182 : #define __Pyx_SET_CIMAG_Cy(z,y) __Pyx_CIMAG_cy(z) = (y)
3183 :
3184 : /* Arithmetic.proto */
3185 : #if CYTHON_CCOMPLEX && (1) && (!1 || __cplusplus)
3186 : #define __Pyx_c_eq_npy_float64(a, b) ((a)==(b))
3187 : #define __Pyx_c_sum_npy_float64(a, b) ((a)+(b))
3188 : #define __Pyx_c_diff_npy_float64(a, b) ((a)-(b))
3189 : #define __Pyx_c_prod_npy_float64(a, b) ((a)*(b))
3190 : #define __Pyx_c_quot_npy_float64(a, b) ((a)/(b))
3191 : #define __Pyx_c_neg_npy_float64(a) (-(a))
3192 : #ifdef __cplusplus
3193 : #define __Pyx_c_is_zero_npy_float64(z) ((z)==(npy_float64)0)
3194 : #define __Pyx_c_conj_npy_float64(z) (::std::conj(z))
3195 : #if 1
3196 : #define __Pyx_c_abs_npy_float64(z) (::std::abs(z))
3197 : #define __Pyx_c_pow_npy_float64(a, b) (::std::pow(a, b))
3198 : #endif
3199 : #else
3200 : #define __Pyx_c_is_zero_npy_float64(z) ((z)==0)
3201 : #define __Pyx_c_conj_npy_float64(z) (conj(z))
3202 : #if 1
3203 : #define __Pyx_c_abs_npy_float64(z) (cabs(z))
3204 : #define __Pyx_c_pow_npy_float64(a, b) (cpow(a, b))
3205 : #endif
3206 : #endif
3207 : #else
3208 : static CYTHON_INLINE int __Pyx_c_eq_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3209 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_sum_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3210 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_diff_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3211 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_prod_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3212 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_quot_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3213 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_neg_npy_float64(__pyx_t_npy_float64_complex);
3214 : static CYTHON_INLINE int __Pyx_c_is_zero_npy_float64(__pyx_t_npy_float64_complex);
3215 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_conj_npy_float64(__pyx_t_npy_float64_complex);
3216 : #if 1
3217 : static CYTHON_INLINE npy_float64 __Pyx_c_abs_npy_float64(__pyx_t_npy_float64_complex);
3218 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_pow_npy_float64(__pyx_t_npy_float64_complex, __pyx_t_npy_float64_complex);
3219 : #endif
3220 : #endif
3221 :
3222 : /* ToPy.proto */
3223 : #define __pyx_PyComplex_FromComplex_CyTypedef(z)\
3224 : PyComplex_FromDoubles((double)__Pyx_CREAL_CyTypedef(z),\
3225 : (double)__Pyx_CIMAG_CyTypedef(z))
3226 :
3227 : /* Arithmetic.proto */
3228 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3229 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
3230 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
3231 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
3232 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
3233 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
3234 : #define __Pyx_c_neg_float(a) (-(a))
3235 : #ifdef __cplusplus
3236 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3237 : #define __Pyx_c_conj_float(z) (::std::conj(z))
3238 : #if 1
3239 : #define __Pyx_c_abs_float(z) (::std::abs(z))
3240 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3241 : #endif
3242 : #else
3243 : #define __Pyx_c_is_zero_float(z) ((z)==0)
3244 : #define __Pyx_c_conj_float(z) (conjf(z))
3245 : #if 1
3246 : #define __Pyx_c_abs_float(z) (cabsf(z))
3247 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3248 : #endif
3249 : #endif
3250 : #else
3251 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3252 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3253 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3254 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3255 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3256 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3257 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3258 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3259 : #if 1
3260 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3261 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3262 : #endif
3263 : #endif
3264 :
3265 : /* Arithmetic.proto */
3266 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3267 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3268 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3269 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3270 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3271 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3272 : #define __Pyx_c_neg_long__double(a) (-(a))
3273 : #ifdef __cplusplus
3274 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3275 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3276 : #if 1
3277 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3278 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3279 : #endif
3280 : #else
3281 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3282 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3283 : #if 1
3284 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3285 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3286 : #endif
3287 : #endif
3288 : #else
3289 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3290 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3291 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3292 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3293 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3294 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3295 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3296 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3297 : #if 1
3298 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3299 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3300 : #endif
3301 : #endif
3302 :
3303 : /* MemviewSliceCopyTemplate.proto */
3304 : static __Pyx_memviewslice
3305 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3306 : const char *mode, int ndim,
3307 : size_t sizeof_dtype, int contig_flag,
3308 : int dtype_is_object);
3309 :
3310 : /* MemviewSliceInit.proto */
3311 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3312 : #define __Pyx_MEMVIEW_DIRECT 1
3313 : #define __Pyx_MEMVIEW_PTR 2
3314 : #define __Pyx_MEMVIEW_FULL 4
3315 : #define __Pyx_MEMVIEW_CONTIG 8
3316 : #define __Pyx_MEMVIEW_STRIDED 16
3317 : #define __Pyx_MEMVIEW_FOLLOW 32
3318 : #define __Pyx_IS_C_CONTIG 1
3319 : #define __Pyx_IS_F_CONTIG 2
3320 : static int __Pyx_init_memviewslice(
3321 : struct __pyx_memoryview_obj *memview,
3322 : int ndim,
3323 : __Pyx_memviewslice *memviewslice,
3324 : int memview_is_new_reference);
3325 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3326 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3327 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3328 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3329 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3330 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3331 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3332 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3333 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3334 :
3335 : /* CIntFromPy.proto */
3336 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3337 :
3338 : /* CIntToPy.proto */
3339 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3340 :
3341 : /* CIntToPy.proto */
3342 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3343 :
3344 : /* CIntToPy.proto */
3345 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3346 :
3347 : /* CIntFromPy.proto */
3348 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3349 :
3350 : /* RealImag_CyTypedef.proto */
3351 : #if __cplusplus
3352 : #define __Pyx_CREAL_CyTypedef(z) __Pyx_CREAL(z)
3353 : #define __Pyx_CIMAG_CyTypedef(z) __Pyx_CIMAG(z)
3354 : #define __Pyx_SET_CREAL_CyTypedef(z,x) __Pyx_SET_CREAL(z)
3355 : #define __Pyx_SET_CIMAG_CyTypedef(z,x) __Pyx_SET_CIMAG(z)
3356 : #else
3357 : #define __Pyx_CREAL_CyTypedef(z) __Pyx_CREAL_Cy(z)
3358 : #define __Pyx_CIMAG_CyTypedef(z) __Pyx_CIMAG_Cy(z)
3359 : #define __Pyx_SET_CREAL_CyTypedef(z,x) __Pyx_SET_CREAL_Cy(z)
3360 : #define __Pyx_SET_CIMAG_CyTypedef(z,x) __Pyx_SET_CIMAG_Cy(z)
3361 : #endif
3362 :
3363 : /* CIntFromPy.proto */
3364 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3365 :
3366 : /* FormatTypeName.proto */
3367 : #if CYTHON_COMPILING_IN_LIMITED_API
3368 : typedef PyObject *__Pyx_TypeName;
3369 : #define __Pyx_FMT_TYPENAME "%U"
3370 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3371 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3372 : #else
3373 : typedef const char *__Pyx_TypeName;
3374 : #define __Pyx_FMT_TYPENAME "%.200s"
3375 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3376 : #define __Pyx_DECREF_TypeName(obj)
3377 : #endif
3378 :
3379 : /* CheckBinaryVersion.proto */
3380 : static unsigned long __Pyx_get_runtime_version(void);
3381 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3382 :
3383 : /* FunctionImport.proto */
3384 : static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
3385 :
3386 : /* InitStrings.proto */
3387 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3388 :
3389 : /* #### Code section: module_declarations ### */
3390 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3391 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3392 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3393 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3394 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3395 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3396 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3397 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3398 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3399 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3400 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3401 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3402 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3403 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3404 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3405 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3406 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3407 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3408 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3409 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3410 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3411 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3412 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3413 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3414 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3415 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3416 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3417 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3418 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3419 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3420 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3421 :
3422 : /* Module declarations from "libc.string" */
3423 :
3424 : /* Module declarations from "libc.stdio" */
3425 :
3426 : /* Module declarations from "__builtin__" */
3427 :
3428 : /* Module declarations from "cpython.type" */
3429 :
3430 : /* Module declarations from "cpython" */
3431 :
3432 : /* Module declarations from "cpython.object" */
3433 :
3434 : /* Module declarations from "cpython.ref" */
3435 :
3436 : /* Module declarations from "numpy" */
3437 :
3438 : /* Module declarations from "numpy" */
3439 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3440 :
3441 : /* Module declarations from "cpython.mem" */
3442 :
3443 : /* Module declarations from "libc.math" */
3444 :
3445 : /* Module declarations from "scipy.linalg.cython_lapack" */
3446 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp)(int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *); /*proto*/
3447 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dorm2r)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *); /*proto*/
3448 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *); /*proto*/
3449 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zunm2r)(char *, char *, int *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
3450 :
3451 : /* Module declarations from "scipy.linalg.cython_blas" */
3452 : static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dnrm2)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
3453 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrsm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
3454 : static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dznrm2)(int *, __pyx_t_double_complex *, int *); /*proto*/
3455 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrsm)(char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
3456 :
3457 : /* Module declarations from "scipy.linalg._decomp_interpolative" */
3458 : static PyObject *__pyx_collections_abc_Sequence = 0;
3459 : static PyObject *generic = 0;
3460 : static PyObject *strided = 0;
3461 : static PyObject *indirect = 0;
3462 : static PyObject *contiguous = 0;
3463 : static PyObject *indirect_contiguous = 0;
3464 : static int __pyx_memoryview_thread_locks_used;
3465 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3466 : static CYTHON_INLINE int __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_ldiv(int, int); /*proto*/
3467 : static int __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(int); /*proto*/
3468 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3469 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3470 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3471 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3472 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3473 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3474 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3475 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3476 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3477 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3478 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3479 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3480 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3481 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3482 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3483 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3484 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3485 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3486 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3487 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3488 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3489 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3490 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3491 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3492 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3493 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3494 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3495 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3496 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3497 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3498 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3499 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3500 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3501 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3502 : /* #### Code section: typeinfo ### */
3503 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
3504 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
3505 : static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
3506 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int64 = { "npy_int64", NULL, sizeof(npy_int64), { 0 }, 0, __PYX_IS_UNSIGNED(npy_int64) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_int64), 0 };
3507 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_float64 = { "npy_float64", NULL, sizeof(npy_float64), { 0 }, 0, 'R', 0, 0 };
3508 : /* #### Code section: before_global_var ### */
3509 : #define __Pyx_MODULE_NAME "scipy.linalg._decomp_interpolative"
3510 : extern int __pyx_module_is_main_scipy__linalg___decomp_interpolative;
3511 : int __pyx_module_is_main_scipy__linalg___decomp_interpolative = 0;
3512 :
3513 : /* Implementation of "scipy.linalg._decomp_interpolative" */
3514 : /* #### Code section: global_var ### */
3515 : static PyObject *__pyx_builtin_range;
3516 : static PyObject *__pyx_builtin_MemoryError;
3517 : static PyObject *__pyx_builtin___import__;
3518 : static PyObject *__pyx_builtin_ValueError;
3519 : static PyObject *__pyx_builtin_enumerate;
3520 : static PyObject *__pyx_builtin_TypeError;
3521 : static PyObject *__pyx_builtin_AssertionError;
3522 : static PyObject *__pyx_builtin_Ellipsis;
3523 : static PyObject *__pyx_builtin_id;
3524 : static PyObject *__pyx_builtin_IndexError;
3525 : static PyObject *__pyx_builtin_ImportError;
3526 : /* #### Code section: string_decls ### */
3527 : static const char __pyx_k_[] = ": ";
3528 : static const char __pyx_k_A[] = "A";
3529 : static const char __pyx_k_B[] = "B";
3530 : static const char __pyx_k_C[] = "C";
3531 : static const char __pyx_k_F[] = "F";
3532 : static const char __pyx_k_L[] = "L";
3533 : static const char __pyx_k_O[] = "O";
3534 : static const char __pyx_k_S[] = "S";
3535 : static const char __pyx_k_T[] = "T";
3536 : static const char __pyx_k_U[] = "U";
3537 : static const char __pyx_k_V[] = "V";
3538 : static const char __pyx_k_a[] = "a";
3539 : static const char __pyx_k_c[] = "c";
3540 : static const char __pyx_k_h[] = "h";
3541 : static const char __pyx_k_i[] = "i";
3542 : static const char __pyx_k_j[] = "j";
3543 : static const char __pyx_k_k[] = "k";
3544 : static const char __pyx_k_m[] = "m";
3545 : static const char __pyx_k_n[] = "n";
3546 : static const char __pyx_k_p[] = "p";
3547 : static const char __pyx_k_r[] = "r";
3548 : static const char __pyx_k_t[] = "t";
3549 : static const char __pyx_k_u[] = "u";
3550 : static const char __pyx_k_v[] = "v";
3551 : static const char __pyx_k_x[] = "x";
3552 : static const char __pyx_k_y[] = "y";
3553 : static const char __pyx_k_Fc[] = "Fc";
3554 : static const char __pyx_k_UU[] = "UU";
3555 : static const char __pyx_k_VV[] = "VV";
3556 : static const char __pyx_k__2[] = ".";
3557 : static const char __pyx_k__3[] = "*";
3558 : static const char __pyx_k__6[] = "'";
3559 : static const char __pyx_k__7[] = ")";
3560 : static const char __pyx_k_aa[] = "aa";
3561 : static const char __pyx_k_ci[] = "ci";
3562 : static const char __pyx_k_ff[] = "ff";
3563 : static const char __pyx_k_gc[] = "gc";
3564 : static const char __pyx_k_id[] = "id";
3565 : static const char __pyx_k_kk[] = "kk";
3566 : static const char __pyx_k_l2[] = "l2";
3567 : static const char __pyx_k_la[] = "la";
3568 : static const char __pyx_k_mb[] = "mb";
3569 : static const char __pyx_k_n2[] = "n2";
3570 : static const char __pyx_k_np[] = "np";
3571 : static const char __pyx_k_pi[] = "pi";
3572 : static const char __pyx_k_r2[] = "r2";
3573 : static const char __pyx_k_r3[] = "r3";
3574 : static const char __pyx_k_ra[] = "ra";
3575 : static const char __pyx_k_u1[] = "u1";
3576 : static const char __pyx_k_u2[] = "u2";
3577 : static const char __pyx_k_v1[] = "v1";
3578 : static const char __pyx_k_v2[] = "v2";
3579 : static const char __pyx_k__50[] = "_";
3580 : static const char __pyx_k_abc[] = "abc";
3581 : static const char __pyx_k_abs[] = "abs";
3582 : static const char __pyx_k_all[] = "__all__";
3583 : static const char __pyx_k_and[] = " and ";
3584 : static const char __pyx_k_col[] = "col";
3585 : static const char __pyx_k_cos[] = "cos";
3586 : static const char __pyx_k_dm1[] = "dm1";
3587 : static const char __pyx_k_dm2[] = "dm2";
3588 : static const char __pyx_k_eps[] = "eps";
3589 : static const char __pyx_k_exp[] = "exp";
3590 : static const char __pyx_k_fft[] = "fft";
3591 : static const char __pyx_k_got[] = " (got ";
3592 : static const char __pyx_k_idx[] = "idx";
3593 : static const char __pyx_k_ind[] = "ind";
3594 : static const char __pyx_k_int[] = "int";
3595 : static const char __pyx_k_its[] = "its";
3596 : static const char __pyx_k_low[] = "low";
3597 : static const char __pyx_k_new[] = "__new__";
3598 : static const char __pyx_k_obj[] = "obj";
3599 : static const char __pyx_k_one[] = "one";
3600 : static const char __pyx_k_out[] = "out";
3601 : static const char __pyx_k_ret[] = "ret";
3602 : static const char __pyx_k_rng[] = "rng";
3603 : static const char __pyx_k_row[] = "row";
3604 : static const char __pyx_k_rta[] = "rta";
3605 : static const char __pyx_k_sin[] = "sin";
3606 : static const char __pyx_k_svd[] = "svd";
3607 : static const char __pyx_k_sys[] = "sys";
3608 : static const char __pyx_k_tau[] = "tau";
3609 : static const char __pyx_k__102[] = "?";
3610 : static const char __pyx_k_axis[] = "axis";
3611 : static const char __pyx_k_base[] = "base";
3612 : static const char __pyx_k_beta[] = "beta";
3613 : static const char __pyx_k_cols[] = "cols";
3614 : static const char __pyx_k_conj[] = "conj";
3615 : static const char __pyx_k_copy[] = "copy";
3616 : static const char __pyx_k_csum[] = "csum";
3617 : static const char __pyx_k_dict[] = "__dict__";
3618 : static const char __pyx_k_fact[] = "fact";
3619 : static const char __pyx_k_feps[] = "feps";
3620 : static const char __pyx_k_high[] = "high";
3621 : static const char __pyx_k_imag[] = "imag";
3622 : static const char __pyx_k_ind2[] = "ind2";
3623 : static const char __pyx_k_inds[] = "inds";
3624 : static const char __pyx_k_info[] = "info";
3625 : static const char __pyx_k_kpiv[] = "kpiv";
3626 : static const char __pyx_k_loop[] = "loop";
3627 : static const char __pyx_k_main[] = "__main__";
3628 : static const char __pyx_k_mode[] = "mode";
3629 : static const char __pyx_k_name[] = "name";
3630 : static const char __pyx_k_ndim[] = "ndim";
3631 : static const char __pyx_k_pack[] = "pack";
3632 : static const char __pyx_k_proj[] = "proj";
3633 : static const char __pyx_k_real[] = "real";
3634 : static const char __pyx_k_rfft[] = "rfft";
3635 : static const char __pyx_k_rsum[] = "rsum";
3636 : static const char __pyx_k_size[] = "size";
3637 : static const char __pyx_k_spec[] = "__spec__";
3638 : static const char __pyx_k_sqrt[] = "sqrt";
3639 : static const char __pyx_k_step[] = "step";
3640 : static const char __pyx_k_stop[] = "stop";
3641 : static const char __pyx_k_tau1[] = "tau1";
3642 : static const char __pyx_k_tau2[] = "tau2";
3643 : static const char __pyx_k_taus[] = "taus";
3644 : static const char __pyx_k_test[] = "__test__";
3645 : static const char __pyx_k_triu[] = "triu";
3646 : static const char __pyx_k_view[] = "view";
3647 : static const char __pyx_k_ASCII[] = "ASCII";
3648 : static const char __pyx_k_Fcopy[] = "Fcopy";
3649 : static const char __pyx_k_alpha[] = "alpha";
3650 : static const char __pyx_k_array[] = "array";
3651 : static const char __pyx_k_class[] = "__class__";
3652 : static const char __pyx_k_count[] = "count";
3653 : static const char __pyx_k_dtype[] = "dtype";
3654 : static const char __pyx_k_empty[] = "empty";
3655 : static const char __pyx_k_enorm[] = "enorm";
3656 : static const char __pyx_k_error[] = "error";
3657 : static const char __pyx_k_flags[] = "flags";
3658 : static const char __pyx_k_float[] = "float";
3659 : static const char __pyx_k_idivm[] = "idivm";
3660 : static const char __pyx_k_imodm[] = "imodm";
3661 : static const char __pyx_k_index[] = "index";
3662 : static const char __pyx_k_inds1[] = "inds1";
3663 : static const char __pyx_k_inds2[] = "inds2";
3664 : static const char __pyx_k_int_n[] = "int_n";
3665 : static const char __pyx_k_krank[] = "krank";
3666 : static const char __pyx_k_loops[] = "loops";
3667 : static const char __pyx_k_nstep[] = "nstep";
3668 : static const char __pyx_k_nulls[] = "nulls";
3669 : static const char __pyx_k_numpy[] = "numpy";
3670 : static const char __pyx_k_order[] = "order";
3671 : static const char __pyx_k_outer[] = "outer";
3672 : static const char __pyx_k_perms[] = "perms";
3673 : static const char __pyx_k_range[] = "range";
3674 : static const char __pyx_k_ravel[] = "ravel";
3675 : static const char __pyx_k_scipy[] = "scipy";
3676 : static const char __pyx_k_shape[] = "shape";
3677 : static const char __pyx_k_snorm[] = "snorm";
3678 : static const char __pyx_k_ssmax[] = "ssmax";
3679 : static const char __pyx_k_start[] = "start";
3680 : static const char __pyx_k_twopi[] = "twopi";
3681 : static const char __pyx_k_wsave[] = "wsave";
3682 : static const char __pyx_k_zeros[] = "zeros";
3683 : static const char __pyx_k_approx[] = "approx";
3684 : static const char __pyx_k_arange[] = "arange";
3685 : static const char __pyx_k_argmax[] = "argmax";
3686 : static const char __pyx_k_choice[] = "choice";
3687 : static const char __pyx_k_divmod[] = "divmod";
3688 : static const char __pyx_k_einsum[] = "einsum";
3689 : static const char __pyx_k_enable[] = "enable";
3690 : static const char __pyx_k_encode[] = "encode";
3691 : static const char __pyx_k_format[] = "format";
3692 : static const char __pyx_k_giv2x2[] = "giv2x2";
3693 : static const char __pyx_k_import[] = "__import__";
3694 : static const char __pyx_k_intone[] = "intone";
3695 : static const char __pyx_k_linalg[] = "linalg";
3696 : static const char __pyx_k_marker[] = "marker";
3697 : static const char __pyx_k_matmul[] = "matmul";
3698 : static const char __pyx_k_matvec[] = "matvec";
3699 : static const char __pyx_k_name_2[] = "__name__";
3700 : static const char __pyx_k_nblock[] = "nblock";
3701 : static const char __pyx_k_nsteps[] = "nsteps";
3702 : static const char __pyx_k_pickle[] = "pickle";
3703 : static const char __pyx_k_reduce[] = "__reduce__";
3704 : static const char __pyx_k_retarr[] = "retarr";
3705 : static const char __pyx_k_sssmax[] = "sssmax";
3706 : static const char __pyx_k_struct[] = "struct";
3707 : static const char __pyx_k_taus_v[] = "taus_v";
3708 : static const char __pyx_k_twopii[] = "twopii";
3709 : static const char __pyx_k_unpack[] = "unpack";
3710 : static const char __pyx_k_update[] = "update";
3711 : static const char __pyx_k_NDArray[] = "NDArray";
3712 : static const char __pyx_k_albetas[] = "albetas";
3713 : static const char __pyx_k_disable[] = "disable";
3714 : static const char __pyx_k_float64[] = "float64";
3715 : static const char __pyx_k_fortran[] = "fortran";
3716 : static const char __pyx_k_iddp_id[] = "iddp_id";
3717 : static const char __pyx_k_iddr_id[] = "iddr_id";
3718 : static const char __pyx_k_idzp_id[] = "idzp_id";
3719 : static const char __pyx_k_idzr_id[] = "idzr_id";
3720 : static const char __pyx_k_imatmul[] = "__imatmul__";
3721 : static const char __pyx_k_memview[] = "memview";
3722 : static const char __pyx_k_nupdate[] = "nupdate";
3723 : static const char __pyx_k_replace[] = "replace";
3724 : static const char __pyx_k_reshape[] = "reshape";
3725 : static const char __pyx_k_rmatmul[] = "__rmatmul__";
3726 : static const char __pyx_k_rmatvec[] = "rmatvec";
3727 : static const char __pyx_k_ssmaxin[] = "ssmaxin";
3728 : static const char __pyx_k_tau_arr[] = "tau_arr";
3729 : static const char __pyx_k_tmp_int[] = "tmp_int";
3730 : static const char __pyx_k_tmp_sca[] = "tmp_sca";
3731 : static const char __pyx_k_uniform[] = "uniform";
3732 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3733 : static const char __pyx_k_Fmemview[] = "Fmemview";
3734 : static const char __pyx_k_Sequence[] = "Sequence";
3735 : static const char __pyx_k_getstate[] = "__getstate__";
3736 : static const char __pyx_k_idd_ldiv[] = "idd_ldiv";
3737 : static const char __pyx_k_iddp_aid[] = "iddp_aid";
3738 : static const char __pyx_k_iddp_rid[] = "iddp_rid";
3739 : static const char __pyx_k_iddp_svd[] = "iddp_svd";
3740 : static const char __pyx_k_iddr_aid[] = "iddr_aid";
3741 : static const char __pyx_k_iddr_rid[] = "iddr_rid";
3742 : static const char __pyx_k_iddr_svd[] = "iddr_svd";
3743 : static const char __pyx_k_idzp_aid[] = "idzp_aid";
3744 : static const char __pyx_k_idzp_rid[] = "idzp_rid";
3745 : static const char __pyx_k_idzp_svd[] = "idzp_svd";
3746 : static const char __pyx_k_idzr_aid[] = "idzr_aid";
3747 : static const char __pyx_k_idzr_rid[] = "idzr_rid";
3748 : static const char __pyx_k_idzr_svd[] = "idzr_svd";
3749 : static const char __pyx_k_itemsize[] = "itemsize";
3750 : static const char __pyx_k_matmul_2[] = "__matmul__";
3751 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3752 : static const char __pyx_k_register[] = "register";
3753 : static const char __pyx_k_setstate[] = "__setstate__";
3754 : static const char __pyx_k_swapaxes[] = "swapaxes";
3755 : static const char __pyx_k_TypeError[] = "TypeError";
3756 : static const char __pyx_k_col_norms[] = "col_norms";
3757 : static const char __pyx_k_conjugate[] = "conjugate";
3758 : static const char __pyx_k_enumerate[] = "enumerate";
3759 : static const char __pyx_k_idd_snorm[] = "idd_snorm";
3760 : static const char __pyx_k_iddp_asvd[] = "iddp_asvd";
3761 : static const char __pyx_k_iddp_rsvd[] = "iddp_rsvd";
3762 : static const char __pyx_k_iddr_asvd[] = "iddr_asvd";
3763 : static const char __pyx_k_iddr_rsvd[] = "iddr_rsvd";
3764 : static const char __pyx_k_idz_snorm[] = "idz_snorm";
3765 : static const char __pyx_k_idzp_asvd[] = "idzp_asvd";
3766 : static const char __pyx_k_idzp_rsvd[] = "idzp_rsvd";
3767 : static const char __pyx_k_idzr_asvd[] = "idzr_asvd";
3768 : static const char __pyx_k_idzr_rsvd[] = "idzr_rsvd";
3769 : static const char __pyx_k_ij_jim_im[] = "ij,jim->im";
3770 : static const char __pyx_k_isenabled[] = "isenabled";
3771 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3772 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3773 : static const char __pyx_k_scipy_fft[] = "scipy.fft";
3774 : static const char __pyx_k_subselect[] = "subselect";
3775 : static const char __pyx_k_IndexError[] = "IndexError";
3776 : static const char __pyx_k_ValueError[] = "ValueError";
3777 : static const char __pyx_k_complex128[] = "complex128";
3778 : static const char __pyx_k_idd_id2svd[] = "idd_id2svd";
3779 : static const char __pyx_k_iddp_qrpiv[] = "iddp_qrpiv";
3780 : static const char __pyx_k_iddr_qrpiv[] = "iddr_qrpiv";
3781 : static const char __pyx_k_idz_id2svd[] = "idz_id2svd";
3782 : static const char __pyx_k_idzp_qrpiv[] = "idzp_qrpiv";
3783 : static const char __pyx_k_idzr_qrpiv[] = "idzr_qrpiv";
3784 : static const char __pyx_k_no_of_cols[] = "no_of_cols";
3785 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3786 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3787 : static const char __pyx_k_zeros_like[] = "zeros_like";
3788 : static const char __pyx_k_ImportError[] = "ImportError";
3789 : static const char __pyx_k_MemoryError[] = "MemoryError";
3790 : static const char __pyx_k_PickleError[] = "PickleError";
3791 : static const char __pyx_k_collections[] = "collections";
3792 : static const char __pyx_k_idd_estrank[] = "idd_estrank";
3793 : static const char __pyx_k_idd_reconid[] = "idd_reconid";
3794 : static const char __pyx_k_idz_estrank[] = "idz_estrank";
3795 : static const char __pyx_k_idz_reconid[] = "idz_reconid";
3796 : static const char __pyx_k_permutation[] = "permutation";
3797 : static const char __pyx_k_check_finite[] = "check_finite";
3798 : static const char __pyx_k_idd_findrank[] = "idd_findrank";
3799 : static const char __pyx_k_idz_findrank[] = "idz_findrank";
3800 : static const char __pyx_k_initializing[] = "_initializing";
3801 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3802 : static const char __pyx_k_numpy_typing[] = "numpy.typing";
3803 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3804 : static const char __pyx_k_scipy_linalg[] = "scipy.linalg";
3805 : static const char __pyx_k_stringsource[] = "<stringsource>";
3806 : static const char __pyx_k_version_info[] = "version_info";
3807 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3808 : static const char __pyx_k_full_matrices[] = "full_matrices";
3809 : static const char __pyx_k_idd_diffsnorm[] = "idd_diffsnorm";
3810 : static const char __pyx_k_idz_diffsnorm[] = "idz_diffsnorm";
3811 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3812 : static const char __pyx_k_AssertionError[] = "AssertionError";
3813 : static const char __pyx_k_LinearOperator[] = "LinearOperator";
3814 : static const char __pyx_k_idd_poweroftwo[] = "idd_poweroftwo";
3815 : static const char __pyx_k_reallocated_ra[] = "reallocated_ra";
3816 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3817 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3818 : static const char __pyx_k_collections_abc[] = "collections.abc";
3819 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3820 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3821 : static const char __pyx_k_reallocated_ret[] = "reallocated_ret";
3822 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3823 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3824 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3825 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3826 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3827 : static const char __pyx_k_scipy_sparse_linalg[] = "scipy.sparse.linalg";
3828 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3829 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3830 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3831 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3832 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3833 : static const char __pyx_k_idz_id2svdidd_findrank[] = "idz_id2svdidd_findrank";
3834 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3835 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3836 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3837 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3838 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3839 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3840 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3841 : static const char __pyx_k_scipy_linalg_interpolative_idd[] = "'scipy.linalg.interpolative.idd_findrank()' failed to allocate the required memory,";
3842 : static const char __pyx_k_scipy_linalg_interpolative_idz[] = "'scipy.linalg.interpolative.idz_findrank()' failed to allocate the required memory,";
3843 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3844 : static const char __pyx_k_This_file_is_a_Cython_rewrite_o[] = "\nThis file is a Cython rewrite of the original Fortran code of \"ID: A software package\nfor low-rank approximation of matrices via interpolative decompositions, Version 0.4\",\nwritten by Per-Gunnar Martinsson, Vladimir Rokhlin, Yoel Shkolnisky, and Mark Tygert.\n\nThe original Fortran code can be found at the last author's current website\nhttp://tygert.com/software.html\n\n\nReferences\n----------\n\nN. Halko, P.G. Martinsson, and J. A. Tropp, \"Finding structure with randomness:\nprobabilistic algorithms for constructing approximate matrix decompositions\",\nSIAM Review, 53 (2011), pp. 217-288. DOI:10.1137/090771806\n\nH. Cheng, Z. Gimbutas, P.G. Martinsson, V.Rokhlin, \"On the Compression of Low\nRank Matrices\", SIAM Journal of Scientific Computing, 2005, Vol.26(4),\nDOI:10.1137/030602678\n\n\n\nCopyright (C) 2024 SciPy developers\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\na. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\nb. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\nc. Names of the SciPy Developers may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DAT""A, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n\n\nNotes\n-----\n\nThe translated functions from the original Fortran77 code are as follows (with various\ninternal functions subsumed into respective functions):\n\n idd_diffsnorm\n idd_estrank\n idd_findrank\n idd_id2svd\n idd_ldiv\n idd_poweroftwo\n idd_reconid\n idd_snorm\n iddp_aid\n iddp_asvd\n iddp_id\n iddp_qrpiv\n iddp_rid\n iddp_rsvd\n iddp_svd\n iddr_aid\n iddr_asvd\n iddr_id\n iddr_qrpiv\n iddr_rid\n iddr_rsvd\n iddr_svd\n idz_diffsnorm\n idz_estrank\n idz_findrank\n idz_id2svd\n idz_reconid\n idz_snorm\n idzp_aid\n idzp_asvd\n idzp_id\n idzp_qrpiv\n idzp_rid\n idzp_rsvd\n idzp_svd\n idzr_aid\n idzr_asvd\n idzr_id\n idzr_rid\n idzr_rsvd\n idzr_qrpiv\n idzr_svd\n\n";
3845 : static const char __pyx_k_bytes_for_scipy_linalg_interpol[] = " bytes for'scipy.linalg.interpolative.idd_findrank()' function.";
3846 : static const char __pyx_k_bytes_while_trying_to_determine[] = " bytes while trying to determine the rank (currently ";
3847 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/linalg/_decomp_interpolative.pyx";
3848 : static const char __pyx_k_of_a_LinearOperator_with_precis[] = ") of a LinearOperator with precision ";
3849 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3850 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3851 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3852 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3853 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3854 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3855 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3856 : static const char __pyx_k_Failed_to_allocate_at_least_requ[] = "Failed to allocate at least required memory ";
3857 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3858 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3859 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3860 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3861 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3862 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3863 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3864 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3865 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3866 : static const char __pyx_k_scipy_linalg__decomp_interpolati[] = "scipy.linalg._decomp_interpolative";
3867 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3868 : static const char __pyx_k_bytes_for_scipy_linalg_interpol_2[] = " bytes for'scipy.linalg.interpolative.idz_findrank()' function.";
3869 : /* #### Code section: decls ### */
3870 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3871 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3872 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3873 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3874 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3875 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3876 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3877 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3878 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3879 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3880 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3881 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3882 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3883 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3884 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3885 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3886 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3887 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3888 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3889 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3890 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3891 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3892 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3893 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3894 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3895 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3896 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3897 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3898 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3899 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3900 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3901 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3902 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3903 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3904 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3905 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3906 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3907 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3908 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3909 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3910 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3911 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_idd_diffsnorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_rng, int __pyx_v_its); /* proto */
3912 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_2idd_estrank(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3913 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_4idd_findrank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3914 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_6idd_id2svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_cols, PyArrayObject *__pyx_v_perms, PyArrayObject *__pyx_v_proj); /* proto */
3915 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_8idd_reconid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_B, PyObject *__pyx_v_idx, PyObject *__pyx_v_proj); /* proto */
3916 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_10idd_snorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_rng, int __pyx_v_its); /* proto */
3917 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_12iddp_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3918 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_14iddp_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3919 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_16iddp_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps); /* proto */
3920 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_18iddp_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps); /* proto */
3921 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_20iddp_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3922 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_22iddp_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3923 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_24iddp_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps); /* proto */
3924 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_26iddr_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3925 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_28iddr_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3926 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_30iddr_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank); /* proto */
3927 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_32iddr_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, PyObject *__pyx_v_krank); /* proto */
3928 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_34iddr_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3929 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_36iddr_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3930 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_38iddr_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank); /* proto */
3931 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_40idz_diffsnorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_rng, int __pyx_v_its); /* proto */
3932 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_42idz_estrank(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3933 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_44idz_findrank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3934 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_46idz_id2svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_cols, PyArrayObject *__pyx_v_perms, PyArrayObject *__pyx_v_proj); /* proto */
3935 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_48idz_reconid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_B, PyObject *__pyx_v_idx, PyObject *__pyx_v_proj); /* proto */
3936 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_50idz_snorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_rng, int __pyx_v_its); /* proto */
3937 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_52idzp_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3938 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_54idzp_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3939 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_56idzp_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps); /* proto */
3940 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_58idzp_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps); /* proto */
3941 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_60idzp_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3942 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_62idzp_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng); /* proto */
3943 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_64idzp_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps); /* proto */
3944 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_66idzr_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3945 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_68idzr_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3946 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_70idzr_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank); /* proto */
3947 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_72idzr_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank); /* proto */
3948 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_74idzr_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3949 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_76idzr_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng); /* proto */
3950 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_78idzr_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank); /* proto */
3951 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3952 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3953 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3954 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3955 : /* #### Code section: late_includes ### */
3956 : /* #### Code section: module_state ### */
3957 : typedef struct {
3958 : PyObject *__pyx_d;
3959 : PyObject *__pyx_b;
3960 : PyObject *__pyx_cython_runtime;
3961 : PyObject *__pyx_empty_tuple;
3962 : PyObject *__pyx_empty_bytes;
3963 : PyObject *__pyx_empty_unicode;
3964 : #ifdef __Pyx_CyFunction_USED
3965 : PyTypeObject *__pyx_CyFunctionType;
3966 : #endif
3967 : #ifdef __Pyx_FusedFunction_USED
3968 : PyTypeObject *__pyx_FusedFunctionType;
3969 : #endif
3970 : #ifdef __Pyx_Generator_USED
3971 : PyTypeObject *__pyx_GeneratorType;
3972 : #endif
3973 : #ifdef __Pyx_IterableCoroutine_USED
3974 : PyTypeObject *__pyx_IterableCoroutineType;
3975 : #endif
3976 : #ifdef __Pyx_Coroutine_USED
3977 : PyTypeObject *__pyx_CoroutineAwaitType;
3978 : #endif
3979 : #ifdef __Pyx_Coroutine_USED
3980 : PyTypeObject *__pyx_CoroutineType;
3981 : #endif
3982 : #if CYTHON_USE_MODULE_STATE
3983 : #endif
3984 : #if CYTHON_USE_MODULE_STATE
3985 : #endif
3986 : #if CYTHON_USE_MODULE_STATE
3987 : #endif
3988 : #if CYTHON_USE_MODULE_STATE
3989 : #endif
3990 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3991 : #if CYTHON_USE_MODULE_STATE
3992 : #endif
3993 : #if CYTHON_USE_MODULE_STATE
3994 : #endif
3995 : #if CYTHON_USE_MODULE_STATE
3996 : #endif
3997 : #if CYTHON_USE_MODULE_STATE
3998 : #endif
3999 : #if CYTHON_USE_MODULE_STATE
4000 : #endif
4001 : PyTypeObject *__pyx_ptype_5numpy_dtype;
4002 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
4003 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
4004 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
4005 : PyTypeObject *__pyx_ptype_5numpy_generic;
4006 : PyTypeObject *__pyx_ptype_5numpy_number;
4007 : PyTypeObject *__pyx_ptype_5numpy_integer;
4008 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4009 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4010 : PyTypeObject *__pyx_ptype_5numpy_inexact;
4011 : PyTypeObject *__pyx_ptype_5numpy_floating;
4012 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4013 : PyTypeObject *__pyx_ptype_5numpy_flexible;
4014 : PyTypeObject *__pyx_ptype_5numpy_character;
4015 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
4016 : #if CYTHON_USE_MODULE_STATE
4017 : #endif
4018 : #if CYTHON_USE_MODULE_STATE
4019 : #endif
4020 : #if CYTHON_USE_MODULE_STATE
4021 : #endif
4022 : #if CYTHON_USE_MODULE_STATE
4023 : #endif
4024 : #if CYTHON_USE_MODULE_STATE
4025 : PyObject *__pyx_type___pyx_array;
4026 : PyObject *__pyx_type___pyx_MemviewEnum;
4027 : PyObject *__pyx_type___pyx_memoryview;
4028 : PyObject *__pyx_type___pyx_memoryviewslice;
4029 : #endif
4030 : PyTypeObject *__pyx_array_type;
4031 : PyTypeObject *__pyx_MemviewEnum_type;
4032 : PyTypeObject *__pyx_memoryview_type;
4033 : PyTypeObject *__pyx_memoryviewslice_type;
4034 : PyObject *__pyx_kp_u_;
4035 : PyObject *__pyx_n_s_A;
4036 : PyObject *__pyx_n_s_ASCII;
4037 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
4038 : PyObject *__pyx_n_s_AssertionError;
4039 : PyObject *__pyx_n_s_B;
4040 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
4041 : PyObject *__pyx_n_s_C;
4042 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
4043 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
4044 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
4045 : PyObject *__pyx_kp_u_Cannot_index_with_type;
4046 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
4047 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
4048 : PyObject *__pyx_n_s_Ellipsis;
4049 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
4050 : PyObject *__pyx_n_s_F;
4051 : PyObject *__pyx_n_u_F;
4052 : PyObject *__pyx_kp_u_Failed_to_allocate_at_least_requ;
4053 : PyObject *__pyx_n_s_Fc;
4054 : PyObject *__pyx_n_s_Fcopy;
4055 : PyObject *__pyx_n_s_Fmemview;
4056 : PyObject *__pyx_n_s_ImportError;
4057 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
4058 : PyObject *__pyx_n_s_IndexError;
4059 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
4060 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4061 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
4062 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
4063 : PyObject *__pyx_n_s_L;
4064 : PyObject *__pyx_n_s_LinearOperator;
4065 : PyObject *__pyx_n_s_MemoryError;
4066 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4067 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
4068 : PyObject *__pyx_n_s_NDArray;
4069 : PyObject *__pyx_n_b_O;
4070 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
4071 : PyObject *__pyx_n_s_PickleError;
4072 : PyObject *__pyx_n_s_S;
4073 : PyObject *__pyx_n_s_Sequence;
4074 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
4075 : PyObject *__pyx_n_s_T;
4076 : PyObject *__pyx_n_s_TypeError;
4077 : PyObject *__pyx_n_s_U;
4078 : PyObject *__pyx_n_s_UU;
4079 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4080 : PyObject *__pyx_n_s_V;
4081 : PyObject *__pyx_n_s_VV;
4082 : PyObject *__pyx_n_s_ValueError;
4083 : PyObject *__pyx_n_s_View_MemoryView;
4084 : PyObject *__pyx_n_s__102;
4085 : PyObject *__pyx_kp_u__2;
4086 : PyObject *__pyx_n_s__3;
4087 : PyObject *__pyx_n_s__50;
4088 : PyObject *__pyx_kp_u__6;
4089 : PyObject *__pyx_kp_u__7;
4090 : PyObject *__pyx_n_s_a;
4091 : PyObject *__pyx_n_s_aa;
4092 : PyObject *__pyx_n_s_abc;
4093 : PyObject *__pyx_n_s_abs;
4094 : PyObject *__pyx_n_s_albetas;
4095 : PyObject *__pyx_n_s_all;
4096 : PyObject *__pyx_n_s_allocate_buffer;
4097 : PyObject *__pyx_n_s_alpha;
4098 : PyObject *__pyx_kp_u_and;
4099 : PyObject *__pyx_n_s_approx;
4100 : PyObject *__pyx_n_s_arange;
4101 : PyObject *__pyx_n_s_argmax;
4102 : PyObject *__pyx_n_s_array;
4103 : PyObject *__pyx_n_s_asyncio_coroutines;
4104 : PyObject *__pyx_n_s_axis;
4105 : PyObject *__pyx_n_s_base;
4106 : PyObject *__pyx_n_s_beta;
4107 : PyObject *__pyx_kp_u_bytes_for_scipy_linalg_interpol;
4108 : PyObject *__pyx_kp_u_bytes_for_scipy_linalg_interpol_2;
4109 : PyObject *__pyx_kp_u_bytes_while_trying_to_determine;
4110 : PyObject *__pyx_n_s_c;
4111 : PyObject *__pyx_n_u_c;
4112 : PyObject *__pyx_n_s_check_finite;
4113 : PyObject *__pyx_n_s_choice;
4114 : PyObject *__pyx_n_s_ci;
4115 : PyObject *__pyx_n_s_class;
4116 : PyObject *__pyx_n_s_class_getitem;
4117 : PyObject *__pyx_n_s_cline_in_traceback;
4118 : PyObject *__pyx_n_s_col;
4119 : PyObject *__pyx_n_s_col_norms;
4120 : PyObject *__pyx_n_s_collections;
4121 : PyObject *__pyx_kp_s_collections_abc;
4122 : PyObject *__pyx_n_s_cols;
4123 : PyObject *__pyx_n_s_complex128;
4124 : PyObject *__pyx_n_s_conj;
4125 : PyObject *__pyx_n_s_conjugate;
4126 : PyObject *__pyx_kp_s_contiguous_and_direct;
4127 : PyObject *__pyx_kp_s_contiguous_and_indirect;
4128 : PyObject *__pyx_n_s_copy;
4129 : PyObject *__pyx_n_s_cos;
4130 : PyObject *__pyx_n_s_count;
4131 : PyObject *__pyx_n_s_csum;
4132 : PyObject *__pyx_n_s_dict;
4133 : PyObject *__pyx_kp_u_disable;
4134 : PyObject *__pyx_n_s_divmod;
4135 : PyObject *__pyx_n_s_dm1;
4136 : PyObject *__pyx_n_s_dm2;
4137 : PyObject *__pyx_n_s_dtype;
4138 : PyObject *__pyx_n_s_dtype_is_object;
4139 : PyObject *__pyx_n_s_einsum;
4140 : PyObject *__pyx_n_s_empty;
4141 : PyObject *__pyx_kp_u_enable;
4142 : PyObject *__pyx_n_s_encode;
4143 : PyObject *__pyx_n_s_enorm;
4144 : PyObject *__pyx_n_s_enumerate;
4145 : PyObject *__pyx_n_s_eps;
4146 : PyObject *__pyx_n_s_error;
4147 : PyObject *__pyx_n_s_exp;
4148 : PyObject *__pyx_n_s_fact;
4149 : PyObject *__pyx_n_s_feps;
4150 : PyObject *__pyx_n_s_ff;
4151 : PyObject *__pyx_n_s_fft;
4152 : PyObject *__pyx_n_s_flags;
4153 : PyObject *__pyx_n_s_float;
4154 : PyObject *__pyx_n_s_float64;
4155 : PyObject *__pyx_n_s_format;
4156 : PyObject *__pyx_n_s_fortran;
4157 : PyObject *__pyx_n_u_fortran;
4158 : PyObject *__pyx_n_s_full_matrices;
4159 : PyObject *__pyx_kp_u_gc;
4160 : PyObject *__pyx_n_s_getstate;
4161 : PyObject *__pyx_n_s_giv2x2;
4162 : PyObject *__pyx_kp_u_got;
4163 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
4164 : PyObject *__pyx_n_s_h;
4165 : PyObject *__pyx_n_s_high;
4166 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
4167 : PyObject *__pyx_n_s_i;
4168 : PyObject *__pyx_n_s_id;
4169 : PyObject *__pyx_n_s_idd_diffsnorm;
4170 : PyObject *__pyx_n_u_idd_diffsnorm;
4171 : PyObject *__pyx_n_s_idd_estrank;
4172 : PyObject *__pyx_n_u_idd_estrank;
4173 : PyObject *__pyx_n_s_idd_findrank;
4174 : PyObject *__pyx_n_s_idd_id2svd;
4175 : PyObject *__pyx_n_u_idd_id2svd;
4176 : PyObject *__pyx_n_u_idd_ldiv;
4177 : PyObject *__pyx_n_u_idd_poweroftwo;
4178 : PyObject *__pyx_n_s_idd_reconid;
4179 : PyObject *__pyx_n_u_idd_reconid;
4180 : PyObject *__pyx_n_s_idd_snorm;
4181 : PyObject *__pyx_n_u_idd_snorm;
4182 : PyObject *__pyx_n_s_iddp_aid;
4183 : PyObject *__pyx_n_u_iddp_aid;
4184 : PyObject *__pyx_n_s_iddp_asvd;
4185 : PyObject *__pyx_n_u_iddp_asvd;
4186 : PyObject *__pyx_n_s_iddp_id;
4187 : PyObject *__pyx_n_u_iddp_id;
4188 : PyObject *__pyx_n_s_iddp_qrpiv;
4189 : PyObject *__pyx_n_u_iddp_qrpiv;
4190 : PyObject *__pyx_n_s_iddp_rid;
4191 : PyObject *__pyx_n_u_iddp_rid;
4192 : PyObject *__pyx_n_s_iddp_rsvd;
4193 : PyObject *__pyx_n_u_iddp_rsvd;
4194 : PyObject *__pyx_n_s_iddp_svd;
4195 : PyObject *__pyx_n_u_iddp_svd;
4196 : PyObject *__pyx_n_s_iddr_aid;
4197 : PyObject *__pyx_n_u_iddr_aid;
4198 : PyObject *__pyx_n_s_iddr_asvd;
4199 : PyObject *__pyx_n_u_iddr_asvd;
4200 : PyObject *__pyx_n_s_iddr_id;
4201 : PyObject *__pyx_n_u_iddr_id;
4202 : PyObject *__pyx_n_s_iddr_qrpiv;
4203 : PyObject *__pyx_n_u_iddr_qrpiv;
4204 : PyObject *__pyx_n_s_iddr_rid;
4205 : PyObject *__pyx_n_u_iddr_rid;
4206 : PyObject *__pyx_n_s_iddr_rsvd;
4207 : PyObject *__pyx_n_u_iddr_rsvd;
4208 : PyObject *__pyx_n_s_iddr_svd;
4209 : PyObject *__pyx_n_u_iddr_svd;
4210 : PyObject *__pyx_n_s_idivm;
4211 : PyObject *__pyx_n_s_idx;
4212 : PyObject *__pyx_n_s_idz_diffsnorm;
4213 : PyObject *__pyx_n_u_idz_diffsnorm;
4214 : PyObject *__pyx_n_s_idz_estrank;
4215 : PyObject *__pyx_n_u_idz_estrank;
4216 : PyObject *__pyx_n_s_idz_findrank;
4217 : PyObject *__pyx_n_u_idz_findrank;
4218 : PyObject *__pyx_n_s_idz_id2svd;
4219 : PyObject *__pyx_n_u_idz_id2svdidd_findrank;
4220 : PyObject *__pyx_n_s_idz_reconid;
4221 : PyObject *__pyx_n_u_idz_reconid;
4222 : PyObject *__pyx_n_s_idz_snorm;
4223 : PyObject *__pyx_n_u_idz_snorm;
4224 : PyObject *__pyx_n_s_idzp_aid;
4225 : PyObject *__pyx_n_u_idzp_aid;
4226 : PyObject *__pyx_n_s_idzp_asvd;
4227 : PyObject *__pyx_n_u_idzp_asvd;
4228 : PyObject *__pyx_n_s_idzp_id;
4229 : PyObject *__pyx_n_u_idzp_id;
4230 : PyObject *__pyx_n_s_idzp_qrpiv;
4231 : PyObject *__pyx_n_u_idzp_qrpiv;
4232 : PyObject *__pyx_n_s_idzp_rid;
4233 : PyObject *__pyx_n_u_idzp_rid;
4234 : PyObject *__pyx_n_s_idzp_rsvd;
4235 : PyObject *__pyx_n_u_idzp_rsvd;
4236 : PyObject *__pyx_n_s_idzp_svd;
4237 : PyObject *__pyx_n_u_idzp_svd;
4238 : PyObject *__pyx_n_s_idzr_aid;
4239 : PyObject *__pyx_n_u_idzr_aid;
4240 : PyObject *__pyx_n_s_idzr_asvd;
4241 : PyObject *__pyx_n_u_idzr_asvd;
4242 : PyObject *__pyx_n_s_idzr_id;
4243 : PyObject *__pyx_n_u_idzr_id;
4244 : PyObject *__pyx_n_s_idzr_qrpiv;
4245 : PyObject *__pyx_n_u_idzr_qrpiv;
4246 : PyObject *__pyx_n_s_idzr_rid;
4247 : PyObject *__pyx_n_u_idzr_rid;
4248 : PyObject *__pyx_n_s_idzr_rsvd;
4249 : PyObject *__pyx_n_u_idzr_rsvd;
4250 : PyObject *__pyx_n_s_idzr_svd;
4251 : PyObject *__pyx_n_u_idzr_svd;
4252 : PyObject *__pyx_kp_u_ij_jim_im;
4253 : PyObject *__pyx_n_s_imag;
4254 : PyObject *__pyx_n_s_imatmul;
4255 : PyObject *__pyx_n_s_imodm;
4256 : PyObject *__pyx_n_s_import;
4257 : PyObject *__pyx_n_s_ind;
4258 : PyObject *__pyx_n_s_ind2;
4259 : PyObject *__pyx_n_s_index;
4260 : PyObject *__pyx_n_s_inds;
4261 : PyObject *__pyx_n_s_inds1;
4262 : PyObject *__pyx_n_s_inds2;
4263 : PyObject *__pyx_n_s_info;
4264 : PyObject *__pyx_n_s_initializing;
4265 : PyObject *__pyx_n_s_int;
4266 : PyObject *__pyx_n_s_int_n;
4267 : PyObject *__pyx_n_s_intone;
4268 : PyObject *__pyx_n_s_is_coroutine;
4269 : PyObject *__pyx_kp_u_isenabled;
4270 : PyObject *__pyx_n_s_itemsize;
4271 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4272 : PyObject *__pyx_n_s_its;
4273 : PyObject *__pyx_n_s_j;
4274 : PyObject *__pyx_n_s_k;
4275 : PyObject *__pyx_n_s_kk;
4276 : PyObject *__pyx_n_s_kpiv;
4277 : PyObject *__pyx_n_s_krank;
4278 : PyObject *__pyx_n_s_l2;
4279 : PyObject *__pyx_n_s_la;
4280 : PyObject *__pyx_n_s_linalg;
4281 : PyObject *__pyx_n_s_loop;
4282 : PyObject *__pyx_n_s_loops;
4283 : PyObject *__pyx_n_s_low;
4284 : PyObject *__pyx_n_s_m;
4285 : PyObject *__pyx_n_s_main;
4286 : PyObject *__pyx_n_s_marker;
4287 : PyObject *__pyx_n_s_matmul;
4288 : PyObject *__pyx_n_s_matmul_2;
4289 : PyObject *__pyx_n_s_matvec;
4290 : PyObject *__pyx_n_s_mb;
4291 : PyObject *__pyx_n_s_memview;
4292 : PyObject *__pyx_n_s_mode;
4293 : PyObject *__pyx_n_s_n;
4294 : PyObject *__pyx_n_s_n2;
4295 : PyObject *__pyx_n_s_name;
4296 : PyObject *__pyx_n_s_name_2;
4297 : PyObject *__pyx_n_s_nblock;
4298 : PyObject *__pyx_n_s_ndim;
4299 : PyObject *__pyx_n_s_new;
4300 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4301 : PyObject *__pyx_n_s_no_of_cols;
4302 : PyObject *__pyx_n_s_np;
4303 : PyObject *__pyx_n_s_nstep;
4304 : PyObject *__pyx_n_s_nsteps;
4305 : PyObject *__pyx_n_s_nulls;
4306 : PyObject *__pyx_n_s_numpy;
4307 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
4308 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
4309 : PyObject *__pyx_n_s_numpy_typing;
4310 : PyObject *__pyx_n_s_nupdate;
4311 : PyObject *__pyx_n_s_obj;
4312 : PyObject *__pyx_kp_u_of_a_LinearOperator_with_precis;
4313 : PyObject *__pyx_n_s_one;
4314 : PyObject *__pyx_n_s_order;
4315 : PyObject *__pyx_n_s_out;
4316 : PyObject *__pyx_n_s_outer;
4317 : PyObject *__pyx_n_s_p;
4318 : PyObject *__pyx_n_s_pack;
4319 : PyObject *__pyx_n_s_perms;
4320 : PyObject *__pyx_n_s_permutation;
4321 : PyObject *__pyx_n_s_pi;
4322 : PyObject *__pyx_n_s_pickle;
4323 : PyObject *__pyx_n_s_proj;
4324 : PyObject *__pyx_n_s_pyx_PickleError;
4325 : PyObject *__pyx_n_s_pyx_checksum;
4326 : PyObject *__pyx_n_s_pyx_result;
4327 : PyObject *__pyx_n_s_pyx_state;
4328 : PyObject *__pyx_n_s_pyx_type;
4329 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
4330 : PyObject *__pyx_n_s_pyx_vtable;
4331 : PyObject *__pyx_n_s_r;
4332 : PyObject *__pyx_n_s_r2;
4333 : PyObject *__pyx_n_s_r3;
4334 : PyObject *__pyx_n_s_ra;
4335 : PyObject *__pyx_n_s_range;
4336 : PyObject *__pyx_n_s_ravel;
4337 : PyObject *__pyx_n_s_real;
4338 : PyObject *__pyx_n_s_reallocated_ra;
4339 : PyObject *__pyx_n_s_reallocated_ret;
4340 : PyObject *__pyx_n_s_reduce;
4341 : PyObject *__pyx_n_s_reduce_cython;
4342 : PyObject *__pyx_n_s_reduce_ex;
4343 : PyObject *__pyx_n_s_register;
4344 : PyObject *__pyx_n_s_replace;
4345 : PyObject *__pyx_n_s_reshape;
4346 : PyObject *__pyx_n_s_ret;
4347 : PyObject *__pyx_n_s_retarr;
4348 : PyObject *__pyx_n_s_rfft;
4349 : PyObject *__pyx_n_s_rmatmul;
4350 : PyObject *__pyx_n_s_rmatvec;
4351 : PyObject *__pyx_n_s_rng;
4352 : PyObject *__pyx_n_s_row;
4353 : PyObject *__pyx_n_s_rsum;
4354 : PyObject *__pyx_n_s_rta;
4355 : PyObject *__pyx_n_s_scipy;
4356 : PyObject *__pyx_n_s_scipy_fft;
4357 : PyObject *__pyx_n_s_scipy_linalg;
4358 : PyObject *__pyx_n_s_scipy_linalg__decomp_interpolati;
4359 : PyObject *__pyx_kp_u_scipy_linalg_interpolative_idd;
4360 : PyObject *__pyx_kp_u_scipy_linalg_interpolative_idz;
4361 : PyObject *__pyx_n_s_scipy_sparse_linalg;
4362 : PyObject *__pyx_n_s_setstate;
4363 : PyObject *__pyx_n_s_setstate_cython;
4364 : PyObject *__pyx_n_s_shape;
4365 : PyObject *__pyx_n_s_sin;
4366 : PyObject *__pyx_n_s_size;
4367 : PyObject *__pyx_n_s_snorm;
4368 : PyObject *__pyx_n_s_spec;
4369 : PyObject *__pyx_n_s_sqrt;
4370 : PyObject *__pyx_n_s_ssmax;
4371 : PyObject *__pyx_n_s_ssmaxin;
4372 : PyObject *__pyx_n_s_sssmax;
4373 : PyObject *__pyx_n_s_start;
4374 : PyObject *__pyx_n_s_step;
4375 : PyObject *__pyx_n_s_stop;
4376 : PyObject *__pyx_kp_s_strided_and_direct;
4377 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4378 : PyObject *__pyx_kp_s_strided_and_indirect;
4379 : PyObject *__pyx_kp_s_stringsource;
4380 : PyObject *__pyx_n_s_struct;
4381 : PyObject *__pyx_n_s_subselect;
4382 : PyObject *__pyx_n_s_svd;
4383 : PyObject *__pyx_n_s_swapaxes;
4384 : PyObject *__pyx_n_s_sys;
4385 : PyObject *__pyx_n_s_t;
4386 : PyObject *__pyx_n_s_tau;
4387 : PyObject *__pyx_n_s_tau1;
4388 : PyObject *__pyx_n_s_tau2;
4389 : PyObject *__pyx_n_s_tau_arr;
4390 : PyObject *__pyx_n_s_taus;
4391 : PyObject *__pyx_n_s_taus_v;
4392 : PyObject *__pyx_n_s_test;
4393 : PyObject *__pyx_n_s_tmp_int;
4394 : PyObject *__pyx_n_s_tmp_sca;
4395 : PyObject *__pyx_n_s_triu;
4396 : PyObject *__pyx_n_s_twopi;
4397 : PyObject *__pyx_n_s_twopii;
4398 : PyObject *__pyx_n_s_u;
4399 : PyObject *__pyx_n_s_u1;
4400 : PyObject *__pyx_n_s_u2;
4401 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4402 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4403 : PyObject *__pyx_n_s_uniform;
4404 : PyObject *__pyx_n_s_unpack;
4405 : PyObject *__pyx_n_s_update;
4406 : PyObject *__pyx_n_s_v;
4407 : PyObject *__pyx_n_s_v1;
4408 : PyObject *__pyx_n_s_v2;
4409 : PyObject *__pyx_n_s_version_info;
4410 : PyObject *__pyx_n_s_view;
4411 : PyObject *__pyx_n_s_wsave;
4412 : PyObject *__pyx_n_s_x;
4413 : PyObject *__pyx_n_s_y;
4414 : PyObject *__pyx_n_s_zeros;
4415 : PyObject *__pyx_n_s_zeros_like;
4416 : PyObject *__pyx_float_0_;
4417 : PyObject *__pyx_float_1_;
4418 : PyObject *__pyx_float_0_0;
4419 : PyObject *__pyx_float_1_0;
4420 : PyObject *__pyx_float_2_0;
4421 : PyObject *__pyx_float_neg_1_;
4422 : PyObject *__pyx_float_neg_1_0;
4423 : PyObject *__pyx_int_0;
4424 : PyObject *__pyx_int_1;
4425 : PyObject *__pyx_int_2;
4426 : PyObject *__pyx_int_3;
4427 : PyObject *__pyx_int_4;
4428 : PyObject *__pyx_int_7;
4429 : PyObject *__pyx_int_112105877;
4430 : PyObject *__pyx_int_136983863;
4431 : PyObject *__pyx_int_184977713;
4432 : PyObject *__pyx_int_neg_1;
4433 : PyObject *__pyx_slice__5;
4434 : PyObject *__pyx_tuple__4;
4435 : PyObject *__pyx_tuple__8;
4436 : PyObject *__pyx_tuple__9;
4437 : PyObject *__pyx_slice__12;
4438 : PyObject *__pyx_slice__16;
4439 : PyObject *__pyx_tuple__10;
4440 : PyObject *__pyx_tuple__11;
4441 : PyObject *__pyx_tuple__13;
4442 : PyObject *__pyx_tuple__14;
4443 : PyObject *__pyx_tuple__15;
4444 : PyObject *__pyx_tuple__17;
4445 : PyObject *__pyx_tuple__18;
4446 : PyObject *__pyx_tuple__19;
4447 : PyObject *__pyx_tuple__20;
4448 : PyObject *__pyx_tuple__21;
4449 : PyObject *__pyx_tuple__22;
4450 : PyObject *__pyx_tuple__23;
4451 : PyObject *__pyx_tuple__24;
4452 : PyObject *__pyx_tuple__25;
4453 : PyObject *__pyx_tuple__26;
4454 : PyObject *__pyx_tuple__27;
4455 : PyObject *__pyx_tuple__28;
4456 : PyObject *__pyx_tuple__29;
4457 : PyObject *__pyx_tuple__30;
4458 : PyObject *__pyx_tuple__31;
4459 : PyObject *__pyx_tuple__33;
4460 : PyObject *__pyx_tuple__34;
4461 : PyObject *__pyx_tuple__36;
4462 : PyObject *__pyx_tuple__38;
4463 : PyObject *__pyx_tuple__40;
4464 : PyObject *__pyx_tuple__42;
4465 : PyObject *__pyx_tuple__44;
4466 : PyObject *__pyx_tuple__46;
4467 : PyObject *__pyx_tuple__48;
4468 : PyObject *__pyx_tuple__51;
4469 : PyObject *__pyx_tuple__53;
4470 : PyObject *__pyx_tuple__55;
4471 : PyObject *__pyx_tuple__57;
4472 : PyObject *__pyx_tuple__59;
4473 : PyObject *__pyx_tuple__61;
4474 : PyObject *__pyx_tuple__63;
4475 : PyObject *__pyx_tuple__65;
4476 : PyObject *__pyx_tuple__67;
4477 : PyObject *__pyx_tuple__69;
4478 : PyObject *__pyx_tuple__71;
4479 : PyObject *__pyx_tuple__73;
4480 : PyObject *__pyx_tuple__76;
4481 : PyObject *__pyx_tuple__78;
4482 : PyObject *__pyx_tuple__89;
4483 : PyObject *__pyx_tuple__91;
4484 : PyObject *__pyx_tuple__94;
4485 : PyObject *__pyx_tuple__96;
4486 : PyObject *__pyx_tuple__100;
4487 : PyObject *__pyx_codeobj__32;
4488 : PyObject *__pyx_codeobj__35;
4489 : PyObject *__pyx_codeobj__37;
4490 : PyObject *__pyx_codeobj__39;
4491 : PyObject *__pyx_codeobj__41;
4492 : PyObject *__pyx_codeobj__43;
4493 : PyObject *__pyx_codeobj__45;
4494 : PyObject *__pyx_codeobj__47;
4495 : PyObject *__pyx_codeobj__49;
4496 : PyObject *__pyx_codeobj__52;
4497 : PyObject *__pyx_codeobj__54;
4498 : PyObject *__pyx_codeobj__56;
4499 : PyObject *__pyx_codeobj__58;
4500 : PyObject *__pyx_codeobj__60;
4501 : PyObject *__pyx_codeobj__62;
4502 : PyObject *__pyx_codeobj__64;
4503 : PyObject *__pyx_codeobj__66;
4504 : PyObject *__pyx_codeobj__68;
4505 : PyObject *__pyx_codeobj__70;
4506 : PyObject *__pyx_codeobj__72;
4507 : PyObject *__pyx_codeobj__74;
4508 : PyObject *__pyx_codeobj__75;
4509 : PyObject *__pyx_codeobj__77;
4510 : PyObject *__pyx_codeobj__79;
4511 : PyObject *__pyx_codeobj__80;
4512 : PyObject *__pyx_codeobj__81;
4513 : PyObject *__pyx_codeobj__82;
4514 : PyObject *__pyx_codeobj__83;
4515 : PyObject *__pyx_codeobj__84;
4516 : PyObject *__pyx_codeobj__85;
4517 : PyObject *__pyx_codeobj__86;
4518 : PyObject *__pyx_codeobj__87;
4519 : PyObject *__pyx_codeobj__88;
4520 : PyObject *__pyx_codeobj__90;
4521 : PyObject *__pyx_codeobj__92;
4522 : PyObject *__pyx_codeobj__93;
4523 : PyObject *__pyx_codeobj__95;
4524 : PyObject *__pyx_codeobj__97;
4525 : PyObject *__pyx_codeobj__98;
4526 : PyObject *__pyx_codeobj__99;
4527 : PyObject *__pyx_codeobj__101;
4528 : } __pyx_mstate;
4529 :
4530 : #if CYTHON_USE_MODULE_STATE
4531 : #ifdef __cplusplus
4532 : namespace {
4533 : extern struct PyModuleDef __pyx_moduledef;
4534 : } /* anonymous namespace */
4535 : #else
4536 : static struct PyModuleDef __pyx_moduledef;
4537 : #endif
4538 :
4539 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
4540 :
4541 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
4542 :
4543 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
4544 : #else
4545 : static __pyx_mstate __pyx_mstate_global_static =
4546 : #ifdef __cplusplus
4547 : {};
4548 : #else
4549 : {0};
4550 : #endif
4551 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
4552 : #endif
4553 : /* #### Code section: module_state_clear ### */
4554 : #if CYTHON_USE_MODULE_STATE
4555 : static int __pyx_m_clear(PyObject *m) {
4556 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
4557 : if (!clear_module_state) return 0;
4558 : Py_CLEAR(clear_module_state->__pyx_d);
4559 : Py_CLEAR(clear_module_state->__pyx_b);
4560 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4561 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4562 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4563 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4564 : #ifdef __Pyx_CyFunction_USED
4565 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4566 : #endif
4567 : #ifdef __Pyx_FusedFunction_USED
4568 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
4569 : #endif
4570 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4571 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4572 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4573 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4574 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4575 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4576 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4577 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4578 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4579 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4580 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4581 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4582 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4583 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4584 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4585 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4586 : Py_CLEAR(clear_module_state->__pyx_array_type);
4587 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4588 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4589 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4590 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4591 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4592 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4593 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4594 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
4595 : Py_CLEAR(clear_module_state->__pyx_n_s_A);
4596 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
4597 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4598 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
4599 : Py_CLEAR(clear_module_state->__pyx_n_s_B);
4600 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4601 : Py_CLEAR(clear_module_state->__pyx_n_s_C);
4602 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4603 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4604 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4605 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
4606 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4607 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4608 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
4609 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4610 : Py_CLEAR(clear_module_state->__pyx_n_s_F);
4611 : Py_CLEAR(clear_module_state->__pyx_n_u_F);
4612 : Py_CLEAR(clear_module_state->__pyx_kp_u_Failed_to_allocate_at_least_requ);
4613 : Py_CLEAR(clear_module_state->__pyx_n_s_Fc);
4614 : Py_CLEAR(clear_module_state->__pyx_n_s_Fcopy);
4615 : Py_CLEAR(clear_module_state->__pyx_n_s_Fmemview);
4616 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
4617 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4618 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
4619 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4620 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4621 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4622 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4623 : Py_CLEAR(clear_module_state->__pyx_n_s_L);
4624 : Py_CLEAR(clear_module_state->__pyx_n_s_LinearOperator);
4625 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
4626 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4627 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
4628 : Py_CLEAR(clear_module_state->__pyx_n_s_NDArray);
4629 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
4630 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4631 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
4632 : Py_CLEAR(clear_module_state->__pyx_n_s_S);
4633 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
4634 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4635 : Py_CLEAR(clear_module_state->__pyx_n_s_T);
4636 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
4637 : Py_CLEAR(clear_module_state->__pyx_n_s_U);
4638 : Py_CLEAR(clear_module_state->__pyx_n_s_UU);
4639 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4640 : Py_CLEAR(clear_module_state->__pyx_n_s_V);
4641 : Py_CLEAR(clear_module_state->__pyx_n_s_VV);
4642 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
4643 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
4644 : Py_CLEAR(clear_module_state->__pyx_n_s__102);
4645 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
4646 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
4647 : Py_CLEAR(clear_module_state->__pyx_n_s__50);
4648 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
4649 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4650 : Py_CLEAR(clear_module_state->__pyx_n_s_a);
4651 : Py_CLEAR(clear_module_state->__pyx_n_s_aa);
4652 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4653 : Py_CLEAR(clear_module_state->__pyx_n_s_abs);
4654 : Py_CLEAR(clear_module_state->__pyx_n_s_albetas);
4655 : Py_CLEAR(clear_module_state->__pyx_n_s_all);
4656 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
4657 : Py_CLEAR(clear_module_state->__pyx_n_s_alpha);
4658 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
4659 : Py_CLEAR(clear_module_state->__pyx_n_s_approx);
4660 : Py_CLEAR(clear_module_state->__pyx_n_s_arange);
4661 : Py_CLEAR(clear_module_state->__pyx_n_s_argmax);
4662 : Py_CLEAR(clear_module_state->__pyx_n_s_array);
4663 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
4664 : Py_CLEAR(clear_module_state->__pyx_n_s_axis);
4665 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
4666 : Py_CLEAR(clear_module_state->__pyx_n_s_beta);
4667 : Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_for_scipy_linalg_interpol);
4668 : Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_for_scipy_linalg_interpol_2);
4669 : Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_while_trying_to_determine);
4670 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
4671 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
4672 : Py_CLEAR(clear_module_state->__pyx_n_s_check_finite);
4673 : Py_CLEAR(clear_module_state->__pyx_n_s_choice);
4674 : Py_CLEAR(clear_module_state->__pyx_n_s_ci);
4675 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
4676 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
4677 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
4678 : Py_CLEAR(clear_module_state->__pyx_n_s_col);
4679 : Py_CLEAR(clear_module_state->__pyx_n_s_col_norms);
4680 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
4681 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
4682 : Py_CLEAR(clear_module_state->__pyx_n_s_cols);
4683 : Py_CLEAR(clear_module_state->__pyx_n_s_complex128);
4684 : Py_CLEAR(clear_module_state->__pyx_n_s_conj);
4685 : Py_CLEAR(clear_module_state->__pyx_n_s_conjugate);
4686 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
4687 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
4688 : Py_CLEAR(clear_module_state->__pyx_n_s_copy);
4689 : Py_CLEAR(clear_module_state->__pyx_n_s_cos);
4690 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
4691 : Py_CLEAR(clear_module_state->__pyx_n_s_csum);
4692 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
4693 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
4694 : Py_CLEAR(clear_module_state->__pyx_n_s_divmod);
4695 : Py_CLEAR(clear_module_state->__pyx_n_s_dm1);
4696 : Py_CLEAR(clear_module_state->__pyx_n_s_dm2);
4697 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
4698 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
4699 : Py_CLEAR(clear_module_state->__pyx_n_s_einsum);
4700 : Py_CLEAR(clear_module_state->__pyx_n_s_empty);
4701 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
4702 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
4703 : Py_CLEAR(clear_module_state->__pyx_n_s_enorm);
4704 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
4705 : Py_CLEAR(clear_module_state->__pyx_n_s_eps);
4706 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
4707 : Py_CLEAR(clear_module_state->__pyx_n_s_exp);
4708 : Py_CLEAR(clear_module_state->__pyx_n_s_fact);
4709 : Py_CLEAR(clear_module_state->__pyx_n_s_feps);
4710 : Py_CLEAR(clear_module_state->__pyx_n_s_ff);
4711 : Py_CLEAR(clear_module_state->__pyx_n_s_fft);
4712 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
4713 : Py_CLEAR(clear_module_state->__pyx_n_s_float);
4714 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
4715 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
4716 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
4717 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
4718 : Py_CLEAR(clear_module_state->__pyx_n_s_full_matrices);
4719 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
4720 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
4721 : Py_CLEAR(clear_module_state->__pyx_n_s_giv2x2);
4722 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
4723 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4724 : Py_CLEAR(clear_module_state->__pyx_n_s_h);
4725 : Py_CLEAR(clear_module_state->__pyx_n_s_high);
4726 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4727 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
4728 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
4729 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_diffsnorm);
4730 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_diffsnorm);
4731 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_estrank);
4732 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_estrank);
4733 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_findrank);
4734 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_id2svd);
4735 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_id2svd);
4736 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_ldiv);
4737 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_poweroftwo);
4738 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_reconid);
4739 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_reconid);
4740 : Py_CLEAR(clear_module_state->__pyx_n_s_idd_snorm);
4741 : Py_CLEAR(clear_module_state->__pyx_n_u_idd_snorm);
4742 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_aid);
4743 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_aid);
4744 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_asvd);
4745 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_asvd);
4746 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_id);
4747 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_id);
4748 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_qrpiv);
4749 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_qrpiv);
4750 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_rid);
4751 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_rid);
4752 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_rsvd);
4753 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_rsvd);
4754 : Py_CLEAR(clear_module_state->__pyx_n_s_iddp_svd);
4755 : Py_CLEAR(clear_module_state->__pyx_n_u_iddp_svd);
4756 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_aid);
4757 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_aid);
4758 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_asvd);
4759 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_asvd);
4760 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_id);
4761 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_id);
4762 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_qrpiv);
4763 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_qrpiv);
4764 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_rid);
4765 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_rid);
4766 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_rsvd);
4767 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_rsvd);
4768 : Py_CLEAR(clear_module_state->__pyx_n_s_iddr_svd);
4769 : Py_CLEAR(clear_module_state->__pyx_n_u_iddr_svd);
4770 : Py_CLEAR(clear_module_state->__pyx_n_s_idivm);
4771 : Py_CLEAR(clear_module_state->__pyx_n_s_idx);
4772 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_diffsnorm);
4773 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_diffsnorm);
4774 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_estrank);
4775 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_estrank);
4776 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_findrank);
4777 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_findrank);
4778 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_id2svd);
4779 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_id2svdidd_findrank);
4780 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_reconid);
4781 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_reconid);
4782 : Py_CLEAR(clear_module_state->__pyx_n_s_idz_snorm);
4783 : Py_CLEAR(clear_module_state->__pyx_n_u_idz_snorm);
4784 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_aid);
4785 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_aid);
4786 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_asvd);
4787 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_asvd);
4788 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_id);
4789 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_id);
4790 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_qrpiv);
4791 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_qrpiv);
4792 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_rid);
4793 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_rid);
4794 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_rsvd);
4795 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_rsvd);
4796 : Py_CLEAR(clear_module_state->__pyx_n_s_idzp_svd);
4797 : Py_CLEAR(clear_module_state->__pyx_n_u_idzp_svd);
4798 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_aid);
4799 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_aid);
4800 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_asvd);
4801 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_asvd);
4802 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_id);
4803 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_id);
4804 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_qrpiv);
4805 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_qrpiv);
4806 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_rid);
4807 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_rid);
4808 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_rsvd);
4809 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_rsvd);
4810 : Py_CLEAR(clear_module_state->__pyx_n_s_idzr_svd);
4811 : Py_CLEAR(clear_module_state->__pyx_n_u_idzr_svd);
4812 : Py_CLEAR(clear_module_state->__pyx_kp_u_ij_jim_im);
4813 : Py_CLEAR(clear_module_state->__pyx_n_s_imag);
4814 : Py_CLEAR(clear_module_state->__pyx_n_s_imatmul);
4815 : Py_CLEAR(clear_module_state->__pyx_n_s_imodm);
4816 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
4817 : Py_CLEAR(clear_module_state->__pyx_n_s_ind);
4818 : Py_CLEAR(clear_module_state->__pyx_n_s_ind2);
4819 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
4820 : Py_CLEAR(clear_module_state->__pyx_n_s_inds);
4821 : Py_CLEAR(clear_module_state->__pyx_n_s_inds1);
4822 : Py_CLEAR(clear_module_state->__pyx_n_s_inds2);
4823 : Py_CLEAR(clear_module_state->__pyx_n_s_info);
4824 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
4825 : Py_CLEAR(clear_module_state->__pyx_n_s_int);
4826 : Py_CLEAR(clear_module_state->__pyx_n_s_int_n);
4827 : Py_CLEAR(clear_module_state->__pyx_n_s_intone);
4828 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
4829 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
4830 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
4831 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4832 : Py_CLEAR(clear_module_state->__pyx_n_s_its);
4833 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
4834 : Py_CLEAR(clear_module_state->__pyx_n_s_k);
4835 : Py_CLEAR(clear_module_state->__pyx_n_s_kk);
4836 : Py_CLEAR(clear_module_state->__pyx_n_s_kpiv);
4837 : Py_CLEAR(clear_module_state->__pyx_n_s_krank);
4838 : Py_CLEAR(clear_module_state->__pyx_n_s_l2);
4839 : Py_CLEAR(clear_module_state->__pyx_n_s_la);
4840 : Py_CLEAR(clear_module_state->__pyx_n_s_linalg);
4841 : Py_CLEAR(clear_module_state->__pyx_n_s_loop);
4842 : Py_CLEAR(clear_module_state->__pyx_n_s_loops);
4843 : Py_CLEAR(clear_module_state->__pyx_n_s_low);
4844 : Py_CLEAR(clear_module_state->__pyx_n_s_m);
4845 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4846 : Py_CLEAR(clear_module_state->__pyx_n_s_marker);
4847 : Py_CLEAR(clear_module_state->__pyx_n_s_matmul);
4848 : Py_CLEAR(clear_module_state->__pyx_n_s_matmul_2);
4849 : Py_CLEAR(clear_module_state->__pyx_n_s_matvec);
4850 : Py_CLEAR(clear_module_state->__pyx_n_s_mb);
4851 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4852 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4853 : Py_CLEAR(clear_module_state->__pyx_n_s_n);
4854 : Py_CLEAR(clear_module_state->__pyx_n_s_n2);
4855 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4856 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4857 : Py_CLEAR(clear_module_state->__pyx_n_s_nblock);
4858 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4859 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4860 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4861 : Py_CLEAR(clear_module_state->__pyx_n_s_no_of_cols);
4862 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4863 : Py_CLEAR(clear_module_state->__pyx_n_s_nstep);
4864 : Py_CLEAR(clear_module_state->__pyx_n_s_nsteps);
4865 : Py_CLEAR(clear_module_state->__pyx_n_s_nulls);
4866 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4867 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4868 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4869 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy_typing);
4870 : Py_CLEAR(clear_module_state->__pyx_n_s_nupdate);
4871 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4872 : Py_CLEAR(clear_module_state->__pyx_kp_u_of_a_LinearOperator_with_precis);
4873 : Py_CLEAR(clear_module_state->__pyx_n_s_one);
4874 : Py_CLEAR(clear_module_state->__pyx_n_s_order);
4875 : Py_CLEAR(clear_module_state->__pyx_n_s_out);
4876 : Py_CLEAR(clear_module_state->__pyx_n_s_outer);
4877 : Py_CLEAR(clear_module_state->__pyx_n_s_p);
4878 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4879 : Py_CLEAR(clear_module_state->__pyx_n_s_perms);
4880 : Py_CLEAR(clear_module_state->__pyx_n_s_permutation);
4881 : Py_CLEAR(clear_module_state->__pyx_n_s_pi);
4882 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4883 : Py_CLEAR(clear_module_state->__pyx_n_s_proj);
4884 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4885 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4886 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4887 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4888 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4889 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4890 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4891 : Py_CLEAR(clear_module_state->__pyx_n_s_r);
4892 : Py_CLEAR(clear_module_state->__pyx_n_s_r2);
4893 : Py_CLEAR(clear_module_state->__pyx_n_s_r3);
4894 : Py_CLEAR(clear_module_state->__pyx_n_s_ra);
4895 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4896 : Py_CLEAR(clear_module_state->__pyx_n_s_ravel);
4897 : Py_CLEAR(clear_module_state->__pyx_n_s_real);
4898 : Py_CLEAR(clear_module_state->__pyx_n_s_reallocated_ra);
4899 : Py_CLEAR(clear_module_state->__pyx_n_s_reallocated_ret);
4900 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4901 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4902 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4903 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4904 : Py_CLEAR(clear_module_state->__pyx_n_s_replace);
4905 : Py_CLEAR(clear_module_state->__pyx_n_s_reshape);
4906 : Py_CLEAR(clear_module_state->__pyx_n_s_ret);
4907 : Py_CLEAR(clear_module_state->__pyx_n_s_retarr);
4908 : Py_CLEAR(clear_module_state->__pyx_n_s_rfft);
4909 : Py_CLEAR(clear_module_state->__pyx_n_s_rmatmul);
4910 : Py_CLEAR(clear_module_state->__pyx_n_s_rmatvec);
4911 : Py_CLEAR(clear_module_state->__pyx_n_s_rng);
4912 : Py_CLEAR(clear_module_state->__pyx_n_s_row);
4913 : Py_CLEAR(clear_module_state->__pyx_n_s_rsum);
4914 : Py_CLEAR(clear_module_state->__pyx_n_s_rta);
4915 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy);
4916 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_fft);
4917 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_linalg);
4918 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_linalg__decomp_interpolati);
4919 : Py_CLEAR(clear_module_state->__pyx_kp_u_scipy_linalg_interpolative_idd);
4920 : Py_CLEAR(clear_module_state->__pyx_kp_u_scipy_linalg_interpolative_idz);
4921 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_sparse_linalg);
4922 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4923 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4924 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4925 : Py_CLEAR(clear_module_state->__pyx_n_s_sin);
4926 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4927 : Py_CLEAR(clear_module_state->__pyx_n_s_snorm);
4928 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4929 : Py_CLEAR(clear_module_state->__pyx_n_s_sqrt);
4930 : Py_CLEAR(clear_module_state->__pyx_n_s_ssmax);
4931 : Py_CLEAR(clear_module_state->__pyx_n_s_ssmaxin);
4932 : Py_CLEAR(clear_module_state->__pyx_n_s_sssmax);
4933 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4934 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4935 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4936 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4937 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4938 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4939 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4940 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4941 : Py_CLEAR(clear_module_state->__pyx_n_s_subselect);
4942 : Py_CLEAR(clear_module_state->__pyx_n_s_svd);
4943 : Py_CLEAR(clear_module_state->__pyx_n_s_swapaxes);
4944 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4945 : Py_CLEAR(clear_module_state->__pyx_n_s_t);
4946 : Py_CLEAR(clear_module_state->__pyx_n_s_tau);
4947 : Py_CLEAR(clear_module_state->__pyx_n_s_tau1);
4948 : Py_CLEAR(clear_module_state->__pyx_n_s_tau2);
4949 : Py_CLEAR(clear_module_state->__pyx_n_s_tau_arr);
4950 : Py_CLEAR(clear_module_state->__pyx_n_s_taus);
4951 : Py_CLEAR(clear_module_state->__pyx_n_s_taus_v);
4952 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4953 : Py_CLEAR(clear_module_state->__pyx_n_s_tmp_int);
4954 : Py_CLEAR(clear_module_state->__pyx_n_s_tmp_sca);
4955 : Py_CLEAR(clear_module_state->__pyx_n_s_triu);
4956 : Py_CLEAR(clear_module_state->__pyx_n_s_twopi);
4957 : Py_CLEAR(clear_module_state->__pyx_n_s_twopii);
4958 : Py_CLEAR(clear_module_state->__pyx_n_s_u);
4959 : Py_CLEAR(clear_module_state->__pyx_n_s_u1);
4960 : Py_CLEAR(clear_module_state->__pyx_n_s_u2);
4961 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4962 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4963 : Py_CLEAR(clear_module_state->__pyx_n_s_uniform);
4964 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4965 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4966 : Py_CLEAR(clear_module_state->__pyx_n_s_v);
4967 : Py_CLEAR(clear_module_state->__pyx_n_s_v1);
4968 : Py_CLEAR(clear_module_state->__pyx_n_s_v2);
4969 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4970 : Py_CLEAR(clear_module_state->__pyx_n_s_view);
4971 : Py_CLEAR(clear_module_state->__pyx_n_s_wsave);
4972 : Py_CLEAR(clear_module_state->__pyx_n_s_x);
4973 : Py_CLEAR(clear_module_state->__pyx_n_s_y);
4974 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4975 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros_like);
4976 : Py_CLEAR(clear_module_state->__pyx_float_0_);
4977 : Py_CLEAR(clear_module_state->__pyx_float_1_);
4978 : Py_CLEAR(clear_module_state->__pyx_float_0_0);
4979 : Py_CLEAR(clear_module_state->__pyx_float_1_0);
4980 : Py_CLEAR(clear_module_state->__pyx_float_2_0);
4981 : Py_CLEAR(clear_module_state->__pyx_float_neg_1_);
4982 : Py_CLEAR(clear_module_state->__pyx_float_neg_1_0);
4983 : Py_CLEAR(clear_module_state->__pyx_int_0);
4984 : Py_CLEAR(clear_module_state->__pyx_int_1);
4985 : Py_CLEAR(clear_module_state->__pyx_int_2);
4986 : Py_CLEAR(clear_module_state->__pyx_int_3);
4987 : Py_CLEAR(clear_module_state->__pyx_int_4);
4988 : Py_CLEAR(clear_module_state->__pyx_int_7);
4989 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4990 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4991 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4992 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4993 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4994 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4995 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4996 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4997 : Py_CLEAR(clear_module_state->__pyx_slice__12);
4998 : Py_CLEAR(clear_module_state->__pyx_slice__16);
4999 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
5000 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
5001 : Py_CLEAR(clear_module_state->__pyx_tuple__13);
5002 : Py_CLEAR(clear_module_state->__pyx_tuple__14);
5003 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
5004 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
5005 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
5006 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
5007 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
5008 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
5009 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
5010 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
5011 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
5012 : Py_CLEAR(clear_module_state->__pyx_tuple__25);
5013 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
5014 : Py_CLEAR(clear_module_state->__pyx_tuple__27);
5015 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
5016 : Py_CLEAR(clear_module_state->__pyx_tuple__29);
5017 : Py_CLEAR(clear_module_state->__pyx_tuple__30);
5018 : Py_CLEAR(clear_module_state->__pyx_tuple__31);
5019 : Py_CLEAR(clear_module_state->__pyx_tuple__33);
5020 : Py_CLEAR(clear_module_state->__pyx_tuple__34);
5021 : Py_CLEAR(clear_module_state->__pyx_tuple__36);
5022 : Py_CLEAR(clear_module_state->__pyx_tuple__38);
5023 : Py_CLEAR(clear_module_state->__pyx_tuple__40);
5024 : Py_CLEAR(clear_module_state->__pyx_tuple__42);
5025 : Py_CLEAR(clear_module_state->__pyx_tuple__44);
5026 : Py_CLEAR(clear_module_state->__pyx_tuple__46);
5027 : Py_CLEAR(clear_module_state->__pyx_tuple__48);
5028 : Py_CLEAR(clear_module_state->__pyx_tuple__51);
5029 : Py_CLEAR(clear_module_state->__pyx_tuple__53);
5030 : Py_CLEAR(clear_module_state->__pyx_tuple__55);
5031 : Py_CLEAR(clear_module_state->__pyx_tuple__57);
5032 : Py_CLEAR(clear_module_state->__pyx_tuple__59);
5033 : Py_CLEAR(clear_module_state->__pyx_tuple__61);
5034 : Py_CLEAR(clear_module_state->__pyx_tuple__63);
5035 : Py_CLEAR(clear_module_state->__pyx_tuple__65);
5036 : Py_CLEAR(clear_module_state->__pyx_tuple__67);
5037 : Py_CLEAR(clear_module_state->__pyx_tuple__69);
5038 : Py_CLEAR(clear_module_state->__pyx_tuple__71);
5039 : Py_CLEAR(clear_module_state->__pyx_tuple__73);
5040 : Py_CLEAR(clear_module_state->__pyx_tuple__76);
5041 : Py_CLEAR(clear_module_state->__pyx_tuple__78);
5042 : Py_CLEAR(clear_module_state->__pyx_tuple__89);
5043 : Py_CLEAR(clear_module_state->__pyx_tuple__91);
5044 : Py_CLEAR(clear_module_state->__pyx_tuple__94);
5045 : Py_CLEAR(clear_module_state->__pyx_tuple__96);
5046 : Py_CLEAR(clear_module_state->__pyx_tuple__100);
5047 : Py_CLEAR(clear_module_state->__pyx_codeobj__32);
5048 : Py_CLEAR(clear_module_state->__pyx_codeobj__35);
5049 : Py_CLEAR(clear_module_state->__pyx_codeobj__37);
5050 : Py_CLEAR(clear_module_state->__pyx_codeobj__39);
5051 : Py_CLEAR(clear_module_state->__pyx_codeobj__41);
5052 : Py_CLEAR(clear_module_state->__pyx_codeobj__43);
5053 : Py_CLEAR(clear_module_state->__pyx_codeobj__45);
5054 : Py_CLEAR(clear_module_state->__pyx_codeobj__47);
5055 : Py_CLEAR(clear_module_state->__pyx_codeobj__49);
5056 : Py_CLEAR(clear_module_state->__pyx_codeobj__52);
5057 : Py_CLEAR(clear_module_state->__pyx_codeobj__54);
5058 : Py_CLEAR(clear_module_state->__pyx_codeobj__56);
5059 : Py_CLEAR(clear_module_state->__pyx_codeobj__58);
5060 : Py_CLEAR(clear_module_state->__pyx_codeobj__60);
5061 : Py_CLEAR(clear_module_state->__pyx_codeobj__62);
5062 : Py_CLEAR(clear_module_state->__pyx_codeobj__64);
5063 : Py_CLEAR(clear_module_state->__pyx_codeobj__66);
5064 : Py_CLEAR(clear_module_state->__pyx_codeobj__68);
5065 : Py_CLEAR(clear_module_state->__pyx_codeobj__70);
5066 : Py_CLEAR(clear_module_state->__pyx_codeobj__72);
5067 : Py_CLEAR(clear_module_state->__pyx_codeobj__74);
5068 : Py_CLEAR(clear_module_state->__pyx_codeobj__75);
5069 : Py_CLEAR(clear_module_state->__pyx_codeobj__77);
5070 : Py_CLEAR(clear_module_state->__pyx_codeobj__79);
5071 : Py_CLEAR(clear_module_state->__pyx_codeobj__80);
5072 : Py_CLEAR(clear_module_state->__pyx_codeobj__81);
5073 : Py_CLEAR(clear_module_state->__pyx_codeobj__82);
5074 : Py_CLEAR(clear_module_state->__pyx_codeobj__83);
5075 : Py_CLEAR(clear_module_state->__pyx_codeobj__84);
5076 : Py_CLEAR(clear_module_state->__pyx_codeobj__85);
5077 : Py_CLEAR(clear_module_state->__pyx_codeobj__86);
5078 : Py_CLEAR(clear_module_state->__pyx_codeobj__87);
5079 : Py_CLEAR(clear_module_state->__pyx_codeobj__88);
5080 : Py_CLEAR(clear_module_state->__pyx_codeobj__90);
5081 : Py_CLEAR(clear_module_state->__pyx_codeobj__92);
5082 : Py_CLEAR(clear_module_state->__pyx_codeobj__93);
5083 : Py_CLEAR(clear_module_state->__pyx_codeobj__95);
5084 : Py_CLEAR(clear_module_state->__pyx_codeobj__97);
5085 : Py_CLEAR(clear_module_state->__pyx_codeobj__98);
5086 : Py_CLEAR(clear_module_state->__pyx_codeobj__99);
5087 : Py_CLEAR(clear_module_state->__pyx_codeobj__101);
5088 : return 0;
5089 : }
5090 : #endif
5091 : /* #### Code section: module_state_traverse ### */
5092 : #if CYTHON_USE_MODULE_STATE
5093 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
5094 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
5095 : if (!traverse_module_state) return 0;
5096 : Py_VISIT(traverse_module_state->__pyx_d);
5097 : Py_VISIT(traverse_module_state->__pyx_b);
5098 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
5099 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
5100 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
5101 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
5102 : #ifdef __Pyx_CyFunction_USED
5103 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
5104 : #endif
5105 : #ifdef __Pyx_FusedFunction_USED
5106 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
5107 : #endif
5108 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
5109 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
5110 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
5111 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
5112 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
5113 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
5114 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
5115 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
5116 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
5117 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
5118 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
5119 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
5120 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
5121 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
5122 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
5123 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
5124 : Py_VISIT(traverse_module_state->__pyx_array_type);
5125 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
5126 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
5127 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
5128 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
5129 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
5130 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
5131 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
5132 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
5133 : Py_VISIT(traverse_module_state->__pyx_n_s_A);
5134 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
5135 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
5136 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
5137 : Py_VISIT(traverse_module_state->__pyx_n_s_B);
5138 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
5139 : Py_VISIT(traverse_module_state->__pyx_n_s_C);
5140 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
5141 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
5142 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
5143 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
5144 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
5145 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
5146 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
5147 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
5148 : Py_VISIT(traverse_module_state->__pyx_n_s_F);
5149 : Py_VISIT(traverse_module_state->__pyx_n_u_F);
5150 : Py_VISIT(traverse_module_state->__pyx_kp_u_Failed_to_allocate_at_least_requ);
5151 : Py_VISIT(traverse_module_state->__pyx_n_s_Fc);
5152 : Py_VISIT(traverse_module_state->__pyx_n_s_Fcopy);
5153 : Py_VISIT(traverse_module_state->__pyx_n_s_Fmemview);
5154 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
5155 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
5156 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
5157 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
5158 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
5159 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
5160 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
5161 : Py_VISIT(traverse_module_state->__pyx_n_s_L);
5162 : Py_VISIT(traverse_module_state->__pyx_n_s_LinearOperator);
5163 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
5164 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
5165 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
5166 : Py_VISIT(traverse_module_state->__pyx_n_s_NDArray);
5167 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
5168 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
5169 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
5170 : Py_VISIT(traverse_module_state->__pyx_n_s_S);
5171 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
5172 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
5173 : Py_VISIT(traverse_module_state->__pyx_n_s_T);
5174 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
5175 : Py_VISIT(traverse_module_state->__pyx_n_s_U);
5176 : Py_VISIT(traverse_module_state->__pyx_n_s_UU);
5177 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
5178 : Py_VISIT(traverse_module_state->__pyx_n_s_V);
5179 : Py_VISIT(traverse_module_state->__pyx_n_s_VV);
5180 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
5181 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
5182 : Py_VISIT(traverse_module_state->__pyx_n_s__102);
5183 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
5184 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
5185 : Py_VISIT(traverse_module_state->__pyx_n_s__50);
5186 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
5187 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
5188 : Py_VISIT(traverse_module_state->__pyx_n_s_a);
5189 : Py_VISIT(traverse_module_state->__pyx_n_s_aa);
5190 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
5191 : Py_VISIT(traverse_module_state->__pyx_n_s_abs);
5192 : Py_VISIT(traverse_module_state->__pyx_n_s_albetas);
5193 : Py_VISIT(traverse_module_state->__pyx_n_s_all);
5194 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
5195 : Py_VISIT(traverse_module_state->__pyx_n_s_alpha);
5196 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
5197 : Py_VISIT(traverse_module_state->__pyx_n_s_approx);
5198 : Py_VISIT(traverse_module_state->__pyx_n_s_arange);
5199 : Py_VISIT(traverse_module_state->__pyx_n_s_argmax);
5200 : Py_VISIT(traverse_module_state->__pyx_n_s_array);
5201 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
5202 : Py_VISIT(traverse_module_state->__pyx_n_s_axis);
5203 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
5204 : Py_VISIT(traverse_module_state->__pyx_n_s_beta);
5205 : Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_for_scipy_linalg_interpol);
5206 : Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_for_scipy_linalg_interpol_2);
5207 : Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_while_trying_to_determine);
5208 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
5209 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
5210 : Py_VISIT(traverse_module_state->__pyx_n_s_check_finite);
5211 : Py_VISIT(traverse_module_state->__pyx_n_s_choice);
5212 : Py_VISIT(traverse_module_state->__pyx_n_s_ci);
5213 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
5214 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
5215 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
5216 : Py_VISIT(traverse_module_state->__pyx_n_s_col);
5217 : Py_VISIT(traverse_module_state->__pyx_n_s_col_norms);
5218 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
5219 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
5220 : Py_VISIT(traverse_module_state->__pyx_n_s_cols);
5221 : Py_VISIT(traverse_module_state->__pyx_n_s_complex128);
5222 : Py_VISIT(traverse_module_state->__pyx_n_s_conj);
5223 : Py_VISIT(traverse_module_state->__pyx_n_s_conjugate);
5224 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
5225 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
5226 : Py_VISIT(traverse_module_state->__pyx_n_s_copy);
5227 : Py_VISIT(traverse_module_state->__pyx_n_s_cos);
5228 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
5229 : Py_VISIT(traverse_module_state->__pyx_n_s_csum);
5230 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
5231 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
5232 : Py_VISIT(traverse_module_state->__pyx_n_s_divmod);
5233 : Py_VISIT(traverse_module_state->__pyx_n_s_dm1);
5234 : Py_VISIT(traverse_module_state->__pyx_n_s_dm2);
5235 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
5236 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
5237 : Py_VISIT(traverse_module_state->__pyx_n_s_einsum);
5238 : Py_VISIT(traverse_module_state->__pyx_n_s_empty);
5239 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
5240 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
5241 : Py_VISIT(traverse_module_state->__pyx_n_s_enorm);
5242 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
5243 : Py_VISIT(traverse_module_state->__pyx_n_s_eps);
5244 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
5245 : Py_VISIT(traverse_module_state->__pyx_n_s_exp);
5246 : Py_VISIT(traverse_module_state->__pyx_n_s_fact);
5247 : Py_VISIT(traverse_module_state->__pyx_n_s_feps);
5248 : Py_VISIT(traverse_module_state->__pyx_n_s_ff);
5249 : Py_VISIT(traverse_module_state->__pyx_n_s_fft);
5250 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
5251 : Py_VISIT(traverse_module_state->__pyx_n_s_float);
5252 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
5253 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
5254 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
5255 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
5256 : Py_VISIT(traverse_module_state->__pyx_n_s_full_matrices);
5257 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
5258 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
5259 : Py_VISIT(traverse_module_state->__pyx_n_s_giv2x2);
5260 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
5261 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
5262 : Py_VISIT(traverse_module_state->__pyx_n_s_h);
5263 : Py_VISIT(traverse_module_state->__pyx_n_s_high);
5264 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
5265 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
5266 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
5267 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_diffsnorm);
5268 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_diffsnorm);
5269 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_estrank);
5270 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_estrank);
5271 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_findrank);
5272 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_id2svd);
5273 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_id2svd);
5274 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_ldiv);
5275 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_poweroftwo);
5276 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_reconid);
5277 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_reconid);
5278 : Py_VISIT(traverse_module_state->__pyx_n_s_idd_snorm);
5279 : Py_VISIT(traverse_module_state->__pyx_n_u_idd_snorm);
5280 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_aid);
5281 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_aid);
5282 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_asvd);
5283 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_asvd);
5284 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_id);
5285 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_id);
5286 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_qrpiv);
5287 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_qrpiv);
5288 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_rid);
5289 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_rid);
5290 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_rsvd);
5291 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_rsvd);
5292 : Py_VISIT(traverse_module_state->__pyx_n_s_iddp_svd);
5293 : Py_VISIT(traverse_module_state->__pyx_n_u_iddp_svd);
5294 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_aid);
5295 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_aid);
5296 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_asvd);
5297 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_asvd);
5298 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_id);
5299 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_id);
5300 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_qrpiv);
5301 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_qrpiv);
5302 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_rid);
5303 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_rid);
5304 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_rsvd);
5305 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_rsvd);
5306 : Py_VISIT(traverse_module_state->__pyx_n_s_iddr_svd);
5307 : Py_VISIT(traverse_module_state->__pyx_n_u_iddr_svd);
5308 : Py_VISIT(traverse_module_state->__pyx_n_s_idivm);
5309 : Py_VISIT(traverse_module_state->__pyx_n_s_idx);
5310 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_diffsnorm);
5311 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_diffsnorm);
5312 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_estrank);
5313 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_estrank);
5314 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_findrank);
5315 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_findrank);
5316 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_id2svd);
5317 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_id2svdidd_findrank);
5318 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_reconid);
5319 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_reconid);
5320 : Py_VISIT(traverse_module_state->__pyx_n_s_idz_snorm);
5321 : Py_VISIT(traverse_module_state->__pyx_n_u_idz_snorm);
5322 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_aid);
5323 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_aid);
5324 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_asvd);
5325 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_asvd);
5326 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_id);
5327 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_id);
5328 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_qrpiv);
5329 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_qrpiv);
5330 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_rid);
5331 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_rid);
5332 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_rsvd);
5333 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_rsvd);
5334 : Py_VISIT(traverse_module_state->__pyx_n_s_idzp_svd);
5335 : Py_VISIT(traverse_module_state->__pyx_n_u_idzp_svd);
5336 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_aid);
5337 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_aid);
5338 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_asvd);
5339 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_asvd);
5340 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_id);
5341 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_id);
5342 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_qrpiv);
5343 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_qrpiv);
5344 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_rid);
5345 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_rid);
5346 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_rsvd);
5347 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_rsvd);
5348 : Py_VISIT(traverse_module_state->__pyx_n_s_idzr_svd);
5349 : Py_VISIT(traverse_module_state->__pyx_n_u_idzr_svd);
5350 : Py_VISIT(traverse_module_state->__pyx_kp_u_ij_jim_im);
5351 : Py_VISIT(traverse_module_state->__pyx_n_s_imag);
5352 : Py_VISIT(traverse_module_state->__pyx_n_s_imatmul);
5353 : Py_VISIT(traverse_module_state->__pyx_n_s_imodm);
5354 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
5355 : Py_VISIT(traverse_module_state->__pyx_n_s_ind);
5356 : Py_VISIT(traverse_module_state->__pyx_n_s_ind2);
5357 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
5358 : Py_VISIT(traverse_module_state->__pyx_n_s_inds);
5359 : Py_VISIT(traverse_module_state->__pyx_n_s_inds1);
5360 : Py_VISIT(traverse_module_state->__pyx_n_s_inds2);
5361 : Py_VISIT(traverse_module_state->__pyx_n_s_info);
5362 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
5363 : Py_VISIT(traverse_module_state->__pyx_n_s_int);
5364 : Py_VISIT(traverse_module_state->__pyx_n_s_int_n);
5365 : Py_VISIT(traverse_module_state->__pyx_n_s_intone);
5366 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
5367 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
5368 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
5369 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
5370 : Py_VISIT(traverse_module_state->__pyx_n_s_its);
5371 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
5372 : Py_VISIT(traverse_module_state->__pyx_n_s_k);
5373 : Py_VISIT(traverse_module_state->__pyx_n_s_kk);
5374 : Py_VISIT(traverse_module_state->__pyx_n_s_kpiv);
5375 : Py_VISIT(traverse_module_state->__pyx_n_s_krank);
5376 : Py_VISIT(traverse_module_state->__pyx_n_s_l2);
5377 : Py_VISIT(traverse_module_state->__pyx_n_s_la);
5378 : Py_VISIT(traverse_module_state->__pyx_n_s_linalg);
5379 : Py_VISIT(traverse_module_state->__pyx_n_s_loop);
5380 : Py_VISIT(traverse_module_state->__pyx_n_s_loops);
5381 : Py_VISIT(traverse_module_state->__pyx_n_s_low);
5382 : Py_VISIT(traverse_module_state->__pyx_n_s_m);
5383 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
5384 : Py_VISIT(traverse_module_state->__pyx_n_s_marker);
5385 : Py_VISIT(traverse_module_state->__pyx_n_s_matmul);
5386 : Py_VISIT(traverse_module_state->__pyx_n_s_matmul_2);
5387 : Py_VISIT(traverse_module_state->__pyx_n_s_matvec);
5388 : Py_VISIT(traverse_module_state->__pyx_n_s_mb);
5389 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
5390 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
5391 : Py_VISIT(traverse_module_state->__pyx_n_s_n);
5392 : Py_VISIT(traverse_module_state->__pyx_n_s_n2);
5393 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
5394 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
5395 : Py_VISIT(traverse_module_state->__pyx_n_s_nblock);
5396 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
5397 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
5398 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
5399 : Py_VISIT(traverse_module_state->__pyx_n_s_no_of_cols);
5400 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
5401 : Py_VISIT(traverse_module_state->__pyx_n_s_nstep);
5402 : Py_VISIT(traverse_module_state->__pyx_n_s_nsteps);
5403 : Py_VISIT(traverse_module_state->__pyx_n_s_nulls);
5404 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
5405 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
5406 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
5407 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy_typing);
5408 : Py_VISIT(traverse_module_state->__pyx_n_s_nupdate);
5409 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
5410 : Py_VISIT(traverse_module_state->__pyx_kp_u_of_a_LinearOperator_with_precis);
5411 : Py_VISIT(traverse_module_state->__pyx_n_s_one);
5412 : Py_VISIT(traverse_module_state->__pyx_n_s_order);
5413 : Py_VISIT(traverse_module_state->__pyx_n_s_out);
5414 : Py_VISIT(traverse_module_state->__pyx_n_s_outer);
5415 : Py_VISIT(traverse_module_state->__pyx_n_s_p);
5416 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
5417 : Py_VISIT(traverse_module_state->__pyx_n_s_perms);
5418 : Py_VISIT(traverse_module_state->__pyx_n_s_permutation);
5419 : Py_VISIT(traverse_module_state->__pyx_n_s_pi);
5420 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
5421 : Py_VISIT(traverse_module_state->__pyx_n_s_proj);
5422 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
5423 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
5424 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
5425 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
5426 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
5427 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
5428 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
5429 : Py_VISIT(traverse_module_state->__pyx_n_s_r);
5430 : Py_VISIT(traverse_module_state->__pyx_n_s_r2);
5431 : Py_VISIT(traverse_module_state->__pyx_n_s_r3);
5432 : Py_VISIT(traverse_module_state->__pyx_n_s_ra);
5433 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
5434 : Py_VISIT(traverse_module_state->__pyx_n_s_ravel);
5435 : Py_VISIT(traverse_module_state->__pyx_n_s_real);
5436 : Py_VISIT(traverse_module_state->__pyx_n_s_reallocated_ra);
5437 : Py_VISIT(traverse_module_state->__pyx_n_s_reallocated_ret);
5438 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
5439 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
5440 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
5441 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
5442 : Py_VISIT(traverse_module_state->__pyx_n_s_replace);
5443 : Py_VISIT(traverse_module_state->__pyx_n_s_reshape);
5444 : Py_VISIT(traverse_module_state->__pyx_n_s_ret);
5445 : Py_VISIT(traverse_module_state->__pyx_n_s_retarr);
5446 : Py_VISIT(traverse_module_state->__pyx_n_s_rfft);
5447 : Py_VISIT(traverse_module_state->__pyx_n_s_rmatmul);
5448 : Py_VISIT(traverse_module_state->__pyx_n_s_rmatvec);
5449 : Py_VISIT(traverse_module_state->__pyx_n_s_rng);
5450 : Py_VISIT(traverse_module_state->__pyx_n_s_row);
5451 : Py_VISIT(traverse_module_state->__pyx_n_s_rsum);
5452 : Py_VISIT(traverse_module_state->__pyx_n_s_rta);
5453 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy);
5454 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_fft);
5455 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_linalg);
5456 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_linalg__decomp_interpolati);
5457 : Py_VISIT(traverse_module_state->__pyx_kp_u_scipy_linalg_interpolative_idd);
5458 : Py_VISIT(traverse_module_state->__pyx_kp_u_scipy_linalg_interpolative_idz);
5459 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_sparse_linalg);
5460 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
5461 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
5462 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
5463 : Py_VISIT(traverse_module_state->__pyx_n_s_sin);
5464 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
5465 : Py_VISIT(traverse_module_state->__pyx_n_s_snorm);
5466 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
5467 : Py_VISIT(traverse_module_state->__pyx_n_s_sqrt);
5468 : Py_VISIT(traverse_module_state->__pyx_n_s_ssmax);
5469 : Py_VISIT(traverse_module_state->__pyx_n_s_ssmaxin);
5470 : Py_VISIT(traverse_module_state->__pyx_n_s_sssmax);
5471 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
5472 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
5473 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
5474 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
5475 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
5476 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
5477 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
5478 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
5479 : Py_VISIT(traverse_module_state->__pyx_n_s_subselect);
5480 : Py_VISIT(traverse_module_state->__pyx_n_s_svd);
5481 : Py_VISIT(traverse_module_state->__pyx_n_s_swapaxes);
5482 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
5483 : Py_VISIT(traverse_module_state->__pyx_n_s_t);
5484 : Py_VISIT(traverse_module_state->__pyx_n_s_tau);
5485 : Py_VISIT(traverse_module_state->__pyx_n_s_tau1);
5486 : Py_VISIT(traverse_module_state->__pyx_n_s_tau2);
5487 : Py_VISIT(traverse_module_state->__pyx_n_s_tau_arr);
5488 : Py_VISIT(traverse_module_state->__pyx_n_s_taus);
5489 : Py_VISIT(traverse_module_state->__pyx_n_s_taus_v);
5490 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
5491 : Py_VISIT(traverse_module_state->__pyx_n_s_tmp_int);
5492 : Py_VISIT(traverse_module_state->__pyx_n_s_tmp_sca);
5493 : Py_VISIT(traverse_module_state->__pyx_n_s_triu);
5494 : Py_VISIT(traverse_module_state->__pyx_n_s_twopi);
5495 : Py_VISIT(traverse_module_state->__pyx_n_s_twopii);
5496 : Py_VISIT(traverse_module_state->__pyx_n_s_u);
5497 : Py_VISIT(traverse_module_state->__pyx_n_s_u1);
5498 : Py_VISIT(traverse_module_state->__pyx_n_s_u2);
5499 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
5500 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
5501 : Py_VISIT(traverse_module_state->__pyx_n_s_uniform);
5502 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
5503 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
5504 : Py_VISIT(traverse_module_state->__pyx_n_s_v);
5505 : Py_VISIT(traverse_module_state->__pyx_n_s_v1);
5506 : Py_VISIT(traverse_module_state->__pyx_n_s_v2);
5507 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
5508 : Py_VISIT(traverse_module_state->__pyx_n_s_view);
5509 : Py_VISIT(traverse_module_state->__pyx_n_s_wsave);
5510 : Py_VISIT(traverse_module_state->__pyx_n_s_x);
5511 : Py_VISIT(traverse_module_state->__pyx_n_s_y);
5512 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
5513 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros_like);
5514 : Py_VISIT(traverse_module_state->__pyx_float_0_);
5515 : Py_VISIT(traverse_module_state->__pyx_float_1_);
5516 : Py_VISIT(traverse_module_state->__pyx_float_0_0);
5517 : Py_VISIT(traverse_module_state->__pyx_float_1_0);
5518 : Py_VISIT(traverse_module_state->__pyx_float_2_0);
5519 : Py_VISIT(traverse_module_state->__pyx_float_neg_1_);
5520 : Py_VISIT(traverse_module_state->__pyx_float_neg_1_0);
5521 : Py_VISIT(traverse_module_state->__pyx_int_0);
5522 : Py_VISIT(traverse_module_state->__pyx_int_1);
5523 : Py_VISIT(traverse_module_state->__pyx_int_2);
5524 : Py_VISIT(traverse_module_state->__pyx_int_3);
5525 : Py_VISIT(traverse_module_state->__pyx_int_4);
5526 : Py_VISIT(traverse_module_state->__pyx_int_7);
5527 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
5528 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
5529 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
5530 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
5531 : Py_VISIT(traverse_module_state->__pyx_slice__5);
5532 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
5533 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
5534 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
5535 : Py_VISIT(traverse_module_state->__pyx_slice__12);
5536 : Py_VISIT(traverse_module_state->__pyx_slice__16);
5537 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
5538 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
5539 : Py_VISIT(traverse_module_state->__pyx_tuple__13);
5540 : Py_VISIT(traverse_module_state->__pyx_tuple__14);
5541 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
5542 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
5543 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
5544 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
5545 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
5546 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
5547 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
5548 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
5549 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
5550 : Py_VISIT(traverse_module_state->__pyx_tuple__25);
5551 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
5552 : Py_VISIT(traverse_module_state->__pyx_tuple__27);
5553 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
5554 : Py_VISIT(traverse_module_state->__pyx_tuple__29);
5555 : Py_VISIT(traverse_module_state->__pyx_tuple__30);
5556 : Py_VISIT(traverse_module_state->__pyx_tuple__31);
5557 : Py_VISIT(traverse_module_state->__pyx_tuple__33);
5558 : Py_VISIT(traverse_module_state->__pyx_tuple__34);
5559 : Py_VISIT(traverse_module_state->__pyx_tuple__36);
5560 : Py_VISIT(traverse_module_state->__pyx_tuple__38);
5561 : Py_VISIT(traverse_module_state->__pyx_tuple__40);
5562 : Py_VISIT(traverse_module_state->__pyx_tuple__42);
5563 : Py_VISIT(traverse_module_state->__pyx_tuple__44);
5564 : Py_VISIT(traverse_module_state->__pyx_tuple__46);
5565 : Py_VISIT(traverse_module_state->__pyx_tuple__48);
5566 : Py_VISIT(traverse_module_state->__pyx_tuple__51);
5567 : Py_VISIT(traverse_module_state->__pyx_tuple__53);
5568 : Py_VISIT(traverse_module_state->__pyx_tuple__55);
5569 : Py_VISIT(traverse_module_state->__pyx_tuple__57);
5570 : Py_VISIT(traverse_module_state->__pyx_tuple__59);
5571 : Py_VISIT(traverse_module_state->__pyx_tuple__61);
5572 : Py_VISIT(traverse_module_state->__pyx_tuple__63);
5573 : Py_VISIT(traverse_module_state->__pyx_tuple__65);
5574 : Py_VISIT(traverse_module_state->__pyx_tuple__67);
5575 : Py_VISIT(traverse_module_state->__pyx_tuple__69);
5576 : Py_VISIT(traverse_module_state->__pyx_tuple__71);
5577 : Py_VISIT(traverse_module_state->__pyx_tuple__73);
5578 : Py_VISIT(traverse_module_state->__pyx_tuple__76);
5579 : Py_VISIT(traverse_module_state->__pyx_tuple__78);
5580 : Py_VISIT(traverse_module_state->__pyx_tuple__89);
5581 : Py_VISIT(traverse_module_state->__pyx_tuple__91);
5582 : Py_VISIT(traverse_module_state->__pyx_tuple__94);
5583 : Py_VISIT(traverse_module_state->__pyx_tuple__96);
5584 : Py_VISIT(traverse_module_state->__pyx_tuple__100);
5585 : Py_VISIT(traverse_module_state->__pyx_codeobj__32);
5586 : Py_VISIT(traverse_module_state->__pyx_codeobj__35);
5587 : Py_VISIT(traverse_module_state->__pyx_codeobj__37);
5588 : Py_VISIT(traverse_module_state->__pyx_codeobj__39);
5589 : Py_VISIT(traverse_module_state->__pyx_codeobj__41);
5590 : Py_VISIT(traverse_module_state->__pyx_codeobj__43);
5591 : Py_VISIT(traverse_module_state->__pyx_codeobj__45);
5592 : Py_VISIT(traverse_module_state->__pyx_codeobj__47);
5593 : Py_VISIT(traverse_module_state->__pyx_codeobj__49);
5594 : Py_VISIT(traverse_module_state->__pyx_codeobj__52);
5595 : Py_VISIT(traverse_module_state->__pyx_codeobj__54);
5596 : Py_VISIT(traverse_module_state->__pyx_codeobj__56);
5597 : Py_VISIT(traverse_module_state->__pyx_codeobj__58);
5598 : Py_VISIT(traverse_module_state->__pyx_codeobj__60);
5599 : Py_VISIT(traverse_module_state->__pyx_codeobj__62);
5600 : Py_VISIT(traverse_module_state->__pyx_codeobj__64);
5601 : Py_VISIT(traverse_module_state->__pyx_codeobj__66);
5602 : Py_VISIT(traverse_module_state->__pyx_codeobj__68);
5603 : Py_VISIT(traverse_module_state->__pyx_codeobj__70);
5604 : Py_VISIT(traverse_module_state->__pyx_codeobj__72);
5605 : Py_VISIT(traverse_module_state->__pyx_codeobj__74);
5606 : Py_VISIT(traverse_module_state->__pyx_codeobj__75);
5607 : Py_VISIT(traverse_module_state->__pyx_codeobj__77);
5608 : Py_VISIT(traverse_module_state->__pyx_codeobj__79);
5609 : Py_VISIT(traverse_module_state->__pyx_codeobj__80);
5610 : Py_VISIT(traverse_module_state->__pyx_codeobj__81);
5611 : Py_VISIT(traverse_module_state->__pyx_codeobj__82);
5612 : Py_VISIT(traverse_module_state->__pyx_codeobj__83);
5613 : Py_VISIT(traverse_module_state->__pyx_codeobj__84);
5614 : Py_VISIT(traverse_module_state->__pyx_codeobj__85);
5615 : Py_VISIT(traverse_module_state->__pyx_codeobj__86);
5616 : Py_VISIT(traverse_module_state->__pyx_codeobj__87);
5617 : Py_VISIT(traverse_module_state->__pyx_codeobj__88);
5618 : Py_VISIT(traverse_module_state->__pyx_codeobj__90);
5619 : Py_VISIT(traverse_module_state->__pyx_codeobj__92);
5620 : Py_VISIT(traverse_module_state->__pyx_codeobj__93);
5621 : Py_VISIT(traverse_module_state->__pyx_codeobj__95);
5622 : Py_VISIT(traverse_module_state->__pyx_codeobj__97);
5623 : Py_VISIT(traverse_module_state->__pyx_codeobj__98);
5624 : Py_VISIT(traverse_module_state->__pyx_codeobj__99);
5625 : Py_VISIT(traverse_module_state->__pyx_codeobj__101);
5626 : return 0;
5627 : }
5628 : #endif
5629 : /* #### Code section: module_state_defines ### */
5630 : #define __pyx_d __pyx_mstate_global->__pyx_d
5631 : #define __pyx_b __pyx_mstate_global->__pyx_b
5632 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
5633 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
5634 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
5635 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
5636 : #ifdef __Pyx_CyFunction_USED
5637 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
5638 : #endif
5639 : #ifdef __Pyx_FusedFunction_USED
5640 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
5641 : #endif
5642 : #ifdef __Pyx_Generator_USED
5643 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
5644 : #endif
5645 : #ifdef __Pyx_IterableCoroutine_USED
5646 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
5647 : #endif
5648 : #ifdef __Pyx_Coroutine_USED
5649 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
5650 : #endif
5651 : #ifdef __Pyx_Coroutine_USED
5652 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
5653 : #endif
5654 : #if CYTHON_USE_MODULE_STATE
5655 : #endif
5656 : #if CYTHON_USE_MODULE_STATE
5657 : #endif
5658 : #if CYTHON_USE_MODULE_STATE
5659 : #endif
5660 : #if CYTHON_USE_MODULE_STATE
5661 : #endif
5662 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
5663 : #if CYTHON_USE_MODULE_STATE
5664 : #endif
5665 : #if CYTHON_USE_MODULE_STATE
5666 : #endif
5667 : #if CYTHON_USE_MODULE_STATE
5668 : #endif
5669 : #if CYTHON_USE_MODULE_STATE
5670 : #endif
5671 : #if CYTHON_USE_MODULE_STATE
5672 : #endif
5673 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
5674 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
5675 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
5676 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
5677 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
5678 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
5679 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
5680 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
5681 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
5682 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
5683 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
5684 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
5685 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
5686 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
5687 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
5688 : #if CYTHON_USE_MODULE_STATE
5689 : #endif
5690 : #if CYTHON_USE_MODULE_STATE
5691 : #endif
5692 : #if CYTHON_USE_MODULE_STATE
5693 : #endif
5694 : #if CYTHON_USE_MODULE_STATE
5695 : #endif
5696 : #if CYTHON_USE_MODULE_STATE
5697 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
5698 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
5699 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
5700 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
5701 : #endif
5702 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
5703 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
5704 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
5705 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
5706 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
5707 : #define __pyx_n_s_A __pyx_mstate_global->__pyx_n_s_A
5708 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
5709 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
5710 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
5711 : #define __pyx_n_s_B __pyx_mstate_global->__pyx_n_s_B
5712 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
5713 : #define __pyx_n_s_C __pyx_mstate_global->__pyx_n_s_C
5714 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
5715 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
5716 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
5717 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
5718 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
5719 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
5720 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
5721 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
5722 : #define __pyx_n_s_F __pyx_mstate_global->__pyx_n_s_F
5723 : #define __pyx_n_u_F __pyx_mstate_global->__pyx_n_u_F
5724 : #define __pyx_kp_u_Failed_to_allocate_at_least_requ __pyx_mstate_global->__pyx_kp_u_Failed_to_allocate_at_least_requ
5725 : #define __pyx_n_s_Fc __pyx_mstate_global->__pyx_n_s_Fc
5726 : #define __pyx_n_s_Fcopy __pyx_mstate_global->__pyx_n_s_Fcopy
5727 : #define __pyx_n_s_Fmemview __pyx_mstate_global->__pyx_n_s_Fmemview
5728 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
5729 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
5730 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
5731 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
5732 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
5733 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
5734 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
5735 : #define __pyx_n_s_L __pyx_mstate_global->__pyx_n_s_L
5736 : #define __pyx_n_s_LinearOperator __pyx_mstate_global->__pyx_n_s_LinearOperator
5737 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
5738 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
5739 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
5740 : #define __pyx_n_s_NDArray __pyx_mstate_global->__pyx_n_s_NDArray
5741 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
5742 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
5743 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
5744 : #define __pyx_n_s_S __pyx_mstate_global->__pyx_n_s_S
5745 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
5746 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
5747 : #define __pyx_n_s_T __pyx_mstate_global->__pyx_n_s_T
5748 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
5749 : #define __pyx_n_s_U __pyx_mstate_global->__pyx_n_s_U
5750 : #define __pyx_n_s_UU __pyx_mstate_global->__pyx_n_s_UU
5751 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
5752 : #define __pyx_n_s_V __pyx_mstate_global->__pyx_n_s_V
5753 : #define __pyx_n_s_VV __pyx_mstate_global->__pyx_n_s_VV
5754 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
5755 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
5756 : #define __pyx_n_s__102 __pyx_mstate_global->__pyx_n_s__102
5757 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
5758 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
5759 : #define __pyx_n_s__50 __pyx_mstate_global->__pyx_n_s__50
5760 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
5761 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
5762 : #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
5763 : #define __pyx_n_s_aa __pyx_mstate_global->__pyx_n_s_aa
5764 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
5765 : #define __pyx_n_s_abs __pyx_mstate_global->__pyx_n_s_abs
5766 : #define __pyx_n_s_albetas __pyx_mstate_global->__pyx_n_s_albetas
5767 : #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
5768 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
5769 : #define __pyx_n_s_alpha __pyx_mstate_global->__pyx_n_s_alpha
5770 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
5771 : #define __pyx_n_s_approx __pyx_mstate_global->__pyx_n_s_approx
5772 : #define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange
5773 : #define __pyx_n_s_argmax __pyx_mstate_global->__pyx_n_s_argmax
5774 : #define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
5775 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
5776 : #define __pyx_n_s_axis __pyx_mstate_global->__pyx_n_s_axis
5777 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
5778 : #define __pyx_n_s_beta __pyx_mstate_global->__pyx_n_s_beta
5779 : #define __pyx_kp_u_bytes_for_scipy_linalg_interpol __pyx_mstate_global->__pyx_kp_u_bytes_for_scipy_linalg_interpol
5780 : #define __pyx_kp_u_bytes_for_scipy_linalg_interpol_2 __pyx_mstate_global->__pyx_kp_u_bytes_for_scipy_linalg_interpol_2
5781 : #define __pyx_kp_u_bytes_while_trying_to_determine __pyx_mstate_global->__pyx_kp_u_bytes_while_trying_to_determine
5782 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
5783 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
5784 : #define __pyx_n_s_check_finite __pyx_mstate_global->__pyx_n_s_check_finite
5785 : #define __pyx_n_s_choice __pyx_mstate_global->__pyx_n_s_choice
5786 : #define __pyx_n_s_ci __pyx_mstate_global->__pyx_n_s_ci
5787 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
5788 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
5789 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
5790 : #define __pyx_n_s_col __pyx_mstate_global->__pyx_n_s_col
5791 : #define __pyx_n_s_col_norms __pyx_mstate_global->__pyx_n_s_col_norms
5792 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
5793 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
5794 : #define __pyx_n_s_cols __pyx_mstate_global->__pyx_n_s_cols
5795 : #define __pyx_n_s_complex128 __pyx_mstate_global->__pyx_n_s_complex128
5796 : #define __pyx_n_s_conj __pyx_mstate_global->__pyx_n_s_conj
5797 : #define __pyx_n_s_conjugate __pyx_mstate_global->__pyx_n_s_conjugate
5798 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
5799 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
5800 : #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy
5801 : #define __pyx_n_s_cos __pyx_mstate_global->__pyx_n_s_cos
5802 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
5803 : #define __pyx_n_s_csum __pyx_mstate_global->__pyx_n_s_csum
5804 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
5805 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
5806 : #define __pyx_n_s_divmod __pyx_mstate_global->__pyx_n_s_divmod
5807 : #define __pyx_n_s_dm1 __pyx_mstate_global->__pyx_n_s_dm1
5808 : #define __pyx_n_s_dm2 __pyx_mstate_global->__pyx_n_s_dm2
5809 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
5810 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
5811 : #define __pyx_n_s_einsum __pyx_mstate_global->__pyx_n_s_einsum
5812 : #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
5813 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
5814 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
5815 : #define __pyx_n_s_enorm __pyx_mstate_global->__pyx_n_s_enorm
5816 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
5817 : #define __pyx_n_s_eps __pyx_mstate_global->__pyx_n_s_eps
5818 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
5819 : #define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp
5820 : #define __pyx_n_s_fact __pyx_mstate_global->__pyx_n_s_fact
5821 : #define __pyx_n_s_feps __pyx_mstate_global->__pyx_n_s_feps
5822 : #define __pyx_n_s_ff __pyx_mstate_global->__pyx_n_s_ff
5823 : #define __pyx_n_s_fft __pyx_mstate_global->__pyx_n_s_fft
5824 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
5825 : #define __pyx_n_s_float __pyx_mstate_global->__pyx_n_s_float
5826 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
5827 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
5828 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
5829 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
5830 : #define __pyx_n_s_full_matrices __pyx_mstate_global->__pyx_n_s_full_matrices
5831 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
5832 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
5833 : #define __pyx_n_s_giv2x2 __pyx_mstate_global->__pyx_n_s_giv2x2
5834 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
5835 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
5836 : #define __pyx_n_s_h __pyx_mstate_global->__pyx_n_s_h
5837 : #define __pyx_n_s_high __pyx_mstate_global->__pyx_n_s_high
5838 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
5839 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
5840 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
5841 : #define __pyx_n_s_idd_diffsnorm __pyx_mstate_global->__pyx_n_s_idd_diffsnorm
5842 : #define __pyx_n_u_idd_diffsnorm __pyx_mstate_global->__pyx_n_u_idd_diffsnorm
5843 : #define __pyx_n_s_idd_estrank __pyx_mstate_global->__pyx_n_s_idd_estrank
5844 : #define __pyx_n_u_idd_estrank __pyx_mstate_global->__pyx_n_u_idd_estrank
5845 : #define __pyx_n_s_idd_findrank __pyx_mstate_global->__pyx_n_s_idd_findrank
5846 : #define __pyx_n_s_idd_id2svd __pyx_mstate_global->__pyx_n_s_idd_id2svd
5847 : #define __pyx_n_u_idd_id2svd __pyx_mstate_global->__pyx_n_u_idd_id2svd
5848 : #define __pyx_n_u_idd_ldiv __pyx_mstate_global->__pyx_n_u_idd_ldiv
5849 : #define __pyx_n_u_idd_poweroftwo __pyx_mstate_global->__pyx_n_u_idd_poweroftwo
5850 : #define __pyx_n_s_idd_reconid __pyx_mstate_global->__pyx_n_s_idd_reconid
5851 : #define __pyx_n_u_idd_reconid __pyx_mstate_global->__pyx_n_u_idd_reconid
5852 : #define __pyx_n_s_idd_snorm __pyx_mstate_global->__pyx_n_s_idd_snorm
5853 : #define __pyx_n_u_idd_snorm __pyx_mstate_global->__pyx_n_u_idd_snorm
5854 : #define __pyx_n_s_iddp_aid __pyx_mstate_global->__pyx_n_s_iddp_aid
5855 : #define __pyx_n_u_iddp_aid __pyx_mstate_global->__pyx_n_u_iddp_aid
5856 : #define __pyx_n_s_iddp_asvd __pyx_mstate_global->__pyx_n_s_iddp_asvd
5857 : #define __pyx_n_u_iddp_asvd __pyx_mstate_global->__pyx_n_u_iddp_asvd
5858 : #define __pyx_n_s_iddp_id __pyx_mstate_global->__pyx_n_s_iddp_id
5859 : #define __pyx_n_u_iddp_id __pyx_mstate_global->__pyx_n_u_iddp_id
5860 : #define __pyx_n_s_iddp_qrpiv __pyx_mstate_global->__pyx_n_s_iddp_qrpiv
5861 : #define __pyx_n_u_iddp_qrpiv __pyx_mstate_global->__pyx_n_u_iddp_qrpiv
5862 : #define __pyx_n_s_iddp_rid __pyx_mstate_global->__pyx_n_s_iddp_rid
5863 : #define __pyx_n_u_iddp_rid __pyx_mstate_global->__pyx_n_u_iddp_rid
5864 : #define __pyx_n_s_iddp_rsvd __pyx_mstate_global->__pyx_n_s_iddp_rsvd
5865 : #define __pyx_n_u_iddp_rsvd __pyx_mstate_global->__pyx_n_u_iddp_rsvd
5866 : #define __pyx_n_s_iddp_svd __pyx_mstate_global->__pyx_n_s_iddp_svd
5867 : #define __pyx_n_u_iddp_svd __pyx_mstate_global->__pyx_n_u_iddp_svd
5868 : #define __pyx_n_s_iddr_aid __pyx_mstate_global->__pyx_n_s_iddr_aid
5869 : #define __pyx_n_u_iddr_aid __pyx_mstate_global->__pyx_n_u_iddr_aid
5870 : #define __pyx_n_s_iddr_asvd __pyx_mstate_global->__pyx_n_s_iddr_asvd
5871 : #define __pyx_n_u_iddr_asvd __pyx_mstate_global->__pyx_n_u_iddr_asvd
5872 : #define __pyx_n_s_iddr_id __pyx_mstate_global->__pyx_n_s_iddr_id
5873 : #define __pyx_n_u_iddr_id __pyx_mstate_global->__pyx_n_u_iddr_id
5874 : #define __pyx_n_s_iddr_qrpiv __pyx_mstate_global->__pyx_n_s_iddr_qrpiv
5875 : #define __pyx_n_u_iddr_qrpiv __pyx_mstate_global->__pyx_n_u_iddr_qrpiv
5876 : #define __pyx_n_s_iddr_rid __pyx_mstate_global->__pyx_n_s_iddr_rid
5877 : #define __pyx_n_u_iddr_rid __pyx_mstate_global->__pyx_n_u_iddr_rid
5878 : #define __pyx_n_s_iddr_rsvd __pyx_mstate_global->__pyx_n_s_iddr_rsvd
5879 : #define __pyx_n_u_iddr_rsvd __pyx_mstate_global->__pyx_n_u_iddr_rsvd
5880 : #define __pyx_n_s_iddr_svd __pyx_mstate_global->__pyx_n_s_iddr_svd
5881 : #define __pyx_n_u_iddr_svd __pyx_mstate_global->__pyx_n_u_iddr_svd
5882 : #define __pyx_n_s_idivm __pyx_mstate_global->__pyx_n_s_idivm
5883 : #define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx
5884 : #define __pyx_n_s_idz_diffsnorm __pyx_mstate_global->__pyx_n_s_idz_diffsnorm
5885 : #define __pyx_n_u_idz_diffsnorm __pyx_mstate_global->__pyx_n_u_idz_diffsnorm
5886 : #define __pyx_n_s_idz_estrank __pyx_mstate_global->__pyx_n_s_idz_estrank
5887 : #define __pyx_n_u_idz_estrank __pyx_mstate_global->__pyx_n_u_idz_estrank
5888 : #define __pyx_n_s_idz_findrank __pyx_mstate_global->__pyx_n_s_idz_findrank
5889 : #define __pyx_n_u_idz_findrank __pyx_mstate_global->__pyx_n_u_idz_findrank
5890 : #define __pyx_n_s_idz_id2svd __pyx_mstate_global->__pyx_n_s_idz_id2svd
5891 : #define __pyx_n_u_idz_id2svdidd_findrank __pyx_mstate_global->__pyx_n_u_idz_id2svdidd_findrank
5892 : #define __pyx_n_s_idz_reconid __pyx_mstate_global->__pyx_n_s_idz_reconid
5893 : #define __pyx_n_u_idz_reconid __pyx_mstate_global->__pyx_n_u_idz_reconid
5894 : #define __pyx_n_s_idz_snorm __pyx_mstate_global->__pyx_n_s_idz_snorm
5895 : #define __pyx_n_u_idz_snorm __pyx_mstate_global->__pyx_n_u_idz_snorm
5896 : #define __pyx_n_s_idzp_aid __pyx_mstate_global->__pyx_n_s_idzp_aid
5897 : #define __pyx_n_u_idzp_aid __pyx_mstate_global->__pyx_n_u_idzp_aid
5898 : #define __pyx_n_s_idzp_asvd __pyx_mstate_global->__pyx_n_s_idzp_asvd
5899 : #define __pyx_n_u_idzp_asvd __pyx_mstate_global->__pyx_n_u_idzp_asvd
5900 : #define __pyx_n_s_idzp_id __pyx_mstate_global->__pyx_n_s_idzp_id
5901 : #define __pyx_n_u_idzp_id __pyx_mstate_global->__pyx_n_u_idzp_id
5902 : #define __pyx_n_s_idzp_qrpiv __pyx_mstate_global->__pyx_n_s_idzp_qrpiv
5903 : #define __pyx_n_u_idzp_qrpiv __pyx_mstate_global->__pyx_n_u_idzp_qrpiv
5904 : #define __pyx_n_s_idzp_rid __pyx_mstate_global->__pyx_n_s_idzp_rid
5905 : #define __pyx_n_u_idzp_rid __pyx_mstate_global->__pyx_n_u_idzp_rid
5906 : #define __pyx_n_s_idzp_rsvd __pyx_mstate_global->__pyx_n_s_idzp_rsvd
5907 : #define __pyx_n_u_idzp_rsvd __pyx_mstate_global->__pyx_n_u_idzp_rsvd
5908 : #define __pyx_n_s_idzp_svd __pyx_mstate_global->__pyx_n_s_idzp_svd
5909 : #define __pyx_n_u_idzp_svd __pyx_mstate_global->__pyx_n_u_idzp_svd
5910 : #define __pyx_n_s_idzr_aid __pyx_mstate_global->__pyx_n_s_idzr_aid
5911 : #define __pyx_n_u_idzr_aid __pyx_mstate_global->__pyx_n_u_idzr_aid
5912 : #define __pyx_n_s_idzr_asvd __pyx_mstate_global->__pyx_n_s_idzr_asvd
5913 : #define __pyx_n_u_idzr_asvd __pyx_mstate_global->__pyx_n_u_idzr_asvd
5914 : #define __pyx_n_s_idzr_id __pyx_mstate_global->__pyx_n_s_idzr_id
5915 : #define __pyx_n_u_idzr_id __pyx_mstate_global->__pyx_n_u_idzr_id
5916 : #define __pyx_n_s_idzr_qrpiv __pyx_mstate_global->__pyx_n_s_idzr_qrpiv
5917 : #define __pyx_n_u_idzr_qrpiv __pyx_mstate_global->__pyx_n_u_idzr_qrpiv
5918 : #define __pyx_n_s_idzr_rid __pyx_mstate_global->__pyx_n_s_idzr_rid
5919 : #define __pyx_n_u_idzr_rid __pyx_mstate_global->__pyx_n_u_idzr_rid
5920 : #define __pyx_n_s_idzr_rsvd __pyx_mstate_global->__pyx_n_s_idzr_rsvd
5921 : #define __pyx_n_u_idzr_rsvd __pyx_mstate_global->__pyx_n_u_idzr_rsvd
5922 : #define __pyx_n_s_idzr_svd __pyx_mstate_global->__pyx_n_s_idzr_svd
5923 : #define __pyx_n_u_idzr_svd __pyx_mstate_global->__pyx_n_u_idzr_svd
5924 : #define __pyx_kp_u_ij_jim_im __pyx_mstate_global->__pyx_kp_u_ij_jim_im
5925 : #define __pyx_n_s_imag __pyx_mstate_global->__pyx_n_s_imag
5926 : #define __pyx_n_s_imatmul __pyx_mstate_global->__pyx_n_s_imatmul
5927 : #define __pyx_n_s_imodm __pyx_mstate_global->__pyx_n_s_imodm
5928 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
5929 : #define __pyx_n_s_ind __pyx_mstate_global->__pyx_n_s_ind
5930 : #define __pyx_n_s_ind2 __pyx_mstate_global->__pyx_n_s_ind2
5931 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
5932 : #define __pyx_n_s_inds __pyx_mstate_global->__pyx_n_s_inds
5933 : #define __pyx_n_s_inds1 __pyx_mstate_global->__pyx_n_s_inds1
5934 : #define __pyx_n_s_inds2 __pyx_mstate_global->__pyx_n_s_inds2
5935 : #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info
5936 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
5937 : #define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int
5938 : #define __pyx_n_s_int_n __pyx_mstate_global->__pyx_n_s_int_n
5939 : #define __pyx_n_s_intone __pyx_mstate_global->__pyx_n_s_intone
5940 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
5941 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
5942 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
5943 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
5944 : #define __pyx_n_s_its __pyx_mstate_global->__pyx_n_s_its
5945 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
5946 : #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
5947 : #define __pyx_n_s_kk __pyx_mstate_global->__pyx_n_s_kk
5948 : #define __pyx_n_s_kpiv __pyx_mstate_global->__pyx_n_s_kpiv
5949 : #define __pyx_n_s_krank __pyx_mstate_global->__pyx_n_s_krank
5950 : #define __pyx_n_s_l2 __pyx_mstate_global->__pyx_n_s_l2
5951 : #define __pyx_n_s_la __pyx_mstate_global->__pyx_n_s_la
5952 : #define __pyx_n_s_linalg __pyx_mstate_global->__pyx_n_s_linalg
5953 : #define __pyx_n_s_loop __pyx_mstate_global->__pyx_n_s_loop
5954 : #define __pyx_n_s_loops __pyx_mstate_global->__pyx_n_s_loops
5955 : #define __pyx_n_s_low __pyx_mstate_global->__pyx_n_s_low
5956 : #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
5957 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
5958 : #define __pyx_n_s_marker __pyx_mstate_global->__pyx_n_s_marker
5959 : #define __pyx_n_s_matmul __pyx_mstate_global->__pyx_n_s_matmul
5960 : #define __pyx_n_s_matmul_2 __pyx_mstate_global->__pyx_n_s_matmul_2
5961 : #define __pyx_n_s_matvec __pyx_mstate_global->__pyx_n_s_matvec
5962 : #define __pyx_n_s_mb __pyx_mstate_global->__pyx_n_s_mb
5963 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
5964 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
5965 : #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
5966 : #define __pyx_n_s_n2 __pyx_mstate_global->__pyx_n_s_n2
5967 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
5968 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
5969 : #define __pyx_n_s_nblock __pyx_mstate_global->__pyx_n_s_nblock
5970 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
5971 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
5972 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
5973 : #define __pyx_n_s_no_of_cols __pyx_mstate_global->__pyx_n_s_no_of_cols
5974 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
5975 : #define __pyx_n_s_nstep __pyx_mstate_global->__pyx_n_s_nstep
5976 : #define __pyx_n_s_nsteps __pyx_mstate_global->__pyx_n_s_nsteps
5977 : #define __pyx_n_s_nulls __pyx_mstate_global->__pyx_n_s_nulls
5978 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
5979 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
5980 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
5981 : #define __pyx_n_s_numpy_typing __pyx_mstate_global->__pyx_n_s_numpy_typing
5982 : #define __pyx_n_s_nupdate __pyx_mstate_global->__pyx_n_s_nupdate
5983 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
5984 : #define __pyx_kp_u_of_a_LinearOperator_with_precis __pyx_mstate_global->__pyx_kp_u_of_a_LinearOperator_with_precis
5985 : #define __pyx_n_s_one __pyx_mstate_global->__pyx_n_s_one
5986 : #define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order
5987 : #define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out
5988 : #define __pyx_n_s_outer __pyx_mstate_global->__pyx_n_s_outer
5989 : #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
5990 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
5991 : #define __pyx_n_s_perms __pyx_mstate_global->__pyx_n_s_perms
5992 : #define __pyx_n_s_permutation __pyx_mstate_global->__pyx_n_s_permutation
5993 : #define __pyx_n_s_pi __pyx_mstate_global->__pyx_n_s_pi
5994 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
5995 : #define __pyx_n_s_proj __pyx_mstate_global->__pyx_n_s_proj
5996 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
5997 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
5998 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
5999 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
6000 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
6001 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
6002 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
6003 : #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r
6004 : #define __pyx_n_s_r2 __pyx_mstate_global->__pyx_n_s_r2
6005 : #define __pyx_n_s_r3 __pyx_mstate_global->__pyx_n_s_r3
6006 : #define __pyx_n_s_ra __pyx_mstate_global->__pyx_n_s_ra
6007 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
6008 : #define __pyx_n_s_ravel __pyx_mstate_global->__pyx_n_s_ravel
6009 : #define __pyx_n_s_real __pyx_mstate_global->__pyx_n_s_real
6010 : #define __pyx_n_s_reallocated_ra __pyx_mstate_global->__pyx_n_s_reallocated_ra
6011 : #define __pyx_n_s_reallocated_ret __pyx_mstate_global->__pyx_n_s_reallocated_ret
6012 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
6013 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
6014 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
6015 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
6016 : #define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace
6017 : #define __pyx_n_s_reshape __pyx_mstate_global->__pyx_n_s_reshape
6018 : #define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret
6019 : #define __pyx_n_s_retarr __pyx_mstate_global->__pyx_n_s_retarr
6020 : #define __pyx_n_s_rfft __pyx_mstate_global->__pyx_n_s_rfft
6021 : #define __pyx_n_s_rmatmul __pyx_mstate_global->__pyx_n_s_rmatmul
6022 : #define __pyx_n_s_rmatvec __pyx_mstate_global->__pyx_n_s_rmatvec
6023 : #define __pyx_n_s_rng __pyx_mstate_global->__pyx_n_s_rng
6024 : #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row
6025 : #define __pyx_n_s_rsum __pyx_mstate_global->__pyx_n_s_rsum
6026 : #define __pyx_n_s_rta __pyx_mstate_global->__pyx_n_s_rta
6027 : #define __pyx_n_s_scipy __pyx_mstate_global->__pyx_n_s_scipy
6028 : #define __pyx_n_s_scipy_fft __pyx_mstate_global->__pyx_n_s_scipy_fft
6029 : #define __pyx_n_s_scipy_linalg __pyx_mstate_global->__pyx_n_s_scipy_linalg
6030 : #define __pyx_n_s_scipy_linalg__decomp_interpolati __pyx_mstate_global->__pyx_n_s_scipy_linalg__decomp_interpolati
6031 : #define __pyx_kp_u_scipy_linalg_interpolative_idd __pyx_mstate_global->__pyx_kp_u_scipy_linalg_interpolative_idd
6032 : #define __pyx_kp_u_scipy_linalg_interpolative_idz __pyx_mstate_global->__pyx_kp_u_scipy_linalg_interpolative_idz
6033 : #define __pyx_n_s_scipy_sparse_linalg __pyx_mstate_global->__pyx_n_s_scipy_sparse_linalg
6034 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
6035 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
6036 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
6037 : #define __pyx_n_s_sin __pyx_mstate_global->__pyx_n_s_sin
6038 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
6039 : #define __pyx_n_s_snorm __pyx_mstate_global->__pyx_n_s_snorm
6040 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
6041 : #define __pyx_n_s_sqrt __pyx_mstate_global->__pyx_n_s_sqrt
6042 : #define __pyx_n_s_ssmax __pyx_mstate_global->__pyx_n_s_ssmax
6043 : #define __pyx_n_s_ssmaxin __pyx_mstate_global->__pyx_n_s_ssmaxin
6044 : #define __pyx_n_s_sssmax __pyx_mstate_global->__pyx_n_s_sssmax
6045 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
6046 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
6047 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
6048 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
6049 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
6050 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
6051 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
6052 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
6053 : #define __pyx_n_s_subselect __pyx_mstate_global->__pyx_n_s_subselect
6054 : #define __pyx_n_s_svd __pyx_mstate_global->__pyx_n_s_svd
6055 : #define __pyx_n_s_swapaxes __pyx_mstate_global->__pyx_n_s_swapaxes
6056 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
6057 : #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t
6058 : #define __pyx_n_s_tau __pyx_mstate_global->__pyx_n_s_tau
6059 : #define __pyx_n_s_tau1 __pyx_mstate_global->__pyx_n_s_tau1
6060 : #define __pyx_n_s_tau2 __pyx_mstate_global->__pyx_n_s_tau2
6061 : #define __pyx_n_s_tau_arr __pyx_mstate_global->__pyx_n_s_tau_arr
6062 : #define __pyx_n_s_taus __pyx_mstate_global->__pyx_n_s_taus
6063 : #define __pyx_n_s_taus_v __pyx_mstate_global->__pyx_n_s_taus_v
6064 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
6065 : #define __pyx_n_s_tmp_int __pyx_mstate_global->__pyx_n_s_tmp_int
6066 : #define __pyx_n_s_tmp_sca __pyx_mstate_global->__pyx_n_s_tmp_sca
6067 : #define __pyx_n_s_triu __pyx_mstate_global->__pyx_n_s_triu
6068 : #define __pyx_n_s_twopi __pyx_mstate_global->__pyx_n_s_twopi
6069 : #define __pyx_n_s_twopii __pyx_mstate_global->__pyx_n_s_twopii
6070 : #define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u
6071 : #define __pyx_n_s_u1 __pyx_mstate_global->__pyx_n_s_u1
6072 : #define __pyx_n_s_u2 __pyx_mstate_global->__pyx_n_s_u2
6073 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
6074 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
6075 : #define __pyx_n_s_uniform __pyx_mstate_global->__pyx_n_s_uniform
6076 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
6077 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
6078 : #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
6079 : #define __pyx_n_s_v1 __pyx_mstate_global->__pyx_n_s_v1
6080 : #define __pyx_n_s_v2 __pyx_mstate_global->__pyx_n_s_v2
6081 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
6082 : #define __pyx_n_s_view __pyx_mstate_global->__pyx_n_s_view
6083 : #define __pyx_n_s_wsave __pyx_mstate_global->__pyx_n_s_wsave
6084 : #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
6085 : #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
6086 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
6087 : #define __pyx_n_s_zeros_like __pyx_mstate_global->__pyx_n_s_zeros_like
6088 : #define __pyx_float_0_ __pyx_mstate_global->__pyx_float_0_
6089 : #define __pyx_float_1_ __pyx_mstate_global->__pyx_float_1_
6090 : #define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0
6091 : #define __pyx_float_1_0 __pyx_mstate_global->__pyx_float_1_0
6092 : #define __pyx_float_2_0 __pyx_mstate_global->__pyx_float_2_0
6093 : #define __pyx_float_neg_1_ __pyx_mstate_global->__pyx_float_neg_1_
6094 : #define __pyx_float_neg_1_0 __pyx_mstate_global->__pyx_float_neg_1_0
6095 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
6096 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
6097 : #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
6098 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
6099 : #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
6100 : #define __pyx_int_7 __pyx_mstate_global->__pyx_int_7
6101 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
6102 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
6103 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
6104 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
6105 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
6106 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
6107 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
6108 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
6109 : #define __pyx_slice__12 __pyx_mstate_global->__pyx_slice__12
6110 : #define __pyx_slice__16 __pyx_mstate_global->__pyx_slice__16
6111 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
6112 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
6113 : #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
6114 : #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
6115 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
6116 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
6117 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
6118 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
6119 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
6120 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
6121 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
6122 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
6123 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
6124 : #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
6125 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
6126 : #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
6127 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
6128 : #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
6129 : #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
6130 : #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
6131 : #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
6132 : #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
6133 : #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
6134 : #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38
6135 : #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
6136 : #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
6137 : #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
6138 : #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
6139 : #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
6140 : #define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
6141 : #define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
6142 : #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
6143 : #define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
6144 : #define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59
6145 : #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
6146 : #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63
6147 : #define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
6148 : #define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
6149 : #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
6150 : #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
6151 : #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
6152 : #define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
6153 : #define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
6154 : #define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
6155 : #define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
6156 : #define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
6157 : #define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
6158 : #define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100
6159 : #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
6160 : #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
6161 : #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
6162 : #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39
6163 : #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41
6164 : #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43
6165 : #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
6166 : #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
6167 : #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49
6168 : #define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52
6169 : #define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54
6170 : #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
6171 : #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
6172 : #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60
6173 : #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
6174 : #define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
6175 : #define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66
6176 : #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68
6177 : #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70
6178 : #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72
6179 : #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74
6180 : #define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
6181 : #define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
6182 : #define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79
6183 : #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80
6184 : #define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
6185 : #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82
6186 : #define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83
6187 : #define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84
6188 : #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85
6189 : #define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86
6190 : #define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87
6191 : #define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88
6192 : #define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90
6193 : #define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92
6194 : #define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93
6195 : #define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95
6196 : #define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97
6197 : #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98
6198 : #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99
6199 : #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101
6200 : /* #### Code section: module_code ### */
6201 :
6202 : /* "View.MemoryView":131
6203 : * cdef bint dtype_is_object
6204 : *
6205 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6206 : * mode="c", bint allocate_buffer=True):
6207 : *
6208 : */
6209 :
6210 : /* Python wrapper */
6211 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6212 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6213 0 : PyObject *__pyx_v_shape = 0;
6214 0 : Py_ssize_t __pyx_v_itemsize;
6215 0 : PyObject *__pyx_v_format = 0;
6216 0 : PyObject *__pyx_v_mode = 0;
6217 0 : int __pyx_v_allocate_buffer;
6218 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6219 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6220 0 : PyObject* values[5] = {0,0,0,0,0};
6221 0 : int __pyx_lineno = 0;
6222 0 : const char *__pyx_filename = NULL;
6223 0 : int __pyx_clineno = 0;
6224 0 : int __pyx_r;
6225 : __Pyx_RefNannyDeclarations
6226 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6227 : #if CYTHON_ASSUME_SAFE_MACROS
6228 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6229 : #else
6230 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6231 : #endif
6232 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6233 : {
6234 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6235 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
6236 0 : if (__pyx_kwds) {
6237 0 : Py_ssize_t kw_args;
6238 0 : switch (__pyx_nargs) {
6239 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
6240 0 : CYTHON_FALLTHROUGH;
6241 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
6242 0 : CYTHON_FALLTHROUGH;
6243 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
6244 0 : CYTHON_FALLTHROUGH;
6245 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
6246 0 : CYTHON_FALLTHROUGH;
6247 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6248 0 : CYTHON_FALLTHROUGH;
6249 0 : case 0: break;
6250 0 : default: goto __pyx_L5_argtuple_error;
6251 : }
6252 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
6253 0 : switch (__pyx_nargs) {
6254 0 : case 0:
6255 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
6256 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
6257 0 : kw_args--;
6258 : }
6259 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6260 0 : else goto __pyx_L5_argtuple_error;
6261 0 : CYTHON_FALLTHROUGH;
6262 : case 1:
6263 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
6264 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
6265 0 : kw_args--;
6266 : }
6267 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6268 : else {
6269 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
6270 : }
6271 0 : CYTHON_FALLTHROUGH;
6272 : case 2:
6273 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
6274 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
6275 0 : kw_args--;
6276 : }
6277 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6278 : else {
6279 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
6280 : }
6281 0 : CYTHON_FALLTHROUGH;
6282 : case 3:
6283 0 : if (kw_args > 0) {
6284 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
6285 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
6286 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6287 : }
6288 0 : CYTHON_FALLTHROUGH;
6289 : case 4:
6290 0 : if (kw_args > 0) {
6291 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
6292 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
6293 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6294 : }
6295 : }
6296 0 : if (unlikely(kw_args > 0)) {
6297 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6298 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
6299 : }
6300 : } else {
6301 0 : switch (__pyx_nargs) {
6302 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
6303 0 : CYTHON_FALLTHROUGH;
6304 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
6305 0 : CYTHON_FALLTHROUGH;
6306 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
6307 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
6308 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6309 0 : break;
6310 0 : default: goto __pyx_L5_argtuple_error;
6311 : }
6312 : }
6313 0 : __pyx_v_shape = ((PyObject*)values[0]);
6314 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
6315 0 : __pyx_v_format = values[2];
6316 0 : __pyx_v_mode = values[3];
6317 0 : if (values[4]) {
6318 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
6319 : } else {
6320 :
6321 : /* "View.MemoryView":132
6322 : *
6323 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6324 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
6325 : *
6326 : * cdef int idx
6327 : */
6328 : __pyx_v_allocate_buffer = ((int)1);
6329 : }
6330 : }
6331 0 : goto __pyx_L6_skip;
6332 0 : __pyx_L5_argtuple_error:;
6333 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
6334 0 : __pyx_L6_skip:;
6335 0 : goto __pyx_L4_argument_unpacking_done;
6336 0 : __pyx_L3_error:;
6337 : {
6338 0 : Py_ssize_t __pyx_temp;
6339 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6340 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6341 : }
6342 : }
6343 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6344 0 : __Pyx_RefNannyFinishContext();
6345 0 : return -1;
6346 0 : __pyx_L4_argument_unpacking_done:;
6347 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
6348 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6349 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
6350 : }
6351 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6352 :
6353 : /* "View.MemoryView":131
6354 : * cdef bint dtype_is_object
6355 : *
6356 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6357 : * mode="c", bint allocate_buffer=True):
6358 : *
6359 : */
6360 :
6361 : /* function exit code */
6362 0 : goto __pyx_L0;
6363 : __pyx_L1_error:;
6364 : __pyx_r = -1;
6365 0 : __pyx_L0:;
6366 : {
6367 0 : Py_ssize_t __pyx_temp;
6368 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6369 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6370 : }
6371 : }
6372 : __Pyx_RefNannyFinishContext();
6373 : return __pyx_r;
6374 : }
6375 :
6376 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
6377 0 : int __pyx_v_idx;
6378 0 : Py_ssize_t __pyx_v_dim;
6379 0 : char __pyx_v_order;
6380 0 : int __pyx_r;
6381 : __Pyx_RefNannyDeclarations
6382 0 : Py_ssize_t __pyx_t_1;
6383 0 : int __pyx_t_2;
6384 0 : int __pyx_t_3;
6385 0 : PyObject *__pyx_t_4 = NULL;
6386 0 : PyObject *__pyx_t_5 = NULL;
6387 0 : PyObject *__pyx_t_6 = NULL;
6388 0 : unsigned int __pyx_t_7;
6389 0 : char *__pyx_t_8;
6390 0 : int __pyx_t_9;
6391 0 : Py_ssize_t __pyx_t_10;
6392 0 : Py_UCS4 __pyx_t_11;
6393 0 : int __pyx_lineno = 0;
6394 0 : const char *__pyx_filename = NULL;
6395 0 : int __pyx_clineno = 0;
6396 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
6397 0 : __Pyx_INCREF(__pyx_v_format);
6398 :
6399 : /* "View.MemoryView":137
6400 : * cdef Py_ssize_t dim
6401 : *
6402 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
6403 : * self.itemsize = itemsize
6404 : *
6405 : */
6406 0 : if (unlikely(__pyx_v_shape == Py_None)) {
6407 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6408 0 : __PYX_ERR(1, 137, __pyx_L1_error)
6409 : }
6410 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
6411 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
6412 :
6413 : /* "View.MemoryView":138
6414 : *
6415 : * self.ndim = <int> len(shape)
6416 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
6417 : *
6418 : * if not self.ndim:
6419 : */
6420 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
6421 :
6422 : /* "View.MemoryView":140
6423 : * self.itemsize = itemsize
6424 : *
6425 : * if not self.ndim: # <<<<<<<<<<<<<<
6426 : * raise ValueError, "Empty shape tuple for cython.array"
6427 : *
6428 : */
6429 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
6430 0 : if (unlikely(__pyx_t_2)) {
6431 :
6432 : /* "View.MemoryView":141
6433 : *
6434 : * if not self.ndim:
6435 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
6436 : *
6437 : * if itemsize <= 0:
6438 : */
6439 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
6440 0 : __PYX_ERR(1, 141, __pyx_L1_error)
6441 :
6442 : /* "View.MemoryView":140
6443 : * self.itemsize = itemsize
6444 : *
6445 : * if not self.ndim: # <<<<<<<<<<<<<<
6446 : * raise ValueError, "Empty shape tuple for cython.array"
6447 : *
6448 : */
6449 : }
6450 :
6451 : /* "View.MemoryView":143
6452 : * raise ValueError, "Empty shape tuple for cython.array"
6453 : *
6454 : * if itemsize <= 0: # <<<<<<<<<<<<<<
6455 : * raise ValueError, "itemsize <= 0 for cython.array"
6456 : *
6457 : */
6458 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
6459 0 : if (unlikely(__pyx_t_2)) {
6460 :
6461 : /* "View.MemoryView":144
6462 : *
6463 : * if itemsize <= 0:
6464 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
6465 : *
6466 : * if not isinstance(format, bytes):
6467 : */
6468 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
6469 0 : __PYX_ERR(1, 144, __pyx_L1_error)
6470 :
6471 : /* "View.MemoryView":143
6472 : * raise ValueError, "Empty shape tuple for cython.array"
6473 : *
6474 : * if itemsize <= 0: # <<<<<<<<<<<<<<
6475 : * raise ValueError, "itemsize <= 0 for cython.array"
6476 : *
6477 : */
6478 : }
6479 :
6480 : /* "View.MemoryView":146
6481 : * raise ValueError, "itemsize <= 0 for cython.array"
6482 : *
6483 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6484 : * format = format.encode('ASCII')
6485 : * self._format = format # keep a reference to the byte string
6486 : */
6487 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6488 0 : __pyx_t_3 = (!__pyx_t_2);
6489 0 : if (__pyx_t_3) {
6490 :
6491 : /* "View.MemoryView":147
6492 : *
6493 : * if not isinstance(format, bytes):
6494 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
6495 : * self._format = format # keep a reference to the byte string
6496 : * self.format = self._format
6497 : */
6498 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
6499 0 : __Pyx_GOTREF(__pyx_t_5);
6500 0 : __pyx_t_6 = NULL;
6501 0 : __pyx_t_7 = 0;
6502 : #if CYTHON_UNPACK_METHODS
6503 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
6504 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6505 0 : if (likely(__pyx_t_6)) {
6506 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6507 0 : __Pyx_INCREF(__pyx_t_6);
6508 0 : __Pyx_INCREF(function);
6509 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
6510 : __pyx_t_7 = 1;
6511 : }
6512 : }
6513 : #endif
6514 : {
6515 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
6516 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
6517 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6518 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
6519 0 : __Pyx_GOTREF(__pyx_t_4);
6520 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6521 : }
6522 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
6523 : __pyx_t_4 = 0;
6524 :
6525 : /* "View.MemoryView":146
6526 : * raise ValueError, "itemsize <= 0 for cython.array"
6527 : *
6528 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6529 : * format = format.encode('ASCII')
6530 : * self._format = format # keep a reference to the byte string
6531 : */
6532 : }
6533 :
6534 : /* "View.MemoryView":148
6535 : * if not isinstance(format, bytes):
6536 : * format = format.encode('ASCII')
6537 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
6538 : * self.format = self._format
6539 : *
6540 : */
6541 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
6542 0 : __pyx_t_4 = __pyx_v_format;
6543 0 : __Pyx_INCREF(__pyx_t_4);
6544 0 : __Pyx_GIVEREF(__pyx_t_4);
6545 0 : __Pyx_GOTREF(__pyx_v_self->_format);
6546 0 : __Pyx_DECREF(__pyx_v_self->_format);
6547 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
6548 0 : __pyx_t_4 = 0;
6549 :
6550 : /* "View.MemoryView":149
6551 : * format = format.encode('ASCII')
6552 : * self._format = format # keep a reference to the byte string
6553 : * self.format = self._format # <<<<<<<<<<<<<<
6554 : *
6555 : *
6556 : */
6557 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
6558 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6559 0 : __PYX_ERR(1, 149, __pyx_L1_error)
6560 : }
6561 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
6562 0 : __pyx_v_self->format = __pyx_t_8;
6563 :
6564 : /* "View.MemoryView":152
6565 : *
6566 : *
6567 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
6568 : * self._strides = self._shape + self.ndim
6569 : *
6570 : */
6571 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6572 :
6573 : /* "View.MemoryView":153
6574 : *
6575 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6576 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
6577 : *
6578 : * if not self._shape:
6579 : */
6580 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6581 :
6582 : /* "View.MemoryView":155
6583 : * self._strides = self._shape + self.ndim
6584 : *
6585 : * if not self._shape: # <<<<<<<<<<<<<<
6586 : * raise MemoryError, "unable to allocate shape and strides."
6587 : *
6588 : */
6589 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
6590 0 : if (unlikely(__pyx_t_3)) {
6591 :
6592 : /* "View.MemoryView":156
6593 : *
6594 : * if not self._shape:
6595 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
6596 : *
6597 : *
6598 : */
6599 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
6600 0 : __PYX_ERR(1, 156, __pyx_L1_error)
6601 :
6602 : /* "View.MemoryView":155
6603 : * self._strides = self._shape + self.ndim
6604 : *
6605 : * if not self._shape: # <<<<<<<<<<<<<<
6606 : * raise MemoryError, "unable to allocate shape and strides."
6607 : *
6608 : */
6609 : }
6610 :
6611 : /* "View.MemoryView":159
6612 : *
6613 : *
6614 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6615 : * if dim <= 0:
6616 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6617 : */
6618 0 : __pyx_t_9 = 0;
6619 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
6620 : __pyx_t_1 = 0;
6621 0 : for (;;) {
6622 0 : {
6623 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
6624 : #if !CYTHON_ASSUME_SAFE_MACROS
6625 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
6626 : #endif
6627 0 : if (__pyx_t_1 >= __pyx_temp) break;
6628 : }
6629 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6630 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
6631 : #else
6632 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
6633 : __Pyx_GOTREF(__pyx_t_5);
6634 : #endif
6635 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
6636 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6637 0 : __pyx_v_dim = __pyx_t_10;
6638 0 : __pyx_v_idx = __pyx_t_9;
6639 0 : __pyx_t_9 = (__pyx_t_9 + 1);
6640 :
6641 : /* "View.MemoryView":160
6642 : *
6643 : * for idx, dim in enumerate(shape):
6644 : * if dim <= 0: # <<<<<<<<<<<<<<
6645 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6646 : * self._shape[idx] = dim
6647 : */
6648 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
6649 0 : if (unlikely(__pyx_t_3)) {
6650 :
6651 : /* "View.MemoryView":161
6652 : * for idx, dim in enumerate(shape):
6653 : * if dim <= 0:
6654 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
6655 : * self._shape[idx] = dim
6656 : *
6657 : */
6658 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
6659 0 : __Pyx_GOTREF(__pyx_t_5);
6660 0 : __pyx_t_10 = 0;
6661 0 : __pyx_t_11 = 127;
6662 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
6663 0 : __pyx_t_10 += 22;
6664 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
6665 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
6666 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6667 0 : __Pyx_GOTREF(__pyx_t_6);
6668 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
6669 0 : __Pyx_GIVEREF(__pyx_t_6);
6670 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
6671 0 : __pyx_t_6 = 0;
6672 0 : __Pyx_INCREF(__pyx_kp_u_);
6673 0 : __pyx_t_10 += 2;
6674 0 : __Pyx_GIVEREF(__pyx_kp_u_);
6675 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
6676 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6677 0 : __Pyx_GOTREF(__pyx_t_6);
6678 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
6679 0 : __Pyx_GIVEREF(__pyx_t_6);
6680 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
6681 0 : __pyx_t_6 = 0;
6682 0 : __Pyx_INCREF(__pyx_kp_u__2);
6683 0 : __pyx_t_10 += 1;
6684 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
6685 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
6686 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6687 0 : __Pyx_GOTREF(__pyx_t_6);
6688 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6689 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
6690 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6691 0 : __PYX_ERR(1, 161, __pyx_L1_error)
6692 :
6693 : /* "View.MemoryView":160
6694 : *
6695 : * for idx, dim in enumerate(shape):
6696 : * if dim <= 0: # <<<<<<<<<<<<<<
6697 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6698 : * self._shape[idx] = dim
6699 : */
6700 : }
6701 :
6702 : /* "View.MemoryView":162
6703 : * if dim <= 0:
6704 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6705 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
6706 : *
6707 : * cdef char order
6708 : */
6709 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6710 :
6711 : /* "View.MemoryView":159
6712 : *
6713 : *
6714 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6715 : * if dim <= 0:
6716 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6717 : */
6718 : }
6719 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6720 :
6721 : /* "View.MemoryView":165
6722 : *
6723 : * cdef char order
6724 : * if mode == 'c': # <<<<<<<<<<<<<<
6725 : * order = b'C'
6726 : * self.mode = u'c'
6727 : */
6728 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
6729 0 : if (__pyx_t_3) {
6730 :
6731 : /* "View.MemoryView":166
6732 : * cdef char order
6733 : * if mode == 'c':
6734 : * order = b'C' # <<<<<<<<<<<<<<
6735 : * self.mode = u'c'
6736 : * elif mode == 'fortran':
6737 : */
6738 0 : __pyx_v_order = 'C';
6739 :
6740 : /* "View.MemoryView":167
6741 : * if mode == 'c':
6742 : * order = b'C'
6743 : * self.mode = u'c' # <<<<<<<<<<<<<<
6744 : * elif mode == 'fortran':
6745 : * order = b'F'
6746 : */
6747 0 : __Pyx_INCREF(__pyx_n_u_c);
6748 0 : __Pyx_GIVEREF(__pyx_n_u_c);
6749 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6750 0 : __Pyx_DECREF(__pyx_v_self->mode);
6751 0 : __pyx_v_self->mode = __pyx_n_u_c;
6752 :
6753 : /* "View.MemoryView":165
6754 : *
6755 : * cdef char order
6756 : * if mode == 'c': # <<<<<<<<<<<<<<
6757 : * order = b'C'
6758 : * self.mode = u'c'
6759 : */
6760 0 : goto __pyx_L11;
6761 : }
6762 :
6763 : /* "View.MemoryView":168
6764 : * order = b'C'
6765 : * self.mode = u'c'
6766 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6767 : * order = b'F'
6768 : * self.mode = u'fortran'
6769 : */
6770 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
6771 0 : if (likely(__pyx_t_3)) {
6772 :
6773 : /* "View.MemoryView":169
6774 : * self.mode = u'c'
6775 : * elif mode == 'fortran':
6776 : * order = b'F' # <<<<<<<<<<<<<<
6777 : * self.mode = u'fortran'
6778 : * else:
6779 : */
6780 0 : __pyx_v_order = 'F';
6781 :
6782 : /* "View.MemoryView":170
6783 : * elif mode == 'fortran':
6784 : * order = b'F'
6785 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
6786 : * else:
6787 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6788 : */
6789 0 : __Pyx_INCREF(__pyx_n_u_fortran);
6790 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
6791 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6792 0 : __Pyx_DECREF(__pyx_v_self->mode);
6793 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
6794 :
6795 : /* "View.MemoryView":168
6796 : * order = b'C'
6797 : * self.mode = u'c'
6798 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6799 : * order = b'F'
6800 : * self.mode = u'fortran'
6801 : */
6802 0 : goto __pyx_L11;
6803 : }
6804 :
6805 : /* "View.MemoryView":172
6806 : * self.mode = u'fortran'
6807 : * else:
6808 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
6809 : *
6810 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6811 : */
6812 : /*else*/ {
6813 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
6814 0 : __Pyx_GOTREF(__pyx_t_4);
6815 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
6816 0 : __Pyx_GOTREF(__pyx_t_6);
6817 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6818 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
6819 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6820 0 : __PYX_ERR(1, 172, __pyx_L1_error)
6821 : }
6822 0 : __pyx_L11:;
6823 :
6824 : /* "View.MemoryView":174
6825 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6826 : *
6827 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
6828 : *
6829 : * self.free_data = allocate_buffer
6830 : */
6831 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6832 :
6833 : /* "View.MemoryView":176
6834 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6835 : *
6836 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6837 : * self.dtype_is_object = format == b'O'
6838 : *
6839 : */
6840 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6841 :
6842 : /* "View.MemoryView":177
6843 : *
6844 : * self.free_data = allocate_buffer
6845 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6846 : *
6847 : * if allocate_buffer:
6848 : */
6849 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
6850 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
6851 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6852 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
6853 :
6854 : /* "View.MemoryView":179
6855 : * self.dtype_is_object = format == b'O'
6856 : *
6857 : * if allocate_buffer: # <<<<<<<<<<<<<<
6858 : * _allocate_buffer(self)
6859 : *
6860 : */
6861 0 : if (__pyx_v_allocate_buffer) {
6862 :
6863 : /* "View.MemoryView":180
6864 : *
6865 : * if allocate_buffer:
6866 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
6867 : *
6868 : * @cname('getbuffer')
6869 : */
6870 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
6871 :
6872 : /* "View.MemoryView":179
6873 : * self.dtype_is_object = format == b'O'
6874 : *
6875 : * if allocate_buffer: # <<<<<<<<<<<<<<
6876 : * _allocate_buffer(self)
6877 : *
6878 : */
6879 : }
6880 :
6881 : /* "View.MemoryView":131
6882 : * cdef bint dtype_is_object
6883 : *
6884 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6885 : * mode="c", bint allocate_buffer=True):
6886 : *
6887 : */
6888 :
6889 : /* function exit code */
6890 0 : __pyx_r = 0;
6891 0 : goto __pyx_L0;
6892 0 : __pyx_L1_error:;
6893 0 : __Pyx_XDECREF(__pyx_t_4);
6894 0 : __Pyx_XDECREF(__pyx_t_5);
6895 0 : __Pyx_XDECREF(__pyx_t_6);
6896 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6897 0 : __pyx_r = -1;
6898 0 : __pyx_L0:;
6899 0 : __Pyx_XDECREF(__pyx_v_format);
6900 0 : __Pyx_RefNannyFinishContext();
6901 0 : return __pyx_r;
6902 : }
6903 :
6904 : /* "View.MemoryView":182
6905 : * _allocate_buffer(self)
6906 : *
6907 : * @cname('getbuffer') # <<<<<<<<<<<<<<
6908 : * def __getbuffer__(self, Py_buffer *info, int flags):
6909 : * cdef int bufmode = -1
6910 : */
6911 :
6912 : /* Python wrapper */
6913 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6914 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6915 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6916 0 : int __pyx_r;
6917 : __Pyx_RefNannyDeclarations
6918 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6919 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6920 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6921 :
6922 : /* function exit code */
6923 0 : __Pyx_RefNannyFinishContext();
6924 0 : return __pyx_r;
6925 : }
6926 :
6927 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6928 0 : int __pyx_v_bufmode;
6929 0 : int __pyx_r;
6930 : __Pyx_RefNannyDeclarations
6931 0 : int __pyx_t_1;
6932 0 : char *__pyx_t_2;
6933 0 : Py_ssize_t __pyx_t_3;
6934 0 : int __pyx_t_4;
6935 0 : Py_ssize_t *__pyx_t_5;
6936 0 : int __pyx_lineno = 0;
6937 0 : const char *__pyx_filename = NULL;
6938 0 : int __pyx_clineno = 0;
6939 0 : if (unlikely(__pyx_v_info == NULL)) {
6940 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6941 0 : return -1;
6942 : }
6943 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
6944 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6945 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
6946 :
6947 : /* "View.MemoryView":184
6948 : * @cname('getbuffer')
6949 : * def __getbuffer__(self, Py_buffer *info, int flags):
6950 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
6951 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6952 : * if self.mode == u"c":
6953 : */
6954 0 : __pyx_v_bufmode = -1;
6955 :
6956 : /* "View.MemoryView":185
6957 : * def __getbuffer__(self, Py_buffer *info, int flags):
6958 : * cdef int bufmode = -1
6959 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
6960 : * if self.mode == u"c":
6961 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6962 : */
6963 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
6964 0 : if (__pyx_t_1) {
6965 :
6966 : /* "View.MemoryView":186
6967 : * cdef int bufmode = -1
6968 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6969 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6970 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6971 : * elif self.mode == u"fortran":
6972 : */
6973 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
6974 0 : if (__pyx_t_1) {
6975 :
6976 : /* "View.MemoryView":187
6977 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6978 : * if self.mode == u"c":
6979 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6980 : * elif self.mode == u"fortran":
6981 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6982 : */
6983 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6984 :
6985 : /* "View.MemoryView":186
6986 : * cdef int bufmode = -1
6987 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6988 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6989 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6990 : * elif self.mode == u"fortran":
6991 : */
6992 0 : goto __pyx_L4;
6993 : }
6994 :
6995 : /* "View.MemoryView":188
6996 : * if self.mode == u"c":
6997 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6998 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6999 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7000 : * if not (flags & bufmode):
7001 : */
7002 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
7003 0 : if (__pyx_t_1) {
7004 :
7005 : /* "View.MemoryView":189
7006 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7007 : * elif self.mode == u"fortran":
7008 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7009 : * if not (flags & bufmode):
7010 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
7011 : */
7012 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7013 :
7014 : /* "View.MemoryView":188
7015 : * if self.mode == u"c":
7016 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7017 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7018 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7019 : * if not (flags & bufmode):
7020 : */
7021 : }
7022 0 : __pyx_L4:;
7023 :
7024 : /* "View.MemoryView":190
7025 : * elif self.mode == u"fortran":
7026 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7027 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
7028 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
7029 : * info.buf = self.data
7030 : */
7031 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
7032 0 : if (unlikely(__pyx_t_1)) {
7033 :
7034 : /* "View.MemoryView":191
7035 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7036 : * if not (flags & bufmode):
7037 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
7038 : * info.buf = self.data
7039 : * info.len = self.len
7040 : */
7041 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
7042 0 : __PYX_ERR(1, 191, __pyx_L1_error)
7043 :
7044 : /* "View.MemoryView":190
7045 : * elif self.mode == u"fortran":
7046 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7047 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
7048 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
7049 : * info.buf = self.data
7050 : */
7051 : }
7052 :
7053 : /* "View.MemoryView":185
7054 : * def __getbuffer__(self, Py_buffer *info, int flags):
7055 : * cdef int bufmode = -1
7056 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
7057 : * if self.mode == u"c":
7058 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7059 : */
7060 : }
7061 :
7062 : /* "View.MemoryView":192
7063 : * if not (flags & bufmode):
7064 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
7065 : * info.buf = self.data # <<<<<<<<<<<<<<
7066 : * info.len = self.len
7067 : *
7068 : */
7069 0 : __pyx_t_2 = __pyx_v_self->data;
7070 0 : __pyx_v_info->buf = __pyx_t_2;
7071 :
7072 : /* "View.MemoryView":193
7073 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
7074 : * info.buf = self.data
7075 : * info.len = self.len # <<<<<<<<<<<<<<
7076 : *
7077 : * if flags & PyBUF_STRIDES:
7078 : */
7079 0 : __pyx_t_3 = __pyx_v_self->len;
7080 0 : __pyx_v_info->len = __pyx_t_3;
7081 :
7082 : /* "View.MemoryView":195
7083 : * info.len = self.len
7084 : *
7085 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
7086 : * info.ndim = self.ndim
7087 : * info.shape = self._shape
7088 : */
7089 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
7090 0 : if (__pyx_t_1) {
7091 :
7092 : /* "View.MemoryView":196
7093 : *
7094 : * if flags & PyBUF_STRIDES:
7095 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
7096 : * info.shape = self._shape
7097 : * info.strides = self._strides
7098 : */
7099 0 : __pyx_t_4 = __pyx_v_self->ndim;
7100 0 : __pyx_v_info->ndim = __pyx_t_4;
7101 :
7102 : /* "View.MemoryView":197
7103 : * if flags & PyBUF_STRIDES:
7104 : * info.ndim = self.ndim
7105 : * info.shape = self._shape # <<<<<<<<<<<<<<
7106 : * info.strides = self._strides
7107 : * else:
7108 : */
7109 0 : __pyx_t_5 = __pyx_v_self->_shape;
7110 0 : __pyx_v_info->shape = __pyx_t_5;
7111 :
7112 : /* "View.MemoryView":198
7113 : * info.ndim = self.ndim
7114 : * info.shape = self._shape
7115 : * info.strides = self._strides # <<<<<<<<<<<<<<
7116 : * else:
7117 : * info.ndim = 1
7118 : */
7119 0 : __pyx_t_5 = __pyx_v_self->_strides;
7120 0 : __pyx_v_info->strides = __pyx_t_5;
7121 :
7122 : /* "View.MemoryView":195
7123 : * info.len = self.len
7124 : *
7125 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
7126 : * info.ndim = self.ndim
7127 : * info.shape = self._shape
7128 : */
7129 0 : goto __pyx_L6;
7130 : }
7131 :
7132 : /* "View.MemoryView":200
7133 : * info.strides = self._strides
7134 : * else:
7135 : * info.ndim = 1 # <<<<<<<<<<<<<<
7136 : * info.shape = &self.len if flags & PyBUF_ND else NULL
7137 : * info.strides = NULL
7138 : */
7139 : /*else*/ {
7140 0 : __pyx_v_info->ndim = 1;
7141 :
7142 : /* "View.MemoryView":201
7143 : * else:
7144 : * info.ndim = 1
7145 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
7146 : * info.strides = NULL
7147 : *
7148 : */
7149 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
7150 0 : if (__pyx_t_1) {
7151 : __pyx_t_5 = (&__pyx_v_self->len);
7152 : } else {
7153 : __pyx_t_5 = NULL;
7154 : }
7155 0 : __pyx_v_info->shape = __pyx_t_5;
7156 :
7157 : /* "View.MemoryView":202
7158 : * info.ndim = 1
7159 : * info.shape = &self.len if flags & PyBUF_ND else NULL
7160 : * info.strides = NULL # <<<<<<<<<<<<<<
7161 : *
7162 : * info.suboffsets = NULL
7163 : */
7164 0 : __pyx_v_info->strides = NULL;
7165 : }
7166 0 : __pyx_L6:;
7167 :
7168 : /* "View.MemoryView":204
7169 : * info.strides = NULL
7170 : *
7171 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
7172 : * info.itemsize = self.itemsize
7173 : * info.readonly = 0
7174 : */
7175 0 : __pyx_v_info->suboffsets = NULL;
7176 :
7177 : /* "View.MemoryView":205
7178 : *
7179 : * info.suboffsets = NULL
7180 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
7181 : * info.readonly = 0
7182 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
7183 : */
7184 0 : __pyx_t_3 = __pyx_v_self->itemsize;
7185 0 : __pyx_v_info->itemsize = __pyx_t_3;
7186 :
7187 : /* "View.MemoryView":206
7188 : * info.suboffsets = NULL
7189 : * info.itemsize = self.itemsize
7190 : * info.readonly = 0 # <<<<<<<<<<<<<<
7191 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
7192 : * info.obj = self
7193 : */
7194 0 : __pyx_v_info->readonly = 0;
7195 :
7196 : /* "View.MemoryView":207
7197 : * info.itemsize = self.itemsize
7198 : * info.readonly = 0
7199 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
7200 : * info.obj = self
7201 : *
7202 : */
7203 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7204 0 : if (__pyx_t_1) {
7205 0 : __pyx_t_2 = __pyx_v_self->format;
7206 : } else {
7207 : __pyx_t_2 = NULL;
7208 : }
7209 0 : __pyx_v_info->format = __pyx_t_2;
7210 :
7211 : /* "View.MemoryView":208
7212 : * info.readonly = 0
7213 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
7214 : * info.obj = self # <<<<<<<<<<<<<<
7215 : *
7216 : * def __dealloc__(array self):
7217 : */
7218 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
7219 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
7220 0 : __Pyx_GOTREF(__pyx_v_info->obj);
7221 0 : __Pyx_DECREF(__pyx_v_info->obj);
7222 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7223 :
7224 : /* "View.MemoryView":182
7225 : * _allocate_buffer(self)
7226 : *
7227 : * @cname('getbuffer') # <<<<<<<<<<<<<<
7228 : * def __getbuffer__(self, Py_buffer *info, int flags):
7229 : * cdef int bufmode = -1
7230 : */
7231 :
7232 : /* function exit code */
7233 0 : __pyx_r = 0;
7234 0 : goto __pyx_L0;
7235 0 : __pyx_L1_error:;
7236 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7237 0 : __pyx_r = -1;
7238 0 : if (__pyx_v_info->obj != NULL) {
7239 0 : __Pyx_GOTREF(__pyx_v_info->obj);
7240 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7241 : }
7242 0 : goto __pyx_L2;
7243 0 : __pyx_L0:;
7244 0 : if (__pyx_v_info->obj == Py_None) {
7245 0 : __Pyx_GOTREF(__pyx_v_info->obj);
7246 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7247 : }
7248 0 : __pyx_L2:;
7249 : __Pyx_RefNannyFinishContext();
7250 : return __pyx_r;
7251 : }
7252 :
7253 : /* "View.MemoryView":210
7254 : * info.obj = self
7255 : *
7256 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
7257 : * if self.callback_free_data != NULL:
7258 : * self.callback_free_data(self.data)
7259 : */
7260 :
7261 : /* Python wrapper */
7262 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
7263 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7264 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7265 : __Pyx_RefNannyDeclarations
7266 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7267 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7268 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7269 :
7270 : /* function exit code */
7271 0 : __Pyx_RefNannyFinishContext();
7272 : }
7273 :
7274 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7275 0 : int __pyx_t_1;
7276 0 : int __pyx_t_2;
7277 :
7278 : /* "View.MemoryView":211
7279 : *
7280 : * def __dealloc__(array self):
7281 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7282 : * self.callback_free_data(self.data)
7283 : * elif self.free_data and self.data is not NULL:
7284 : */
7285 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
7286 0 : if (__pyx_t_1) {
7287 :
7288 : /* "View.MemoryView":212
7289 : * def __dealloc__(array self):
7290 : * if self.callback_free_data != NULL:
7291 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
7292 : * elif self.free_data and self.data is not NULL:
7293 : * if self.dtype_is_object:
7294 : */
7295 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
7296 :
7297 : /* "View.MemoryView":211
7298 : *
7299 : * def __dealloc__(array self):
7300 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7301 : * self.callback_free_data(self.data)
7302 : * elif self.free_data and self.data is not NULL:
7303 : */
7304 0 : goto __pyx_L3;
7305 : }
7306 :
7307 : /* "View.MemoryView":213
7308 : * if self.callback_free_data != NULL:
7309 : * self.callback_free_data(self.data)
7310 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
7311 : * if self.dtype_is_object:
7312 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7313 : */
7314 0 : if (__pyx_v_self->free_data) {
7315 0 : } else {
7316 0 : __pyx_t_1 = __pyx_v_self->free_data;
7317 0 : goto __pyx_L4_bool_binop_done;
7318 : }
7319 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
7320 0 : __pyx_t_1 = __pyx_t_2;
7321 0 : __pyx_L4_bool_binop_done:;
7322 0 : if (__pyx_t_1) {
7323 :
7324 : /* "View.MemoryView":214
7325 : * self.callback_free_data(self.data)
7326 : * elif self.free_data and self.data is not NULL:
7327 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7328 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7329 : * free(self.data)
7330 : */
7331 0 : if (__pyx_v_self->dtype_is_object) {
7332 :
7333 : /* "View.MemoryView":215
7334 : * elif self.free_data and self.data is not NULL:
7335 : * if self.dtype_is_object:
7336 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
7337 : * free(self.data)
7338 : * PyObject_Free(self._shape)
7339 : */
7340 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7341 :
7342 : /* "View.MemoryView":214
7343 : * self.callback_free_data(self.data)
7344 : * elif self.free_data and self.data is not NULL:
7345 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7346 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7347 : * free(self.data)
7348 : */
7349 : }
7350 :
7351 : /* "View.MemoryView":216
7352 : * if self.dtype_is_object:
7353 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7354 : * free(self.data) # <<<<<<<<<<<<<<
7355 : * PyObject_Free(self._shape)
7356 : *
7357 : */
7358 0 : free(__pyx_v_self->data);
7359 :
7360 : /* "View.MemoryView":213
7361 : * if self.callback_free_data != NULL:
7362 : * self.callback_free_data(self.data)
7363 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
7364 : * if self.dtype_is_object:
7365 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7366 : */
7367 : }
7368 0 : __pyx_L3:;
7369 :
7370 : /* "View.MemoryView":217
7371 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
7372 : * free(self.data)
7373 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
7374 : *
7375 : * @property
7376 : */
7377 0 : PyObject_Free(__pyx_v_self->_shape);
7378 :
7379 : /* "View.MemoryView":210
7380 : * info.obj = self
7381 : *
7382 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
7383 : * if self.callback_free_data != NULL:
7384 : * self.callback_free_data(self.data)
7385 : */
7386 :
7387 : /* function exit code */
7388 0 : }
7389 :
7390 : /* "View.MemoryView":219
7391 : * PyObject_Free(self._shape)
7392 : *
7393 : * @property # <<<<<<<<<<<<<<
7394 : * def memview(self):
7395 : * return self.get_memview()
7396 : */
7397 :
7398 : /* Python wrapper */
7399 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
7400 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7401 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7402 0 : PyObject *__pyx_r = 0;
7403 : __Pyx_RefNannyDeclarations
7404 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7405 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7406 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7407 :
7408 : /* function exit code */
7409 0 : __Pyx_RefNannyFinishContext();
7410 0 : return __pyx_r;
7411 : }
7412 :
7413 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7414 0 : PyObject *__pyx_r = NULL;
7415 : __Pyx_RefNannyDeclarations
7416 0 : PyObject *__pyx_t_1 = NULL;
7417 0 : int __pyx_lineno = 0;
7418 0 : const char *__pyx_filename = NULL;
7419 0 : int __pyx_clineno = 0;
7420 0 : __Pyx_RefNannySetupContext("__get__", 1);
7421 :
7422 : /* "View.MemoryView":221
7423 : * @property
7424 : * def memview(self):
7425 : * return self.get_memview() # <<<<<<<<<<<<<<
7426 : *
7427 : * @cname('get_memview')
7428 : */
7429 0 : __Pyx_XDECREF(__pyx_r);
7430 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
7431 0 : __Pyx_GOTREF(__pyx_t_1);
7432 0 : __pyx_r = __pyx_t_1;
7433 0 : __pyx_t_1 = 0;
7434 0 : goto __pyx_L0;
7435 :
7436 : /* "View.MemoryView":219
7437 : * PyObject_Free(self._shape)
7438 : *
7439 : * @property # <<<<<<<<<<<<<<
7440 : * def memview(self):
7441 : * return self.get_memview()
7442 : */
7443 :
7444 : /* function exit code */
7445 0 : __pyx_L1_error:;
7446 0 : __Pyx_XDECREF(__pyx_t_1);
7447 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7448 0 : __pyx_r = NULL;
7449 0 : __pyx_L0:;
7450 0 : __Pyx_XGIVEREF(__pyx_r);
7451 0 : __Pyx_RefNannyFinishContext();
7452 0 : return __pyx_r;
7453 : }
7454 :
7455 : /* "View.MemoryView":224
7456 : *
7457 : * @cname('get_memview')
7458 : * cdef get_memview(self): # <<<<<<<<<<<<<<
7459 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7460 : * return memoryview(self, flags, self.dtype_is_object)
7461 : */
7462 :
7463 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7464 0 : int __pyx_v_flags;
7465 0 : PyObject *__pyx_r = NULL;
7466 : __Pyx_RefNannyDeclarations
7467 0 : PyObject *__pyx_t_1 = NULL;
7468 0 : PyObject *__pyx_t_2 = NULL;
7469 0 : PyObject *__pyx_t_3 = NULL;
7470 0 : int __pyx_lineno = 0;
7471 0 : const char *__pyx_filename = NULL;
7472 0 : int __pyx_clineno = 0;
7473 0 : __Pyx_RefNannySetupContext("get_memview", 1);
7474 :
7475 : /* "View.MemoryView":225
7476 : * @cname('get_memview')
7477 : * cdef get_memview(self):
7478 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
7479 : * return memoryview(self, flags, self.dtype_is_object)
7480 : *
7481 : */
7482 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7483 :
7484 : /* "View.MemoryView":226
7485 : * cdef get_memview(self):
7486 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7487 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
7488 : *
7489 : * def __len__(self):
7490 : */
7491 0 : __Pyx_XDECREF(__pyx_r);
7492 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
7493 0 : __Pyx_GOTREF(__pyx_t_1);
7494 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
7495 0 : __Pyx_GOTREF(__pyx_t_2);
7496 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
7497 0 : __Pyx_GOTREF(__pyx_t_3);
7498 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
7499 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
7500 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
7501 0 : __Pyx_GIVEREF(__pyx_t_1);
7502 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
7503 0 : __Pyx_GIVEREF(__pyx_t_2);
7504 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
7505 0 : __pyx_t_1 = 0;
7506 0 : __pyx_t_2 = 0;
7507 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
7508 0 : __Pyx_GOTREF(__pyx_t_2);
7509 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7510 0 : __pyx_r = __pyx_t_2;
7511 0 : __pyx_t_2 = 0;
7512 0 : goto __pyx_L0;
7513 :
7514 : /* "View.MemoryView":224
7515 : *
7516 : * @cname('get_memview')
7517 : * cdef get_memview(self): # <<<<<<<<<<<<<<
7518 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7519 : * return memoryview(self, flags, self.dtype_is_object)
7520 : */
7521 :
7522 : /* function exit code */
7523 0 : __pyx_L1_error:;
7524 0 : __Pyx_XDECREF(__pyx_t_1);
7525 0 : __Pyx_XDECREF(__pyx_t_2);
7526 0 : __Pyx_XDECREF(__pyx_t_3);
7527 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7528 0 : __pyx_r = 0;
7529 0 : __pyx_L0:;
7530 0 : __Pyx_XGIVEREF(__pyx_r);
7531 0 : __Pyx_RefNannyFinishContext();
7532 0 : return __pyx_r;
7533 : }
7534 :
7535 : /* "View.MemoryView":228
7536 : * return memoryview(self, flags, self.dtype_is_object)
7537 : *
7538 : * def __len__(self): # <<<<<<<<<<<<<<
7539 : * return self._shape[0]
7540 : *
7541 : */
7542 :
7543 : /* Python wrapper */
7544 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
7545 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7546 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7547 0 : Py_ssize_t __pyx_r;
7548 : __Pyx_RefNannyDeclarations
7549 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7550 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7551 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7552 :
7553 : /* function exit code */
7554 0 : __Pyx_RefNannyFinishContext();
7555 0 : return __pyx_r;
7556 : }
7557 :
7558 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7559 0 : Py_ssize_t __pyx_r;
7560 :
7561 : /* "View.MemoryView":229
7562 : *
7563 : * def __len__(self):
7564 : * return self._shape[0] # <<<<<<<<<<<<<<
7565 : *
7566 : * def __getattr__(self, attr):
7567 : */
7568 0 : __pyx_r = (__pyx_v_self->_shape[0]);
7569 0 : goto __pyx_L0;
7570 :
7571 : /* "View.MemoryView":228
7572 : * return memoryview(self, flags, self.dtype_is_object)
7573 : *
7574 : * def __len__(self): # <<<<<<<<<<<<<<
7575 : * return self._shape[0]
7576 : *
7577 : */
7578 :
7579 : /* function exit code */
7580 0 : __pyx_L0:;
7581 0 : return __pyx_r;
7582 : }
7583 :
7584 : /* "View.MemoryView":231
7585 : * return self._shape[0]
7586 : *
7587 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7588 : * return getattr(self.memview, attr)
7589 : *
7590 : */
7591 :
7592 : /* Python wrapper */
7593 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
7594 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7595 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7596 0 : PyObject *__pyx_r = 0;
7597 : __Pyx_RefNannyDeclarations
7598 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7599 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7600 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7601 :
7602 : /* function exit code */
7603 0 : __Pyx_RefNannyFinishContext();
7604 0 : return __pyx_r;
7605 : }
7606 :
7607 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7608 0 : PyObject *__pyx_r = NULL;
7609 : __Pyx_RefNannyDeclarations
7610 0 : PyObject *__pyx_t_1 = NULL;
7611 0 : PyObject *__pyx_t_2 = NULL;
7612 0 : int __pyx_lineno = 0;
7613 0 : const char *__pyx_filename = NULL;
7614 0 : int __pyx_clineno = 0;
7615 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
7616 :
7617 : /* "View.MemoryView":232
7618 : *
7619 : * def __getattr__(self, attr):
7620 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
7621 : *
7622 : * def __getitem__(self, item):
7623 : */
7624 0 : __Pyx_XDECREF(__pyx_r);
7625 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
7626 0 : __Pyx_GOTREF(__pyx_t_1);
7627 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
7628 0 : __Pyx_GOTREF(__pyx_t_2);
7629 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7630 0 : __pyx_r = __pyx_t_2;
7631 0 : __pyx_t_2 = 0;
7632 0 : goto __pyx_L0;
7633 :
7634 : /* "View.MemoryView":231
7635 : * return self._shape[0]
7636 : *
7637 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7638 : * return getattr(self.memview, attr)
7639 : *
7640 : */
7641 :
7642 : /* function exit code */
7643 0 : __pyx_L1_error:;
7644 0 : __Pyx_XDECREF(__pyx_t_1);
7645 0 : __Pyx_XDECREF(__pyx_t_2);
7646 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7647 0 : __pyx_r = NULL;
7648 0 : __pyx_L0:;
7649 0 : __Pyx_XGIVEREF(__pyx_r);
7650 0 : __Pyx_RefNannyFinishContext();
7651 0 : return __pyx_r;
7652 : }
7653 :
7654 : /* "View.MemoryView":234
7655 : * return getattr(self.memview, attr)
7656 : *
7657 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
7658 : * return self.memview[item]
7659 : *
7660 : */
7661 :
7662 : /* Python wrapper */
7663 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
7664 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7665 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7666 0 : PyObject *__pyx_r = 0;
7667 : __Pyx_RefNannyDeclarations
7668 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7669 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7670 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7671 :
7672 : /* function exit code */
7673 0 : __Pyx_RefNannyFinishContext();
7674 0 : return __pyx_r;
7675 : }
7676 :
7677 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7678 0 : PyObject *__pyx_r = NULL;
7679 : __Pyx_RefNannyDeclarations
7680 0 : PyObject *__pyx_t_1 = NULL;
7681 0 : PyObject *__pyx_t_2 = NULL;
7682 0 : int __pyx_lineno = 0;
7683 0 : const char *__pyx_filename = NULL;
7684 0 : int __pyx_clineno = 0;
7685 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
7686 :
7687 : /* "View.MemoryView":235
7688 : *
7689 : * def __getitem__(self, item):
7690 : * return self.memview[item] # <<<<<<<<<<<<<<
7691 : *
7692 : * def __setitem__(self, item, value):
7693 : */
7694 0 : __Pyx_XDECREF(__pyx_r);
7695 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
7696 0 : __Pyx_GOTREF(__pyx_t_1);
7697 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
7698 0 : __Pyx_GOTREF(__pyx_t_2);
7699 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7700 0 : __pyx_r = __pyx_t_2;
7701 0 : __pyx_t_2 = 0;
7702 0 : goto __pyx_L0;
7703 :
7704 : /* "View.MemoryView":234
7705 : * return getattr(self.memview, attr)
7706 : *
7707 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
7708 : * return self.memview[item]
7709 : *
7710 : */
7711 :
7712 : /* function exit code */
7713 0 : __pyx_L1_error:;
7714 0 : __Pyx_XDECREF(__pyx_t_1);
7715 0 : __Pyx_XDECREF(__pyx_t_2);
7716 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7717 0 : __pyx_r = NULL;
7718 0 : __pyx_L0:;
7719 0 : __Pyx_XGIVEREF(__pyx_r);
7720 0 : __Pyx_RefNannyFinishContext();
7721 0 : return __pyx_r;
7722 : }
7723 :
7724 : /* "View.MemoryView":237
7725 : * return self.memview[item]
7726 : *
7727 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7728 : * self.memview[item] = value
7729 : *
7730 : */
7731 :
7732 : /* Python wrapper */
7733 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7734 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7735 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7736 0 : int __pyx_r;
7737 : __Pyx_RefNannyDeclarations
7738 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7739 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7740 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7741 :
7742 : /* function exit code */
7743 0 : __Pyx_RefNannyFinishContext();
7744 0 : return __pyx_r;
7745 : }
7746 :
7747 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7748 0 : int __pyx_r;
7749 : __Pyx_RefNannyDeclarations
7750 0 : PyObject *__pyx_t_1 = NULL;
7751 0 : int __pyx_lineno = 0;
7752 0 : const char *__pyx_filename = NULL;
7753 0 : int __pyx_clineno = 0;
7754 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
7755 :
7756 : /* "View.MemoryView":238
7757 : *
7758 : * def __setitem__(self, item, value):
7759 : * self.memview[item] = value # <<<<<<<<<<<<<<
7760 : *
7761 : *
7762 : */
7763 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
7764 0 : __Pyx_GOTREF(__pyx_t_1);
7765 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
7766 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7767 :
7768 : /* "View.MemoryView":237
7769 : * return self.memview[item]
7770 : *
7771 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7772 : * self.memview[item] = value
7773 : *
7774 : */
7775 :
7776 : /* function exit code */
7777 0 : __pyx_r = 0;
7778 0 : goto __pyx_L0;
7779 0 : __pyx_L1_error:;
7780 0 : __Pyx_XDECREF(__pyx_t_1);
7781 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7782 0 : __pyx_r = -1;
7783 0 : __pyx_L0:;
7784 0 : __Pyx_RefNannyFinishContext();
7785 0 : return __pyx_r;
7786 : }
7787 :
7788 : /* "(tree fragment)":1
7789 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7790 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7791 : * def __setstate_cython__(self, __pyx_state):
7792 : */
7793 :
7794 : /* Python wrapper */
7795 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7796 : #if CYTHON_METH_FASTCALL
7797 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7798 : #else
7799 : PyObject *__pyx_args, PyObject *__pyx_kwds
7800 : #endif
7801 : ); /*proto*/
7802 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7803 : #if CYTHON_METH_FASTCALL
7804 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7805 : #else
7806 : PyObject *__pyx_args, PyObject *__pyx_kwds
7807 : #endif
7808 : ) {
7809 : #if !CYTHON_METH_FASTCALL
7810 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7811 : #endif
7812 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7813 0 : PyObject *__pyx_r = 0;
7814 : __Pyx_RefNannyDeclarations
7815 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7816 : #if !CYTHON_METH_FASTCALL
7817 : #if CYTHON_ASSUME_SAFE_MACROS
7818 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7819 : #else
7820 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7821 : #endif
7822 : #endif
7823 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7824 0 : if (unlikely(__pyx_nargs > 0)) {
7825 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7826 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7827 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7828 :
7829 : /* function exit code */
7830 0 : __Pyx_RefNannyFinishContext();
7831 0 : return __pyx_r;
7832 : }
7833 :
7834 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7835 0 : PyObject *__pyx_r = NULL;
7836 : __Pyx_RefNannyDeclarations
7837 0 : int __pyx_lineno = 0;
7838 0 : const char *__pyx_filename = NULL;
7839 0 : int __pyx_clineno = 0;
7840 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7841 :
7842 : /* "(tree fragment)":2
7843 : * def __reduce_cython__(self):
7844 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7845 : * def __setstate_cython__(self, __pyx_state):
7846 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7847 : */
7848 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7849 0 : __PYX_ERR(1, 2, __pyx_L1_error)
7850 :
7851 : /* "(tree fragment)":1
7852 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7853 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7854 : * def __setstate_cython__(self, __pyx_state):
7855 : */
7856 :
7857 : /* function exit code */
7858 0 : __pyx_L1_error:;
7859 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7860 0 : __pyx_r = NULL;
7861 0 : __Pyx_XGIVEREF(__pyx_r);
7862 0 : __Pyx_RefNannyFinishContext();
7863 0 : return __pyx_r;
7864 : }
7865 :
7866 : /* "(tree fragment)":3
7867 : * def __reduce_cython__(self):
7868 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7869 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7870 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7871 : */
7872 :
7873 : /* Python wrapper */
7874 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7875 : #if CYTHON_METH_FASTCALL
7876 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7877 : #else
7878 : PyObject *__pyx_args, PyObject *__pyx_kwds
7879 : #endif
7880 : ); /*proto*/
7881 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7882 : #if CYTHON_METH_FASTCALL
7883 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7884 : #else
7885 : PyObject *__pyx_args, PyObject *__pyx_kwds
7886 : #endif
7887 : ) {
7888 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
7889 : #if !CYTHON_METH_FASTCALL
7890 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7891 : #endif
7892 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7893 0 : PyObject* values[1] = {0};
7894 0 : int __pyx_lineno = 0;
7895 0 : const char *__pyx_filename = NULL;
7896 0 : int __pyx_clineno = 0;
7897 0 : PyObject *__pyx_r = 0;
7898 : __Pyx_RefNannyDeclarations
7899 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7900 : #if !CYTHON_METH_FASTCALL
7901 : #if CYTHON_ASSUME_SAFE_MACROS
7902 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7903 : #else
7904 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7905 : #endif
7906 : #endif
7907 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7908 : {
7909 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7910 0 : if (__pyx_kwds) {
7911 0 : Py_ssize_t kw_args;
7912 0 : switch (__pyx_nargs) {
7913 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7914 0 : CYTHON_FALLTHROUGH;
7915 0 : case 0: break;
7916 0 : default: goto __pyx_L5_argtuple_error;
7917 : }
7918 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7919 0 : switch (__pyx_nargs) {
7920 : case 0:
7921 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7922 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7923 0 : kw_args--;
7924 : }
7925 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
7926 0 : else goto __pyx_L5_argtuple_error;
7927 : }
7928 0 : if (unlikely(kw_args > 0)) {
7929 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7930 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
7931 : }
7932 0 : } else if (unlikely(__pyx_nargs != 1)) {
7933 0 : goto __pyx_L5_argtuple_error;
7934 : } else {
7935 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7936 : }
7937 0 : __pyx_v___pyx_state = values[0];
7938 : }
7939 0 : goto __pyx_L6_skip;
7940 0 : __pyx_L5_argtuple_error:;
7941 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
7942 0 : __pyx_L6_skip:;
7943 0 : goto __pyx_L4_argument_unpacking_done;
7944 0 : __pyx_L3_error:;
7945 : {
7946 0 : Py_ssize_t __pyx_temp;
7947 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7948 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7949 : }
7950 : }
7951 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7952 0 : __Pyx_RefNannyFinishContext();
7953 0 : return NULL;
7954 0 : __pyx_L4_argument_unpacking_done:;
7955 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
7956 :
7957 : /* function exit code */
7958 : {
7959 0 : Py_ssize_t __pyx_temp;
7960 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7961 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7962 : }
7963 : }
7964 : __Pyx_RefNannyFinishContext();
7965 : return __pyx_r;
7966 : }
7967 :
7968 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7969 0 : PyObject *__pyx_r = NULL;
7970 : __Pyx_RefNannyDeclarations
7971 0 : int __pyx_lineno = 0;
7972 0 : const char *__pyx_filename = NULL;
7973 0 : int __pyx_clineno = 0;
7974 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7975 :
7976 : /* "(tree fragment)":4
7977 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7978 : * def __setstate_cython__(self, __pyx_state):
7979 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7980 : */
7981 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7982 0 : __PYX_ERR(1, 4, __pyx_L1_error)
7983 :
7984 : /* "(tree fragment)":3
7985 : * def __reduce_cython__(self):
7986 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7987 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7988 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7989 : */
7990 :
7991 : /* function exit code */
7992 0 : __pyx_L1_error:;
7993 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7994 0 : __pyx_r = NULL;
7995 0 : __Pyx_XGIVEREF(__pyx_r);
7996 0 : __Pyx_RefNannyFinishContext();
7997 0 : return __pyx_r;
7998 : }
7999 :
8000 : /* "View.MemoryView":248
8001 : *
8002 : * @cname("__pyx_array_allocate_buffer")
8003 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
8004 : *
8005 : *
8006 : */
8007 :
8008 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
8009 0 : Py_ssize_t __pyx_v_i;
8010 0 : PyObject **__pyx_v_p;
8011 0 : int __pyx_r;
8012 0 : int __pyx_t_1;
8013 0 : Py_ssize_t __pyx_t_2;
8014 0 : Py_ssize_t __pyx_t_3;
8015 0 : Py_ssize_t __pyx_t_4;
8016 0 : int __pyx_lineno = 0;
8017 0 : const char *__pyx_filename = NULL;
8018 0 : int __pyx_clineno = 0;
8019 :
8020 : /* "View.MemoryView":254
8021 : * cdef PyObject **p
8022 : *
8023 : * self.free_data = True # <<<<<<<<<<<<<<
8024 : * self.data = <char *>malloc(self.len)
8025 : * if not self.data:
8026 : */
8027 0 : __pyx_v_self->free_data = 1;
8028 :
8029 : /* "View.MemoryView":255
8030 : *
8031 : * self.free_data = True
8032 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8033 : * if not self.data:
8034 : * raise MemoryError, "unable to allocate array data."
8035 : */
8036 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8037 :
8038 : /* "View.MemoryView":256
8039 : * self.free_data = True
8040 : * self.data = <char *>malloc(self.len)
8041 : * if not self.data: # <<<<<<<<<<<<<<
8042 : * raise MemoryError, "unable to allocate array data."
8043 : *
8044 : */
8045 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
8046 0 : if (unlikely(__pyx_t_1)) {
8047 :
8048 : /* "View.MemoryView":257
8049 : * self.data = <char *>malloc(self.len)
8050 : * if not self.data:
8051 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
8052 : *
8053 : * if self.dtype_is_object:
8054 : */
8055 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
8056 0 : __PYX_ERR(1, 257, __pyx_L1_error)
8057 :
8058 : /* "View.MemoryView":256
8059 : * self.free_data = True
8060 : * self.data = <char *>malloc(self.len)
8061 : * if not self.data: # <<<<<<<<<<<<<<
8062 : * raise MemoryError, "unable to allocate array data."
8063 : *
8064 : */
8065 : }
8066 :
8067 : /* "View.MemoryView":259
8068 : * raise MemoryError, "unable to allocate array data."
8069 : *
8070 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
8071 : * p = <PyObject **> self.data
8072 : * for i in range(self.len // self.itemsize):
8073 : */
8074 0 : if (__pyx_v_self->dtype_is_object) {
8075 :
8076 : /* "View.MemoryView":260
8077 : *
8078 : * if self.dtype_is_object:
8079 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8080 : * for i in range(self.len // self.itemsize):
8081 : * p[i] = Py_None
8082 : */
8083 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8084 :
8085 : /* "View.MemoryView":261
8086 : * if self.dtype_is_object:
8087 : * p = <PyObject **> self.data
8088 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
8089 : * p[i] = Py_None
8090 : * Py_INCREF(Py_None)
8091 : */
8092 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
8093 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8094 0 : __PYX_ERR(1, 261, __pyx_L1_error)
8095 : }
8096 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8097 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8098 0 : __PYX_ERR(1, 261, __pyx_L1_error)
8099 : }
8100 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
8101 0 : __pyx_t_3 = __pyx_t_2;
8102 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8103 0 : __pyx_v_i = __pyx_t_4;
8104 :
8105 : /* "View.MemoryView":262
8106 : * p = <PyObject **> self.data
8107 : * for i in range(self.len // self.itemsize):
8108 : * p[i] = Py_None # <<<<<<<<<<<<<<
8109 : * Py_INCREF(Py_None)
8110 : * return 0
8111 : */
8112 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
8113 :
8114 : /* "View.MemoryView":263
8115 : * for i in range(self.len // self.itemsize):
8116 : * p[i] = Py_None
8117 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8118 : * return 0
8119 : *
8120 : */
8121 0 : Py_INCREF(Py_None);
8122 : }
8123 :
8124 : /* "View.MemoryView":259
8125 : * raise MemoryError, "unable to allocate array data."
8126 : *
8127 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
8128 : * p = <PyObject **> self.data
8129 : * for i in range(self.len // self.itemsize):
8130 : */
8131 : }
8132 :
8133 : /* "View.MemoryView":264
8134 : * p[i] = Py_None
8135 : * Py_INCREF(Py_None)
8136 : * return 0 # <<<<<<<<<<<<<<
8137 : *
8138 : *
8139 : */
8140 0 : __pyx_r = 0;
8141 0 : goto __pyx_L0;
8142 :
8143 : /* "View.MemoryView":248
8144 : *
8145 : * @cname("__pyx_array_allocate_buffer")
8146 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
8147 : *
8148 : *
8149 : */
8150 :
8151 : /* function exit code */
8152 0 : __pyx_L1_error:;
8153 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8154 0 : __pyx_r = -1;
8155 0 : __pyx_L0:;
8156 0 : return __pyx_r;
8157 : }
8158 :
8159 : /* "View.MemoryView":268
8160 : *
8161 : * @cname("__pyx_array_new")
8162 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
8163 : * cdef array result
8164 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
8165 : */
8166 :
8167 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
8168 0 : struct __pyx_array_obj *__pyx_v_result = 0;
8169 0 : PyObject *__pyx_v_mode = 0;
8170 0 : struct __pyx_array_obj *__pyx_r = NULL;
8171 : __Pyx_RefNannyDeclarations
8172 0 : PyObject *__pyx_t_1 = NULL;
8173 0 : int __pyx_t_2;
8174 0 : PyObject *__pyx_t_3 = NULL;
8175 0 : PyObject *__pyx_t_4 = NULL;
8176 0 : int __pyx_lineno = 0;
8177 0 : const char *__pyx_filename = NULL;
8178 0 : int __pyx_clineno = 0;
8179 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
8180 :
8181 : /* "View.MemoryView":270
8182 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
8183 : * cdef array result
8184 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
8185 : *
8186 : * if buf is NULL:
8187 : */
8188 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
8189 0 : if (__pyx_t_2) {
8190 0 : __Pyx_INCREF(__pyx_n_s_fortran);
8191 : __pyx_t_1 = __pyx_n_s_fortran;
8192 : } else {
8193 0 : __Pyx_INCREF(__pyx_n_s_c);
8194 : __pyx_t_1 = __pyx_n_s_c;
8195 : }
8196 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
8197 0 : __pyx_t_1 = 0;
8198 :
8199 : /* "View.MemoryView":272
8200 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
8201 : *
8202 : * if buf is NULL: # <<<<<<<<<<<<<<
8203 : * result = array.__new__(array, shape, itemsize, format, mode)
8204 : * else:
8205 : */
8206 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
8207 0 : if (__pyx_t_2) {
8208 :
8209 : /* "View.MemoryView":273
8210 : *
8211 : * if buf is NULL:
8212 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
8213 : * else:
8214 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
8215 : */
8216 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
8217 0 : __Pyx_GOTREF(__pyx_t_1);
8218 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
8219 0 : __Pyx_GOTREF(__pyx_t_3);
8220 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
8221 0 : __Pyx_GOTREF(__pyx_t_4);
8222 0 : __Pyx_INCREF(__pyx_v_shape);
8223 0 : __Pyx_GIVEREF(__pyx_v_shape);
8224 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
8225 0 : __Pyx_GIVEREF(__pyx_t_1);
8226 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
8227 0 : __Pyx_GIVEREF(__pyx_t_3);
8228 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
8229 0 : __Pyx_INCREF(__pyx_v_mode);
8230 0 : __Pyx_GIVEREF(__pyx_v_mode);
8231 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
8232 0 : __pyx_t_1 = 0;
8233 0 : __pyx_t_3 = 0;
8234 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
8235 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
8236 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8237 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
8238 0 : __pyx_t_3 = 0;
8239 :
8240 : /* "View.MemoryView":272
8241 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
8242 : *
8243 : * if buf is NULL: # <<<<<<<<<<<<<<
8244 : * result = array.__new__(array, shape, itemsize, format, mode)
8245 : * else:
8246 : */
8247 0 : goto __pyx_L3;
8248 : }
8249 :
8250 : /* "View.MemoryView":275
8251 : * result = array.__new__(array, shape, itemsize, format, mode)
8252 : * else:
8253 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
8254 : * result.data = buf
8255 : *
8256 : */
8257 : /*else*/ {
8258 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
8259 0 : __Pyx_GOTREF(__pyx_t_3);
8260 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
8261 0 : __Pyx_GOTREF(__pyx_t_4);
8262 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
8263 0 : __Pyx_GOTREF(__pyx_t_1);
8264 0 : __Pyx_INCREF(__pyx_v_shape);
8265 0 : __Pyx_GIVEREF(__pyx_v_shape);
8266 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
8267 0 : __Pyx_GIVEREF(__pyx_t_3);
8268 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
8269 0 : __Pyx_GIVEREF(__pyx_t_4);
8270 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
8271 0 : __Pyx_INCREF(__pyx_v_mode);
8272 0 : __Pyx_GIVEREF(__pyx_v_mode);
8273 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
8274 0 : __pyx_t_3 = 0;
8275 0 : __pyx_t_4 = 0;
8276 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
8277 0 : __Pyx_GOTREF(__pyx_t_4);
8278 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
8279 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
8280 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
8281 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8282 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8283 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
8284 0 : __pyx_t_3 = 0;
8285 :
8286 : /* "View.MemoryView":276
8287 : * else:
8288 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
8289 : * result.data = buf # <<<<<<<<<<<<<<
8290 : *
8291 : * return result
8292 : */
8293 0 : __pyx_v_result->data = __pyx_v_buf;
8294 : }
8295 0 : __pyx_L3:;
8296 :
8297 : /* "View.MemoryView":278
8298 : * result.data = buf
8299 : *
8300 : * return result # <<<<<<<<<<<<<<
8301 : *
8302 : *
8303 : */
8304 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
8305 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
8306 0 : __pyx_r = __pyx_v_result;
8307 0 : goto __pyx_L0;
8308 :
8309 : /* "View.MemoryView":268
8310 : *
8311 : * @cname("__pyx_array_new")
8312 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
8313 : * cdef array result
8314 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
8315 : */
8316 :
8317 : /* function exit code */
8318 0 : __pyx_L1_error:;
8319 0 : __Pyx_XDECREF(__pyx_t_1);
8320 0 : __Pyx_XDECREF(__pyx_t_3);
8321 0 : __Pyx_XDECREF(__pyx_t_4);
8322 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8323 0 : __pyx_r = 0;
8324 0 : __pyx_L0:;
8325 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
8326 0 : __Pyx_XDECREF(__pyx_v_mode);
8327 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
8328 0 : __Pyx_RefNannyFinishContext();
8329 0 : return __pyx_r;
8330 : }
8331 :
8332 : /* "View.MemoryView":304
8333 : * cdef class Enum(object):
8334 : * cdef object name
8335 : * def __init__(self, name): # <<<<<<<<<<<<<<
8336 : * self.name = name
8337 : * def __repr__(self):
8338 : */
8339 :
8340 : /* Python wrapper */
8341 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8342 15 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8343 15 : PyObject *__pyx_v_name = 0;
8344 15 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8345 15 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8346 15 : PyObject* values[1] = {0};
8347 15 : int __pyx_lineno = 0;
8348 15 : const char *__pyx_filename = NULL;
8349 15 : int __pyx_clineno = 0;
8350 15 : int __pyx_r;
8351 : __Pyx_RefNannyDeclarations
8352 15 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8353 : #if CYTHON_ASSUME_SAFE_MACROS
8354 15 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8355 : #else
8356 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
8357 : #endif
8358 15 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8359 : {
8360 15 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8361 15 : if (__pyx_kwds) {
8362 0 : Py_ssize_t kw_args;
8363 0 : switch (__pyx_nargs) {
8364 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8365 0 : CYTHON_FALLTHROUGH;
8366 0 : case 0: break;
8367 0 : default: goto __pyx_L5_argtuple_error;
8368 : }
8369 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
8370 0 : switch (__pyx_nargs) {
8371 0 : case 0:
8372 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
8373 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
8374 0 : kw_args--;
8375 : }
8376 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
8377 0 : else goto __pyx_L5_argtuple_error;
8378 : }
8379 0 : if (unlikely(kw_args > 0)) {
8380 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8381 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
8382 : }
8383 15 : } else if (unlikely(__pyx_nargs != 1)) {
8384 0 : goto __pyx_L5_argtuple_error;
8385 : } else {
8386 15 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8387 : }
8388 15 : __pyx_v_name = values[0];
8389 : }
8390 15 : goto __pyx_L6_skip;
8391 0 : __pyx_L5_argtuple_error:;
8392 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
8393 15 : __pyx_L6_skip:;
8394 15 : goto __pyx_L4_argument_unpacking_done;
8395 0 : __pyx_L3_error:;
8396 : {
8397 0 : Py_ssize_t __pyx_temp;
8398 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8399 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8400 : }
8401 : }
8402 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8403 0 : __Pyx_RefNannyFinishContext();
8404 0 : return -1;
8405 15 : __pyx_L4_argument_unpacking_done:;
8406 15 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8407 :
8408 : /* function exit code */
8409 : {
8410 15 : Py_ssize_t __pyx_temp;
8411 15 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8412 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8413 : }
8414 : }
8415 : __Pyx_RefNannyFinishContext();
8416 : return __pyx_r;
8417 : }
8418 :
8419 15 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8420 15 : int __pyx_r;
8421 : __Pyx_RefNannyDeclarations
8422 15 : __Pyx_RefNannySetupContext("__init__", 1);
8423 :
8424 : /* "View.MemoryView":305
8425 : * cdef object name
8426 : * def __init__(self, name):
8427 : * self.name = name # <<<<<<<<<<<<<<
8428 : * def __repr__(self):
8429 : * return self.name
8430 : */
8431 15 : __Pyx_INCREF(__pyx_v_name);
8432 15 : __Pyx_GIVEREF(__pyx_v_name);
8433 15 : __Pyx_GOTREF(__pyx_v_self->name);
8434 15 : __Pyx_DECREF(__pyx_v_self->name);
8435 15 : __pyx_v_self->name = __pyx_v_name;
8436 :
8437 : /* "View.MemoryView":304
8438 : * cdef class Enum(object):
8439 : * cdef object name
8440 : * def __init__(self, name): # <<<<<<<<<<<<<<
8441 : * self.name = name
8442 : * def __repr__(self):
8443 : */
8444 :
8445 : /* function exit code */
8446 15 : __pyx_r = 0;
8447 15 : __Pyx_RefNannyFinishContext();
8448 15 : return __pyx_r;
8449 : }
8450 :
8451 : /* "View.MemoryView":306
8452 : * def __init__(self, name):
8453 : * self.name = name
8454 : * def __repr__(self): # <<<<<<<<<<<<<<
8455 : * return self.name
8456 : *
8457 : */
8458 :
8459 : /* Python wrapper */
8460 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
8461 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8462 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8463 0 : PyObject *__pyx_r = 0;
8464 : __Pyx_RefNannyDeclarations
8465 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8466 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8467 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8468 :
8469 : /* function exit code */
8470 0 : __Pyx_RefNannyFinishContext();
8471 0 : return __pyx_r;
8472 : }
8473 :
8474 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8475 0 : PyObject *__pyx_r = NULL;
8476 : __Pyx_RefNannyDeclarations
8477 0 : __Pyx_RefNannySetupContext("__repr__", 1);
8478 :
8479 : /* "View.MemoryView":307
8480 : * self.name = name
8481 : * def __repr__(self):
8482 : * return self.name # <<<<<<<<<<<<<<
8483 : *
8484 : * cdef generic = Enum("<strided and direct or indirect>")
8485 : */
8486 0 : __Pyx_XDECREF(__pyx_r);
8487 0 : __Pyx_INCREF(__pyx_v_self->name);
8488 0 : __pyx_r = __pyx_v_self->name;
8489 0 : goto __pyx_L0;
8490 :
8491 : /* "View.MemoryView":306
8492 : * def __init__(self, name):
8493 : * self.name = name
8494 : * def __repr__(self): # <<<<<<<<<<<<<<
8495 : * return self.name
8496 : *
8497 : */
8498 :
8499 : /* function exit code */
8500 0 : __pyx_L0:;
8501 0 : __Pyx_XGIVEREF(__pyx_r);
8502 0 : __Pyx_RefNannyFinishContext();
8503 0 : return __pyx_r;
8504 : }
8505 :
8506 : /* "(tree fragment)":1
8507 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8508 : * cdef tuple state
8509 : * cdef object _dict
8510 : */
8511 :
8512 : /* Python wrapper */
8513 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
8514 : #if CYTHON_METH_FASTCALL
8515 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8516 : #else
8517 : PyObject *__pyx_args, PyObject *__pyx_kwds
8518 : #endif
8519 : ); /*proto*/
8520 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
8521 : #if CYTHON_METH_FASTCALL
8522 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8523 : #else
8524 : PyObject *__pyx_args, PyObject *__pyx_kwds
8525 : #endif
8526 : ) {
8527 : #if !CYTHON_METH_FASTCALL
8528 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8529 : #endif
8530 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8531 0 : PyObject *__pyx_r = 0;
8532 : __Pyx_RefNannyDeclarations
8533 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8534 : #if !CYTHON_METH_FASTCALL
8535 : #if CYTHON_ASSUME_SAFE_MACROS
8536 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8537 : #else
8538 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8539 : #endif
8540 : #endif
8541 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8542 0 : if (unlikely(__pyx_nargs > 0)) {
8543 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
8544 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
8545 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8546 :
8547 : /* function exit code */
8548 0 : __Pyx_RefNannyFinishContext();
8549 0 : return __pyx_r;
8550 : }
8551 :
8552 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8553 0 : PyObject *__pyx_v_state = 0;
8554 0 : PyObject *__pyx_v__dict = 0;
8555 0 : int __pyx_v_use_setstate;
8556 0 : PyObject *__pyx_r = NULL;
8557 : __Pyx_RefNannyDeclarations
8558 0 : PyObject *__pyx_t_1 = NULL;
8559 0 : int __pyx_t_2;
8560 0 : PyObject *__pyx_t_3 = NULL;
8561 0 : PyObject *__pyx_t_4 = NULL;
8562 0 : int __pyx_lineno = 0;
8563 0 : const char *__pyx_filename = NULL;
8564 0 : int __pyx_clineno = 0;
8565 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
8566 :
8567 : /* "(tree fragment)":5
8568 : * cdef object _dict
8569 : * cdef bint use_setstate
8570 : * state = (self.name,) # <<<<<<<<<<<<<<
8571 : * _dict = getattr(self, '__dict__', None)
8572 : * if _dict is not None:
8573 : */
8574 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8575 0 : __Pyx_GOTREF(__pyx_t_1);
8576 0 : __Pyx_INCREF(__pyx_v_self->name);
8577 0 : __Pyx_GIVEREF(__pyx_v_self->name);
8578 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
8579 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
8580 0 : __pyx_t_1 = 0;
8581 :
8582 : /* "(tree fragment)":6
8583 : * cdef bint use_setstate
8584 : * state = (self.name,)
8585 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
8586 : * if _dict is not None:
8587 : * state += (_dict,)
8588 : */
8589 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
8590 0 : __Pyx_GOTREF(__pyx_t_1);
8591 0 : __pyx_v__dict = __pyx_t_1;
8592 0 : __pyx_t_1 = 0;
8593 :
8594 : /* "(tree fragment)":7
8595 : * state = (self.name,)
8596 : * _dict = getattr(self, '__dict__', None)
8597 : * if _dict is not None: # <<<<<<<<<<<<<<
8598 : * state += (_dict,)
8599 : * use_setstate = True
8600 : */
8601 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
8602 0 : if (__pyx_t_2) {
8603 :
8604 : /* "(tree fragment)":8
8605 : * _dict = getattr(self, '__dict__', None)
8606 : * if _dict is not None:
8607 : * state += (_dict,) # <<<<<<<<<<<<<<
8608 : * use_setstate = True
8609 : * else:
8610 : */
8611 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
8612 0 : __Pyx_GOTREF(__pyx_t_1);
8613 0 : __Pyx_INCREF(__pyx_v__dict);
8614 0 : __Pyx_GIVEREF(__pyx_v__dict);
8615 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
8616 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
8617 0 : __Pyx_GOTREF(__pyx_t_3);
8618 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8619 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
8620 0 : __pyx_t_3 = 0;
8621 :
8622 : /* "(tree fragment)":9
8623 : * if _dict is not None:
8624 : * state += (_dict,)
8625 : * use_setstate = True # <<<<<<<<<<<<<<
8626 : * else:
8627 : * use_setstate = self.name is not None
8628 : */
8629 0 : __pyx_v_use_setstate = 1;
8630 :
8631 : /* "(tree fragment)":7
8632 : * state = (self.name,)
8633 : * _dict = getattr(self, '__dict__', None)
8634 : * if _dict is not None: # <<<<<<<<<<<<<<
8635 : * state += (_dict,)
8636 : * use_setstate = True
8637 : */
8638 0 : goto __pyx_L3;
8639 : }
8640 :
8641 : /* "(tree fragment)":11
8642 : * use_setstate = True
8643 : * else:
8644 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
8645 : * if use_setstate:
8646 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8647 : */
8648 : /*else*/ {
8649 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
8650 0 : __pyx_v_use_setstate = __pyx_t_2;
8651 : }
8652 0 : __pyx_L3:;
8653 :
8654 : /* "(tree fragment)":12
8655 : * else:
8656 : * use_setstate = self.name is not None
8657 : * if use_setstate: # <<<<<<<<<<<<<<
8658 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8659 : * else:
8660 : */
8661 0 : if (__pyx_v_use_setstate) {
8662 :
8663 : /* "(tree fragment)":13
8664 : * use_setstate = self.name is not None
8665 : * if use_setstate:
8666 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
8667 : * else:
8668 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8669 : */
8670 0 : __Pyx_XDECREF(__pyx_r);
8671 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
8672 0 : __Pyx_GOTREF(__pyx_t_3);
8673 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
8674 0 : __Pyx_GOTREF(__pyx_t_1);
8675 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8676 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8677 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
8678 0 : __Pyx_INCREF(__pyx_int_136983863);
8679 0 : __Pyx_GIVEREF(__pyx_int_136983863);
8680 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
8681 0 : __Pyx_INCREF(Py_None);
8682 0 : __Pyx_GIVEREF(Py_None);
8683 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
8684 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
8685 0 : __Pyx_GOTREF(__pyx_t_4);
8686 0 : __Pyx_GIVEREF(__pyx_t_3);
8687 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
8688 0 : __Pyx_GIVEREF(__pyx_t_1);
8689 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
8690 0 : __Pyx_INCREF(__pyx_v_state);
8691 0 : __Pyx_GIVEREF(__pyx_v_state);
8692 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
8693 0 : __pyx_t_3 = 0;
8694 0 : __pyx_t_1 = 0;
8695 0 : __pyx_r = __pyx_t_4;
8696 0 : __pyx_t_4 = 0;
8697 0 : goto __pyx_L0;
8698 :
8699 : /* "(tree fragment)":12
8700 : * else:
8701 : * use_setstate = self.name is not None
8702 : * if use_setstate: # <<<<<<<<<<<<<<
8703 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8704 : * else:
8705 : */
8706 : }
8707 :
8708 : /* "(tree fragment)":15
8709 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8710 : * else:
8711 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
8712 : * def __setstate_cython__(self, __pyx_state):
8713 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8714 : */
8715 : /*else*/ {
8716 0 : __Pyx_XDECREF(__pyx_r);
8717 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
8718 0 : __Pyx_GOTREF(__pyx_t_4);
8719 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
8720 0 : __Pyx_GOTREF(__pyx_t_1);
8721 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8722 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8723 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
8724 0 : __Pyx_INCREF(__pyx_int_136983863);
8725 0 : __Pyx_GIVEREF(__pyx_int_136983863);
8726 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
8727 0 : __Pyx_INCREF(__pyx_v_state);
8728 0 : __Pyx_GIVEREF(__pyx_v_state);
8729 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
8730 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
8731 0 : __Pyx_GOTREF(__pyx_t_3);
8732 0 : __Pyx_GIVEREF(__pyx_t_4);
8733 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
8734 0 : __Pyx_GIVEREF(__pyx_t_1);
8735 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
8736 0 : __pyx_t_4 = 0;
8737 0 : __pyx_t_1 = 0;
8738 0 : __pyx_r = __pyx_t_3;
8739 0 : __pyx_t_3 = 0;
8740 0 : goto __pyx_L0;
8741 : }
8742 :
8743 : /* "(tree fragment)":1
8744 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8745 : * cdef tuple state
8746 : * cdef object _dict
8747 : */
8748 :
8749 : /* function exit code */
8750 0 : __pyx_L1_error:;
8751 0 : __Pyx_XDECREF(__pyx_t_1);
8752 0 : __Pyx_XDECREF(__pyx_t_3);
8753 0 : __Pyx_XDECREF(__pyx_t_4);
8754 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8755 0 : __pyx_r = NULL;
8756 0 : __pyx_L0:;
8757 0 : __Pyx_XDECREF(__pyx_v_state);
8758 0 : __Pyx_XDECREF(__pyx_v__dict);
8759 0 : __Pyx_XGIVEREF(__pyx_r);
8760 0 : __Pyx_RefNannyFinishContext();
8761 0 : return __pyx_r;
8762 : }
8763 :
8764 : /* "(tree fragment)":16
8765 : * else:
8766 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8767 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8768 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8769 : */
8770 :
8771 : /* Python wrapper */
8772 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8773 : #if CYTHON_METH_FASTCALL
8774 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8775 : #else
8776 : PyObject *__pyx_args, PyObject *__pyx_kwds
8777 : #endif
8778 : ); /*proto*/
8779 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8780 : #if CYTHON_METH_FASTCALL
8781 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8782 : #else
8783 : PyObject *__pyx_args, PyObject *__pyx_kwds
8784 : #endif
8785 : ) {
8786 0 : PyObject *__pyx_v___pyx_state = 0;
8787 : #if !CYTHON_METH_FASTCALL
8788 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8789 : #endif
8790 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8791 0 : PyObject* values[1] = {0};
8792 0 : int __pyx_lineno = 0;
8793 0 : const char *__pyx_filename = NULL;
8794 0 : int __pyx_clineno = 0;
8795 0 : PyObject *__pyx_r = 0;
8796 : __Pyx_RefNannyDeclarations
8797 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8798 : #if !CYTHON_METH_FASTCALL
8799 : #if CYTHON_ASSUME_SAFE_MACROS
8800 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8801 : #else
8802 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8803 : #endif
8804 : #endif
8805 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8806 : {
8807 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
8808 0 : if (__pyx_kwds) {
8809 0 : Py_ssize_t kw_args;
8810 0 : switch (__pyx_nargs) {
8811 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8812 0 : CYTHON_FALLTHROUGH;
8813 0 : case 0: break;
8814 0 : default: goto __pyx_L5_argtuple_error;
8815 : }
8816 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
8817 0 : switch (__pyx_nargs) {
8818 : case 0:
8819 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
8820 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
8821 0 : kw_args--;
8822 : }
8823 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
8824 0 : else goto __pyx_L5_argtuple_error;
8825 : }
8826 0 : if (unlikely(kw_args > 0)) {
8827 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8828 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
8829 : }
8830 0 : } else if (unlikely(__pyx_nargs != 1)) {
8831 0 : goto __pyx_L5_argtuple_error;
8832 : } else {
8833 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8834 : }
8835 0 : __pyx_v___pyx_state = values[0];
8836 : }
8837 0 : goto __pyx_L6_skip;
8838 0 : __pyx_L5_argtuple_error:;
8839 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
8840 0 : __pyx_L6_skip:;
8841 0 : goto __pyx_L4_argument_unpacking_done;
8842 0 : __pyx_L3_error:;
8843 : {
8844 0 : Py_ssize_t __pyx_temp;
8845 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8846 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8847 : }
8848 : }
8849 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8850 0 : __Pyx_RefNannyFinishContext();
8851 0 : return NULL;
8852 0 : __pyx_L4_argument_unpacking_done:;
8853 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
8854 :
8855 : /* function exit code */
8856 : {
8857 0 : Py_ssize_t __pyx_temp;
8858 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8859 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8860 : }
8861 : }
8862 : __Pyx_RefNannyFinishContext();
8863 : return __pyx_r;
8864 : }
8865 :
8866 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8867 0 : PyObject *__pyx_r = NULL;
8868 : __Pyx_RefNannyDeclarations
8869 0 : PyObject *__pyx_t_1 = NULL;
8870 0 : int __pyx_lineno = 0;
8871 0 : const char *__pyx_filename = NULL;
8872 0 : int __pyx_clineno = 0;
8873 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
8874 :
8875 : /* "(tree fragment)":17
8876 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8877 : * def __setstate_cython__(self, __pyx_state):
8878 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8879 : */
8880 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
8881 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8882 0 : __Pyx_GOTREF(__pyx_t_1);
8883 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8884 :
8885 : /* "(tree fragment)":16
8886 : * else:
8887 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8888 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8889 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8890 : */
8891 :
8892 : /* function exit code */
8893 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8894 0 : goto __pyx_L0;
8895 0 : __pyx_L1_error:;
8896 0 : __Pyx_XDECREF(__pyx_t_1);
8897 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8898 0 : __pyx_r = NULL;
8899 0 : __pyx_L0:;
8900 0 : __Pyx_XGIVEREF(__pyx_r);
8901 0 : __Pyx_RefNannyFinishContext();
8902 0 : return __pyx_r;
8903 : }
8904 :
8905 : /* "View.MemoryView":349
8906 : * cdef __Pyx_TypeInfo *typeinfo
8907 : *
8908 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8909 : * self.obj = obj
8910 : * self.flags = flags
8911 : */
8912 :
8913 : /* Python wrapper */
8914 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8915 219 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8916 219 : PyObject *__pyx_v_obj = 0;
8917 219 : int __pyx_v_flags;
8918 219 : int __pyx_v_dtype_is_object;
8919 219 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8920 219 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8921 219 : PyObject* values[3] = {0,0,0};
8922 219 : int __pyx_lineno = 0;
8923 219 : const char *__pyx_filename = NULL;
8924 219 : int __pyx_clineno = 0;
8925 219 : int __pyx_r;
8926 : __Pyx_RefNannyDeclarations
8927 219 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8928 : #if CYTHON_ASSUME_SAFE_MACROS
8929 219 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8930 : #else
8931 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
8932 : #endif
8933 219 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8934 : {
8935 219 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8936 219 : if (__pyx_kwds) {
8937 0 : Py_ssize_t kw_args;
8938 0 : switch (__pyx_nargs) {
8939 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8940 0 : CYTHON_FALLTHROUGH;
8941 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8942 0 : CYTHON_FALLTHROUGH;
8943 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8944 0 : CYTHON_FALLTHROUGH;
8945 0 : case 0: break;
8946 0 : default: goto __pyx_L5_argtuple_error;
8947 : }
8948 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
8949 0 : switch (__pyx_nargs) {
8950 0 : case 0:
8951 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
8952 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
8953 0 : kw_args--;
8954 : }
8955 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8956 0 : else goto __pyx_L5_argtuple_error;
8957 0 : CYTHON_FALLTHROUGH;
8958 : case 1:
8959 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
8960 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
8961 0 : kw_args--;
8962 : }
8963 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8964 : else {
8965 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
8966 : }
8967 0 : CYTHON_FALLTHROUGH;
8968 : case 2:
8969 0 : if (kw_args > 0) {
8970 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
8971 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
8972 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8973 : }
8974 : }
8975 0 : if (unlikely(kw_args > 0)) {
8976 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8977 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
8978 : }
8979 : } else {
8980 219 : switch (__pyx_nargs) {
8981 219 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8982 219 : CYTHON_FALLTHROUGH;
8983 219 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8984 219 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8985 219 : break;
8986 0 : default: goto __pyx_L5_argtuple_error;
8987 : }
8988 : }
8989 219 : __pyx_v_obj = values[0];
8990 219 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8991 219 : if (values[2]) {
8992 219 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8993 : } else {
8994 : __pyx_v_dtype_is_object = ((int)0);
8995 : }
8996 : }
8997 219 : goto __pyx_L6_skip;
8998 0 : __pyx_L5_argtuple_error:;
8999 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
9000 219 : __pyx_L6_skip:;
9001 219 : goto __pyx_L4_argument_unpacking_done;
9002 0 : __pyx_L3_error:;
9003 : {
9004 0 : Py_ssize_t __pyx_temp;
9005 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9006 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
9007 : }
9008 : }
9009 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9010 0 : __Pyx_RefNannyFinishContext();
9011 0 : return -1;
9012 219 : __pyx_L4_argument_unpacking_done:;
9013 219 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9014 :
9015 : /* function exit code */
9016 : {
9017 219 : Py_ssize_t __pyx_temp;
9018 219 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9019 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
9020 : }
9021 : }
9022 : __Pyx_RefNannyFinishContext();
9023 : return __pyx_r;
9024 : }
9025 :
9026 219 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
9027 219 : int __pyx_r;
9028 : __Pyx_RefNannyDeclarations
9029 219 : int __pyx_t_1;
9030 219 : int __pyx_t_2;
9031 219 : int __pyx_t_3;
9032 219 : Py_intptr_t __pyx_t_4;
9033 219 : size_t __pyx_t_5;
9034 219 : int __pyx_lineno = 0;
9035 219 : const char *__pyx_filename = NULL;
9036 219 : int __pyx_clineno = 0;
9037 219 : __Pyx_RefNannySetupContext("__cinit__", 1);
9038 :
9039 : /* "View.MemoryView":350
9040 : *
9041 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9042 : * self.obj = obj # <<<<<<<<<<<<<<
9043 : * self.flags = flags
9044 : * if type(self) is memoryview or obj is not None:
9045 : */
9046 219 : __Pyx_INCREF(__pyx_v_obj);
9047 219 : __Pyx_GIVEREF(__pyx_v_obj);
9048 219 : __Pyx_GOTREF(__pyx_v_self->obj);
9049 219 : __Pyx_DECREF(__pyx_v_self->obj);
9050 219 : __pyx_v_self->obj = __pyx_v_obj;
9051 :
9052 : /* "View.MemoryView":351
9053 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9054 : * self.obj = obj
9055 : * self.flags = flags # <<<<<<<<<<<<<<
9056 : * if type(self) is memoryview or obj is not None:
9057 : * __Pyx_GetBuffer(obj, &self.view, flags)
9058 : */
9059 219 : __pyx_v_self->flags = __pyx_v_flags;
9060 :
9061 : /* "View.MemoryView":352
9062 : * self.obj = obj
9063 : * self.flags = flags
9064 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9065 : * __Pyx_GetBuffer(obj, &self.view, flags)
9066 : * if <PyObject *> self.view.obj == NULL:
9067 : */
9068 219 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9069 219 : if (!__pyx_t_2) {
9070 0 : } else {
9071 219 : __pyx_t_1 = __pyx_t_2;
9072 219 : goto __pyx_L4_bool_binop_done;
9073 : }
9074 0 : __pyx_t_2 = (__pyx_v_obj != Py_None);
9075 0 : __pyx_t_1 = __pyx_t_2;
9076 219 : __pyx_L4_bool_binop_done:;
9077 219 : if (__pyx_t_1) {
9078 :
9079 : /* "View.MemoryView":353
9080 : * self.flags = flags
9081 : * if type(self) is memoryview or obj is not None:
9082 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9083 : * if <PyObject *> self.view.obj == NULL:
9084 : * (<__pyx_buffer *> &self.view).obj = Py_None
9085 : */
9086 219 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
9087 :
9088 : /* "View.MemoryView":354
9089 : * if type(self) is memoryview or obj is not None:
9090 : * __Pyx_GetBuffer(obj, &self.view, flags)
9091 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9092 : * (<__pyx_buffer *> &self.view).obj = Py_None
9093 : * Py_INCREF(Py_None)
9094 : */
9095 219 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
9096 219 : if (__pyx_t_1) {
9097 :
9098 : /* "View.MemoryView":355
9099 : * __Pyx_GetBuffer(obj, &self.view, flags)
9100 : * if <PyObject *> self.view.obj == NULL:
9101 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9102 : * Py_INCREF(Py_None)
9103 : *
9104 : */
9105 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9106 :
9107 : /* "View.MemoryView":356
9108 : * if <PyObject *> self.view.obj == NULL:
9109 : * (<__pyx_buffer *> &self.view).obj = Py_None
9110 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9111 : *
9112 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
9113 : */
9114 0 : Py_INCREF(Py_None);
9115 :
9116 : /* "View.MemoryView":354
9117 : * if type(self) is memoryview or obj is not None:
9118 : * __Pyx_GetBuffer(obj, &self.view, flags)
9119 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9120 : * (<__pyx_buffer *> &self.view).obj = Py_None
9121 : * Py_INCREF(Py_None)
9122 : */
9123 : }
9124 :
9125 : /* "View.MemoryView":352
9126 : * self.obj = obj
9127 : * self.flags = flags
9128 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9129 : * __Pyx_GetBuffer(obj, &self.view, flags)
9130 : * if <PyObject *> self.view.obj == NULL:
9131 : */
9132 : }
9133 :
9134 : /* "View.MemoryView":358
9135 : * Py_INCREF(Py_None)
9136 : *
9137 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9138 : * global __pyx_memoryview_thread_locks_used
9139 : * if __pyx_memoryview_thread_locks_used < 8:
9140 : */
9141 219 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
9142 219 : if (__pyx_t_1) {
9143 :
9144 : /* "View.MemoryView":360
9145 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
9146 : * global __pyx_memoryview_thread_locks_used
9147 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
9148 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9149 : * __pyx_memoryview_thread_locks_used += 1
9150 : */
9151 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
9152 : if (__pyx_t_1) {
9153 :
9154 : /* "View.MemoryView":361
9155 : * global __pyx_memoryview_thread_locks_used
9156 : * if __pyx_memoryview_thread_locks_used < 8:
9157 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9158 : * __pyx_memoryview_thread_locks_used += 1
9159 : * if self.lock is NULL:
9160 : */
9161 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9162 :
9163 : /* "View.MemoryView":362
9164 : * if __pyx_memoryview_thread_locks_used < 8:
9165 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9166 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9167 : * if self.lock is NULL:
9168 : * self.lock = PyThread_allocate_lock()
9169 : */
9170 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9171 :
9172 : /* "View.MemoryView":360
9173 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
9174 : * global __pyx_memoryview_thread_locks_used
9175 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
9176 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9177 : * __pyx_memoryview_thread_locks_used += 1
9178 : */
9179 : }
9180 :
9181 : /* "View.MemoryView":363
9182 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9183 : * __pyx_memoryview_thread_locks_used += 1
9184 : * if self.lock is NULL: # <<<<<<<<<<<<<<
9185 : * self.lock = PyThread_allocate_lock()
9186 : * if self.lock is NULL:
9187 : */
9188 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
9189 : if (__pyx_t_1) {
9190 :
9191 : /* "View.MemoryView":364
9192 : * __pyx_memoryview_thread_locks_used += 1
9193 : * if self.lock is NULL:
9194 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9195 : * if self.lock is NULL:
9196 : * raise MemoryError
9197 : */
9198 : __pyx_v_self->lock = PyThread_allocate_lock();
9199 :
9200 : /* "View.MemoryView":365
9201 : * if self.lock is NULL:
9202 : * self.lock = PyThread_allocate_lock()
9203 : * if self.lock is NULL: # <<<<<<<<<<<<<<
9204 : * raise MemoryError
9205 : *
9206 : */
9207 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
9208 : if (unlikely(__pyx_t_1)) {
9209 :
9210 : /* "View.MemoryView":366
9211 : * self.lock = PyThread_allocate_lock()
9212 : * if self.lock is NULL:
9213 : * raise MemoryError # <<<<<<<<<<<<<<
9214 : *
9215 : * if flags & PyBUF_FORMAT:
9216 : */
9217 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
9218 :
9219 : /* "View.MemoryView":365
9220 : * if self.lock is NULL:
9221 : * self.lock = PyThread_allocate_lock()
9222 : * if self.lock is NULL: # <<<<<<<<<<<<<<
9223 : * raise MemoryError
9224 : *
9225 : */
9226 : }
9227 :
9228 : /* "View.MemoryView":363
9229 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9230 : * __pyx_memoryview_thread_locks_used += 1
9231 : * if self.lock is NULL: # <<<<<<<<<<<<<<
9232 : * self.lock = PyThread_allocate_lock()
9233 : * if self.lock is NULL:
9234 : */
9235 : }
9236 :
9237 : /* "View.MemoryView":358
9238 : * Py_INCREF(Py_None)
9239 : *
9240 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
9241 : * global __pyx_memoryview_thread_locks_used
9242 : * if __pyx_memoryview_thread_locks_used < 8:
9243 : */
9244 : }
9245 :
9246 : /* "View.MemoryView":368
9247 : * raise MemoryError
9248 : *
9249 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9250 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9251 : * else:
9252 : */
9253 219 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9254 219 : if (__pyx_t_1) {
9255 :
9256 : /* "View.MemoryView":369
9257 : *
9258 : * if flags & PyBUF_FORMAT:
9259 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9260 : * else:
9261 : * self.dtype_is_object = dtype_is_object
9262 : */
9263 219 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
9264 219 : if (__pyx_t_2) {
9265 0 : } else {
9266 219 : __pyx_t_1 = __pyx_t_2;
9267 219 : goto __pyx_L12_bool_binop_done;
9268 : }
9269 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
9270 0 : __pyx_t_1 = __pyx_t_2;
9271 219 : __pyx_L12_bool_binop_done:;
9272 219 : __pyx_v_self->dtype_is_object = __pyx_t_1;
9273 :
9274 : /* "View.MemoryView":368
9275 : * raise MemoryError
9276 : *
9277 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9278 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9279 : * else:
9280 : */
9281 219 : goto __pyx_L11;
9282 : }
9283 :
9284 : /* "View.MemoryView":371
9285 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9286 : * else:
9287 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9288 : *
9289 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
9290 : */
9291 : /*else*/ {
9292 0 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9293 : }
9294 219 : __pyx_L11:;
9295 :
9296 : /* "View.MemoryView":373
9297 : * self.dtype_is_object = dtype_is_object
9298 : *
9299 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
9300 : * self.typeinfo = NULL
9301 : *
9302 : */
9303 : #ifndef CYTHON_WITHOUT_ASSERTIONS
9304 219 : if (unlikely(__pyx_assertions_enabled())) {
9305 219 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
9306 219 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
9307 219 : if (unlikely(__pyx_t_5 == 0)) {
9308 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9309 : __PYX_ERR(1, 373, __pyx_L1_error)
9310 : }
9311 219 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
9312 219 : if (unlikely(!__pyx_t_1)) {
9313 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
9314 0 : __PYX_ERR(1, 373, __pyx_L1_error)
9315 : }
9316 : }
9317 : #else
9318 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
9319 : #endif
9320 :
9321 : /* "View.MemoryView":374
9322 : *
9323 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
9324 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
9325 : *
9326 : * def __dealloc__(memoryview self):
9327 : */
9328 219 : __pyx_v_self->typeinfo = NULL;
9329 :
9330 : /* "View.MemoryView":349
9331 : * cdef __Pyx_TypeInfo *typeinfo
9332 : *
9333 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9334 : * self.obj = obj
9335 : * self.flags = flags
9336 : */
9337 :
9338 : /* function exit code */
9339 219 : __pyx_r = 0;
9340 219 : goto __pyx_L0;
9341 0 : __pyx_L1_error:;
9342 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9343 0 : __pyx_r = -1;
9344 219 : __pyx_L0:;
9345 219 : __Pyx_RefNannyFinishContext();
9346 219 : return __pyx_r;
9347 : }
9348 :
9349 : /* "View.MemoryView":376
9350 : * self.typeinfo = NULL
9351 : *
9352 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9353 : * if self.obj is not None:
9354 : * __Pyx_ReleaseBuffer(&self.view)
9355 : */
9356 :
9357 : /* Python wrapper */
9358 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9359 219 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9360 219 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9361 : __Pyx_RefNannyDeclarations
9362 219 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9363 219 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9364 219 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9365 :
9366 : /* function exit code */
9367 219 : __Pyx_RefNannyFinishContext();
9368 : }
9369 :
9370 219 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9371 219 : int __pyx_v_i;
9372 219 : int __pyx_t_1;
9373 219 : int __pyx_t_2;
9374 219 : int __pyx_t_3;
9375 219 : int __pyx_t_4;
9376 219 : PyThread_type_lock __pyx_t_5;
9377 219 : PyThread_type_lock __pyx_t_6;
9378 :
9379 : /* "View.MemoryView":377
9380 : *
9381 : * def __dealloc__(memoryview self):
9382 : * if self.obj is not None: # <<<<<<<<<<<<<<
9383 : * __Pyx_ReleaseBuffer(&self.view)
9384 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9385 : */
9386 219 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9387 219 : if (__pyx_t_1) {
9388 :
9389 : /* "View.MemoryView":378
9390 : * def __dealloc__(memoryview self):
9391 : * if self.obj is not None:
9392 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9393 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9394 : *
9395 : */
9396 219 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9397 :
9398 : /* "View.MemoryView":377
9399 : *
9400 : * def __dealloc__(memoryview self):
9401 : * if self.obj is not None: # <<<<<<<<<<<<<<
9402 : * __Pyx_ReleaseBuffer(&self.view)
9403 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9404 : */
9405 219 : goto __pyx_L3;
9406 : }
9407 :
9408 : /* "View.MemoryView":379
9409 : * if self.obj is not None:
9410 : * __Pyx_ReleaseBuffer(&self.view)
9411 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9412 : *
9413 : * (<__pyx_buffer *> &self.view).obj = NULL
9414 : */
9415 0 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
9416 0 : if (__pyx_t_1) {
9417 :
9418 : /* "View.MemoryView":381
9419 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9420 : *
9421 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9422 : * Py_DECREF(Py_None)
9423 : *
9424 : */
9425 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9426 :
9427 : /* "View.MemoryView":382
9428 : *
9429 : * (<__pyx_buffer *> &self.view).obj = NULL
9430 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9431 : *
9432 : * cdef int i
9433 : */
9434 0 : Py_DECREF(Py_None);
9435 :
9436 : /* "View.MemoryView":379
9437 : * if self.obj is not None:
9438 : * __Pyx_ReleaseBuffer(&self.view)
9439 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9440 : *
9441 : * (<__pyx_buffer *> &self.view).obj = NULL
9442 : */
9443 : }
9444 0 : __pyx_L3:;
9445 :
9446 : /* "View.MemoryView":386
9447 : * cdef int i
9448 : * global __pyx_memoryview_thread_locks_used
9449 : * if self.lock != NULL: # <<<<<<<<<<<<<<
9450 : * for i in range(__pyx_memoryview_thread_locks_used):
9451 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9452 : */
9453 219 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
9454 219 : if (__pyx_t_1) {
9455 :
9456 : /* "View.MemoryView":387
9457 : * global __pyx_memoryview_thread_locks_used
9458 : * if self.lock != NULL:
9459 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9460 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9461 : * __pyx_memoryview_thread_locks_used -= 1
9462 : */
9463 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
9464 0 : __pyx_t_3 = __pyx_t_2;
9465 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
9466 0 : __pyx_v_i = __pyx_t_4;
9467 :
9468 : /* "View.MemoryView":388
9469 : * if self.lock != NULL:
9470 : * for i in range(__pyx_memoryview_thread_locks_used):
9471 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9472 : * __pyx_memoryview_thread_locks_used -= 1
9473 : * if i != __pyx_memoryview_thread_locks_used:
9474 : */
9475 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
9476 0 : if (__pyx_t_1) {
9477 :
9478 : /* "View.MemoryView":389
9479 : * for i in range(__pyx_memoryview_thread_locks_used):
9480 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9481 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9482 : * if i != __pyx_memoryview_thread_locks_used:
9483 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9484 : */
9485 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9486 :
9487 : /* "View.MemoryView":390
9488 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9489 : * __pyx_memoryview_thread_locks_used -= 1
9490 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9491 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9492 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9493 : */
9494 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
9495 0 : if (__pyx_t_1) {
9496 :
9497 : /* "View.MemoryView":392
9498 : * if i != __pyx_memoryview_thread_locks_used:
9499 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9500 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
9501 : * break
9502 : * else:
9503 : */
9504 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9505 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9506 :
9507 : /* "View.MemoryView":391
9508 : * __pyx_memoryview_thread_locks_used -= 1
9509 : * if i != __pyx_memoryview_thread_locks_used:
9510 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
9511 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9512 : * break
9513 : */
9514 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
9515 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
9516 :
9517 : /* "View.MemoryView":390
9518 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9519 : * __pyx_memoryview_thread_locks_used -= 1
9520 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9521 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9522 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9523 : */
9524 : }
9525 :
9526 : /* "View.MemoryView":393
9527 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9528 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9529 : * break # <<<<<<<<<<<<<<
9530 : * else:
9531 : * PyThread_free_lock(self.lock)
9532 : */
9533 0 : goto __pyx_L6_break;
9534 :
9535 : /* "View.MemoryView":388
9536 : * if self.lock != NULL:
9537 : * for i in range(__pyx_memoryview_thread_locks_used):
9538 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9539 : * __pyx_memoryview_thread_locks_used -= 1
9540 : * if i != __pyx_memoryview_thread_locks_used:
9541 : */
9542 : }
9543 : }
9544 : /*else*/ {
9545 :
9546 : /* "View.MemoryView":395
9547 : * break
9548 : * else:
9549 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
9550 : *
9551 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9552 : */
9553 0 : PyThread_free_lock(__pyx_v_self->lock);
9554 : }
9555 219 : __pyx_L6_break:;
9556 :
9557 : /* "View.MemoryView":386
9558 : * cdef int i
9559 : * global __pyx_memoryview_thread_locks_used
9560 : * if self.lock != NULL: # <<<<<<<<<<<<<<
9561 : * for i in range(__pyx_memoryview_thread_locks_used):
9562 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9563 : */
9564 : }
9565 :
9566 : /* "View.MemoryView":376
9567 : * self.typeinfo = NULL
9568 : *
9569 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9570 : * if self.obj is not None:
9571 : * __Pyx_ReleaseBuffer(&self.view)
9572 : */
9573 :
9574 : /* function exit code */
9575 219 : }
9576 :
9577 : /* "View.MemoryView":397
9578 : * PyThread_free_lock(self.lock)
9579 : *
9580 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9581 : * cdef Py_ssize_t dim
9582 : * cdef char *itemp = <char *> self.view.buf
9583 : */
9584 :
9585 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9586 0 : Py_ssize_t __pyx_v_dim;
9587 0 : char *__pyx_v_itemp;
9588 0 : PyObject *__pyx_v_idx = NULL;
9589 0 : char *__pyx_r;
9590 : __Pyx_RefNannyDeclarations
9591 0 : Py_ssize_t __pyx_t_1;
9592 0 : PyObject *__pyx_t_2 = NULL;
9593 0 : Py_ssize_t __pyx_t_3;
9594 0 : PyObject *(*__pyx_t_4)(PyObject *);
9595 0 : PyObject *__pyx_t_5 = NULL;
9596 0 : Py_ssize_t __pyx_t_6;
9597 0 : char *__pyx_t_7;
9598 0 : int __pyx_lineno = 0;
9599 0 : const char *__pyx_filename = NULL;
9600 0 : int __pyx_clineno = 0;
9601 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
9602 :
9603 : /* "View.MemoryView":399
9604 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9605 : * cdef Py_ssize_t dim
9606 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
9607 : *
9608 : * for dim, idx in enumerate(index):
9609 : */
9610 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9611 :
9612 : /* "View.MemoryView":401
9613 : * cdef char *itemp = <char *> self.view.buf
9614 : *
9615 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9616 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9617 : *
9618 : */
9619 0 : __pyx_t_1 = 0;
9620 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9621 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
9622 0 : __pyx_t_3 = 0;
9623 0 : __pyx_t_4 = NULL;
9624 : } else {
9625 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
9626 0 : __Pyx_GOTREF(__pyx_t_2);
9627 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
9628 : }
9629 0 : for (;;) {
9630 0 : if (likely(!__pyx_t_4)) {
9631 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
9632 : {
9633 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
9634 : #if !CYTHON_ASSUME_SAFE_MACROS
9635 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9636 : #endif
9637 0 : if (__pyx_t_3 >= __pyx_temp) break;
9638 : }
9639 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9640 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9641 : #else
9642 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
9643 : __Pyx_GOTREF(__pyx_t_5);
9644 : #endif
9645 : } else {
9646 : {
9647 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
9648 : #if !CYTHON_ASSUME_SAFE_MACROS
9649 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9650 : #endif
9651 0 : if (__pyx_t_3 >= __pyx_temp) break;
9652 : }
9653 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9654 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9655 : #else
9656 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
9657 : __Pyx_GOTREF(__pyx_t_5);
9658 : #endif
9659 : }
9660 : } else {
9661 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9662 0 : if (unlikely(!__pyx_t_5)) {
9663 0 : PyObject* exc_type = PyErr_Occurred();
9664 0 : if (exc_type) {
9665 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9666 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
9667 : }
9668 : break;
9669 : }
9670 0 : __Pyx_GOTREF(__pyx_t_5);
9671 : }
9672 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9673 0 : __pyx_t_5 = 0;
9674 0 : __pyx_v_dim = __pyx_t_1;
9675 0 : __pyx_t_1 = (__pyx_t_1 + 1);
9676 :
9677 : /* "View.MemoryView":402
9678 : *
9679 : * for dim, idx in enumerate(index):
9680 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
9681 : *
9682 : * return itemp
9683 : */
9684 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
9685 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
9686 : __pyx_v_itemp = __pyx_t_7;
9687 :
9688 : /* "View.MemoryView":401
9689 : * cdef char *itemp = <char *> self.view.buf
9690 : *
9691 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9692 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9693 : *
9694 : */
9695 : }
9696 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9697 :
9698 : /* "View.MemoryView":404
9699 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9700 : *
9701 : * return itemp # <<<<<<<<<<<<<<
9702 : *
9703 : *
9704 : */
9705 0 : __pyx_r = __pyx_v_itemp;
9706 0 : goto __pyx_L0;
9707 :
9708 : /* "View.MemoryView":397
9709 : * PyThread_free_lock(self.lock)
9710 : *
9711 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9712 : * cdef Py_ssize_t dim
9713 : * cdef char *itemp = <char *> self.view.buf
9714 : */
9715 :
9716 : /* function exit code */
9717 0 : __pyx_L1_error:;
9718 0 : __Pyx_XDECREF(__pyx_t_2);
9719 0 : __Pyx_XDECREF(__pyx_t_5);
9720 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9721 0 : __pyx_r = NULL;
9722 0 : __pyx_L0:;
9723 0 : __Pyx_XDECREF(__pyx_v_idx);
9724 0 : __Pyx_RefNannyFinishContext();
9725 0 : return __pyx_r;
9726 : }
9727 :
9728 : /* "View.MemoryView":407
9729 : *
9730 : *
9731 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9732 : * if index is Ellipsis:
9733 : * return self
9734 : */
9735 :
9736 : /* Python wrapper */
9737 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9738 0 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9739 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9740 0 : PyObject *__pyx_r = 0;
9741 : __Pyx_RefNannyDeclarations
9742 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9743 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9744 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9745 :
9746 : /* function exit code */
9747 0 : __Pyx_RefNannyFinishContext();
9748 0 : return __pyx_r;
9749 : }
9750 :
9751 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9752 0 : PyObject *__pyx_v_have_slices = NULL;
9753 0 : PyObject *__pyx_v_indices = NULL;
9754 0 : char *__pyx_v_itemp;
9755 0 : PyObject *__pyx_r = NULL;
9756 : __Pyx_RefNannyDeclarations
9757 0 : int __pyx_t_1;
9758 0 : PyObject *__pyx_t_2 = NULL;
9759 0 : PyObject *__pyx_t_3 = NULL;
9760 0 : PyObject *__pyx_t_4 = NULL;
9761 0 : char *__pyx_t_5;
9762 0 : int __pyx_lineno = 0;
9763 0 : const char *__pyx_filename = NULL;
9764 0 : int __pyx_clineno = 0;
9765 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
9766 :
9767 : /* "View.MemoryView":408
9768 : *
9769 : * def __getitem__(memoryview self, object index):
9770 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9771 : * return self
9772 : *
9773 : */
9774 0 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9775 0 : if (__pyx_t_1) {
9776 :
9777 : /* "View.MemoryView":409
9778 : * def __getitem__(memoryview self, object index):
9779 : * if index is Ellipsis:
9780 : * return self # <<<<<<<<<<<<<<
9781 : *
9782 : * have_slices, indices = _unellipsify(index, self.view.ndim)
9783 : */
9784 0 : __Pyx_XDECREF(__pyx_r);
9785 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
9786 0 : __pyx_r = ((PyObject *)__pyx_v_self);
9787 0 : goto __pyx_L0;
9788 :
9789 : /* "View.MemoryView":408
9790 : *
9791 : * def __getitem__(memoryview self, object index):
9792 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9793 : * return self
9794 : *
9795 : */
9796 : }
9797 :
9798 : /* "View.MemoryView":411
9799 : * return self
9800 : *
9801 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9802 : *
9803 : * cdef char *itemp
9804 : */
9805 0 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
9806 0 : __Pyx_GOTREF(__pyx_t_2);
9807 0 : if (likely(__pyx_t_2 != Py_None)) {
9808 0 : PyObject* sequence = __pyx_t_2;
9809 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9810 0 : if (unlikely(size != 2)) {
9811 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9812 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9813 0 : __PYX_ERR(1, 411, __pyx_L1_error)
9814 : }
9815 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9816 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9817 0 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9818 0 : __Pyx_INCREF(__pyx_t_3);
9819 0 : __Pyx_INCREF(__pyx_t_4);
9820 : #else
9821 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
9822 : __Pyx_GOTREF(__pyx_t_3);
9823 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
9824 : __Pyx_GOTREF(__pyx_t_4);
9825 : #endif
9826 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9827 : } else {
9828 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
9829 : }
9830 0 : __pyx_v_have_slices = __pyx_t_3;
9831 0 : __pyx_t_3 = 0;
9832 0 : __pyx_v_indices = __pyx_t_4;
9833 0 : __pyx_t_4 = 0;
9834 :
9835 : /* "View.MemoryView":414
9836 : *
9837 : * cdef char *itemp
9838 : * if have_slices: # <<<<<<<<<<<<<<
9839 : * return memview_slice(self, indices)
9840 : * else:
9841 : */
9842 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
9843 0 : if (__pyx_t_1) {
9844 :
9845 : /* "View.MemoryView":415
9846 : * cdef char *itemp
9847 : * if have_slices:
9848 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9849 : * else:
9850 : * itemp = self.get_item_pointer(indices)
9851 : */
9852 0 : __Pyx_XDECREF(__pyx_r);
9853 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
9854 0 : __Pyx_GOTREF(__pyx_t_2);
9855 0 : __pyx_r = __pyx_t_2;
9856 0 : __pyx_t_2 = 0;
9857 0 : goto __pyx_L0;
9858 :
9859 : /* "View.MemoryView":414
9860 : *
9861 : * cdef char *itemp
9862 : * if have_slices: # <<<<<<<<<<<<<<
9863 : * return memview_slice(self, indices)
9864 : * else:
9865 : */
9866 : }
9867 :
9868 : /* "View.MemoryView":417
9869 : * return memview_slice(self, indices)
9870 : * else:
9871 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9872 : * return self.convert_item_to_object(itemp)
9873 : *
9874 : */
9875 : /*else*/ {
9876 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
9877 0 : __pyx_v_itemp = __pyx_t_5;
9878 :
9879 : /* "View.MemoryView":418
9880 : * else:
9881 : * itemp = self.get_item_pointer(indices)
9882 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9883 : *
9884 : * def __setitem__(memoryview self, object index, object value):
9885 : */
9886 0 : __Pyx_XDECREF(__pyx_r);
9887 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
9888 0 : __Pyx_GOTREF(__pyx_t_2);
9889 0 : __pyx_r = __pyx_t_2;
9890 0 : __pyx_t_2 = 0;
9891 0 : goto __pyx_L0;
9892 : }
9893 :
9894 : /* "View.MemoryView":407
9895 : *
9896 : *
9897 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9898 : * if index is Ellipsis:
9899 : * return self
9900 : */
9901 :
9902 : /* function exit code */
9903 0 : __pyx_L1_error:;
9904 0 : __Pyx_XDECREF(__pyx_t_2);
9905 0 : __Pyx_XDECREF(__pyx_t_3);
9906 0 : __Pyx_XDECREF(__pyx_t_4);
9907 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9908 0 : __pyx_r = NULL;
9909 0 : __pyx_L0:;
9910 0 : __Pyx_XDECREF(__pyx_v_have_slices);
9911 0 : __Pyx_XDECREF(__pyx_v_indices);
9912 0 : __Pyx_XGIVEREF(__pyx_r);
9913 0 : __Pyx_RefNannyFinishContext();
9914 0 : return __pyx_r;
9915 : }
9916 :
9917 : /* "View.MemoryView":420
9918 : * return self.convert_item_to_object(itemp)
9919 : *
9920 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9921 : * if self.view.readonly:
9922 : * raise TypeError, "Cannot assign to read-only memoryview"
9923 : */
9924 :
9925 : /* Python wrapper */
9926 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9927 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9928 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9929 0 : int __pyx_r;
9930 : __Pyx_RefNannyDeclarations
9931 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9932 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9933 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9934 :
9935 : /* function exit code */
9936 0 : __Pyx_RefNannyFinishContext();
9937 0 : return __pyx_r;
9938 : }
9939 :
9940 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9941 0 : PyObject *__pyx_v_have_slices = NULL;
9942 0 : PyObject *__pyx_v_obj = NULL;
9943 0 : int __pyx_r;
9944 : __Pyx_RefNannyDeclarations
9945 0 : PyObject *__pyx_t_1 = NULL;
9946 0 : PyObject *__pyx_t_2 = NULL;
9947 0 : PyObject *__pyx_t_3 = NULL;
9948 0 : int __pyx_t_4;
9949 0 : int __pyx_lineno = 0;
9950 0 : const char *__pyx_filename = NULL;
9951 0 : int __pyx_clineno = 0;
9952 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
9953 0 : __Pyx_INCREF(__pyx_v_index);
9954 :
9955 : /* "View.MemoryView":421
9956 : *
9957 : * def __setitem__(memoryview self, object index, object value):
9958 : * if self.view.readonly: # <<<<<<<<<<<<<<
9959 : * raise TypeError, "Cannot assign to read-only memoryview"
9960 : *
9961 : */
9962 0 : if (unlikely(__pyx_v_self->view.readonly)) {
9963 :
9964 : /* "View.MemoryView":422
9965 : * def __setitem__(memoryview self, object index, object value):
9966 : * if self.view.readonly:
9967 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
9968 : *
9969 : * have_slices, index = _unellipsify(index, self.view.ndim)
9970 : */
9971 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
9972 0 : __PYX_ERR(1, 422, __pyx_L1_error)
9973 :
9974 : /* "View.MemoryView":421
9975 : *
9976 : * def __setitem__(memoryview self, object index, object value):
9977 : * if self.view.readonly: # <<<<<<<<<<<<<<
9978 : * raise TypeError, "Cannot assign to read-only memoryview"
9979 : *
9980 : */
9981 : }
9982 :
9983 : /* "View.MemoryView":424
9984 : * raise TypeError, "Cannot assign to read-only memoryview"
9985 : *
9986 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9987 : *
9988 : * if have_slices:
9989 : */
9990 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
9991 0 : __Pyx_GOTREF(__pyx_t_1);
9992 0 : if (likely(__pyx_t_1 != Py_None)) {
9993 0 : PyObject* sequence = __pyx_t_1;
9994 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9995 0 : if (unlikely(size != 2)) {
9996 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9997 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9998 0 : __PYX_ERR(1, 424, __pyx_L1_error)
9999 : }
10000 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10001 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
10002 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
10003 0 : __Pyx_INCREF(__pyx_t_2);
10004 0 : __Pyx_INCREF(__pyx_t_3);
10005 : #else
10006 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
10007 : __Pyx_GOTREF(__pyx_t_2);
10008 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
10009 : __Pyx_GOTREF(__pyx_t_3);
10010 : #endif
10011 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10012 : } else {
10013 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
10014 : }
10015 0 : __pyx_v_have_slices = __pyx_t_2;
10016 0 : __pyx_t_2 = 0;
10017 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
10018 0 : __pyx_t_3 = 0;
10019 :
10020 : /* "View.MemoryView":426
10021 : * have_slices, index = _unellipsify(index, self.view.ndim)
10022 : *
10023 : * if have_slices: # <<<<<<<<<<<<<<
10024 : * obj = self.is_slice(value)
10025 : * if obj is not None:
10026 : */
10027 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
10028 0 : if (__pyx_t_4) {
10029 :
10030 : /* "View.MemoryView":427
10031 : *
10032 : * if have_slices:
10033 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10034 : * if obj is not None:
10035 : * self.setitem_slice_assignment(self[index], obj)
10036 : */
10037 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
10038 0 : __Pyx_GOTREF(__pyx_t_1);
10039 0 : __pyx_v_obj = __pyx_t_1;
10040 0 : __pyx_t_1 = 0;
10041 :
10042 : /* "View.MemoryView":428
10043 : * if have_slices:
10044 : * obj = self.is_slice(value)
10045 : * if obj is not None: # <<<<<<<<<<<<<<
10046 : * self.setitem_slice_assignment(self[index], obj)
10047 : * else:
10048 : */
10049 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
10050 0 : if (__pyx_t_4) {
10051 :
10052 : /* "View.MemoryView":429
10053 : * obj = self.is_slice(value)
10054 : * if obj is not None:
10055 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10056 : * else:
10057 : * self.setitem_slice_assign_scalar(self[index], value)
10058 : */
10059 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
10060 0 : __Pyx_GOTREF(__pyx_t_1);
10061 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
10062 0 : __Pyx_GOTREF(__pyx_t_3);
10063 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10064 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10065 :
10066 : /* "View.MemoryView":428
10067 : * if have_slices:
10068 : * obj = self.is_slice(value)
10069 : * if obj is not None: # <<<<<<<<<<<<<<
10070 : * self.setitem_slice_assignment(self[index], obj)
10071 : * else:
10072 : */
10073 0 : goto __pyx_L5;
10074 : }
10075 :
10076 : /* "View.MemoryView":431
10077 : * self.setitem_slice_assignment(self[index], obj)
10078 : * else:
10079 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10080 : * else:
10081 : * self.setitem_indexed(index, value)
10082 : */
10083 : /*else*/ {
10084 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
10085 0 : __Pyx_GOTREF(__pyx_t_3);
10086 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
10087 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
10088 0 : __Pyx_GOTREF(__pyx_t_1);
10089 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10090 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10091 : }
10092 0 : __pyx_L5:;
10093 :
10094 : /* "View.MemoryView":426
10095 : * have_slices, index = _unellipsify(index, self.view.ndim)
10096 : *
10097 : * if have_slices: # <<<<<<<<<<<<<<
10098 : * obj = self.is_slice(value)
10099 : * if obj is not None:
10100 : */
10101 0 : goto __pyx_L4;
10102 : }
10103 :
10104 : /* "View.MemoryView":433
10105 : * self.setitem_slice_assign_scalar(self[index], value)
10106 : * else:
10107 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10108 : *
10109 : * cdef is_slice(self, obj):
10110 : */
10111 : /*else*/ {
10112 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
10113 0 : __Pyx_GOTREF(__pyx_t_1);
10114 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10115 : }
10116 0 : __pyx_L4:;
10117 :
10118 : /* "View.MemoryView":420
10119 : * return self.convert_item_to_object(itemp)
10120 : *
10121 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10122 : * if self.view.readonly:
10123 : * raise TypeError, "Cannot assign to read-only memoryview"
10124 : */
10125 :
10126 : /* function exit code */
10127 0 : __pyx_r = 0;
10128 0 : goto __pyx_L0;
10129 0 : __pyx_L1_error:;
10130 0 : __Pyx_XDECREF(__pyx_t_1);
10131 0 : __Pyx_XDECREF(__pyx_t_2);
10132 0 : __Pyx_XDECREF(__pyx_t_3);
10133 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10134 0 : __pyx_r = -1;
10135 0 : __pyx_L0:;
10136 0 : __Pyx_XDECREF(__pyx_v_have_slices);
10137 0 : __Pyx_XDECREF(__pyx_v_obj);
10138 0 : __Pyx_XDECREF(__pyx_v_index);
10139 0 : __Pyx_RefNannyFinishContext();
10140 0 : return __pyx_r;
10141 : }
10142 :
10143 : /* "View.MemoryView":435
10144 : * self.setitem_indexed(index, value)
10145 : *
10146 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10147 : * if not isinstance(obj, memoryview):
10148 : * try:
10149 : */
10150 :
10151 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10152 0 : PyObject *__pyx_r = NULL;
10153 : __Pyx_RefNannyDeclarations
10154 0 : int __pyx_t_1;
10155 0 : int __pyx_t_2;
10156 0 : PyObject *__pyx_t_3 = NULL;
10157 0 : PyObject *__pyx_t_4 = NULL;
10158 0 : PyObject *__pyx_t_5 = NULL;
10159 0 : PyObject *__pyx_t_6 = NULL;
10160 0 : PyObject *__pyx_t_7 = NULL;
10161 0 : PyObject *__pyx_t_8 = NULL;
10162 0 : int __pyx_t_9;
10163 0 : int __pyx_lineno = 0;
10164 0 : const char *__pyx_filename = NULL;
10165 0 : int __pyx_clineno = 0;
10166 0 : __Pyx_RefNannySetupContext("is_slice", 0);
10167 0 : __Pyx_INCREF(__pyx_v_obj);
10168 :
10169 : /* "View.MemoryView":436
10170 : *
10171 : * cdef is_slice(self, obj):
10172 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10173 : * try:
10174 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10175 : */
10176 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10177 0 : __pyx_t_2 = (!__pyx_t_1);
10178 0 : if (__pyx_t_2) {
10179 :
10180 : /* "View.MemoryView":437
10181 : * cdef is_slice(self, obj):
10182 : * if not isinstance(obj, memoryview):
10183 : * try: # <<<<<<<<<<<<<<
10184 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10185 : * self.dtype_is_object)
10186 : */
10187 : {
10188 0 : __Pyx_PyThreadState_declare
10189 0 : __Pyx_PyThreadState_assign
10190 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10191 0 : __Pyx_XGOTREF(__pyx_t_3);
10192 0 : __Pyx_XGOTREF(__pyx_t_4);
10193 0 : __Pyx_XGOTREF(__pyx_t_5);
10194 : /*try:*/ {
10195 :
10196 : /* "View.MemoryView":438
10197 : * if not isinstance(obj, memoryview):
10198 : * try:
10199 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10200 : * self.dtype_is_object)
10201 : * except TypeError:
10202 : */
10203 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
10204 0 : __Pyx_GOTREF(__pyx_t_6);
10205 :
10206 : /* "View.MemoryView":439
10207 : * try:
10208 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10209 : * self.dtype_is_object) # <<<<<<<<<<<<<<
10210 : * except TypeError:
10211 : * return None
10212 : */
10213 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
10214 0 : __Pyx_GOTREF(__pyx_t_7);
10215 :
10216 : /* "View.MemoryView":438
10217 : * if not isinstance(obj, memoryview):
10218 : * try:
10219 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10220 : * self.dtype_is_object)
10221 : * except TypeError:
10222 : */
10223 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
10224 0 : __Pyx_GOTREF(__pyx_t_8);
10225 0 : __Pyx_INCREF(__pyx_v_obj);
10226 0 : __Pyx_GIVEREF(__pyx_v_obj);
10227 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
10228 0 : __Pyx_GIVEREF(__pyx_t_6);
10229 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
10230 0 : __Pyx_GIVEREF(__pyx_t_7);
10231 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
10232 0 : __pyx_t_6 = 0;
10233 0 : __pyx_t_7 = 0;
10234 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
10235 0 : __Pyx_GOTREF(__pyx_t_7);
10236 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10237 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10238 0 : __pyx_t_7 = 0;
10239 :
10240 : /* "View.MemoryView":437
10241 : * cdef is_slice(self, obj):
10242 : * if not isinstance(obj, memoryview):
10243 : * try: # <<<<<<<<<<<<<<
10244 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10245 : * self.dtype_is_object)
10246 : */
10247 : }
10248 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10249 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10250 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10251 0 : goto __pyx_L9_try_end;
10252 0 : __pyx_L4_error:;
10253 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10254 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10255 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10256 :
10257 : /* "View.MemoryView":440
10258 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10259 : * self.dtype_is_object)
10260 : * except TypeError: # <<<<<<<<<<<<<<
10261 : * return None
10262 : *
10263 : */
10264 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10265 0 : if (__pyx_t_9) {
10266 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10267 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
10268 0 : __Pyx_XGOTREF(__pyx_t_7);
10269 0 : __Pyx_XGOTREF(__pyx_t_8);
10270 0 : __Pyx_XGOTREF(__pyx_t_6);
10271 :
10272 : /* "View.MemoryView":441
10273 : * self.dtype_is_object)
10274 : * except TypeError:
10275 : * return None # <<<<<<<<<<<<<<
10276 : *
10277 : * return obj
10278 : */
10279 0 : __Pyx_XDECREF(__pyx_r);
10280 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10281 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10282 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10283 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10284 0 : goto __pyx_L7_except_return;
10285 : }
10286 0 : goto __pyx_L6_except_error;
10287 :
10288 : /* "View.MemoryView":437
10289 : * cdef is_slice(self, obj):
10290 : * if not isinstance(obj, memoryview):
10291 : * try: # <<<<<<<<<<<<<<
10292 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10293 : * self.dtype_is_object)
10294 : */
10295 0 : __pyx_L6_except_error:;
10296 0 : __Pyx_XGIVEREF(__pyx_t_3);
10297 0 : __Pyx_XGIVEREF(__pyx_t_4);
10298 0 : __Pyx_XGIVEREF(__pyx_t_5);
10299 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10300 0 : goto __pyx_L1_error;
10301 0 : __pyx_L7_except_return:;
10302 0 : __Pyx_XGIVEREF(__pyx_t_3);
10303 0 : __Pyx_XGIVEREF(__pyx_t_4);
10304 0 : __Pyx_XGIVEREF(__pyx_t_5);
10305 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10306 0 : goto __pyx_L0;
10307 0 : __pyx_L9_try_end:;
10308 : }
10309 :
10310 : /* "View.MemoryView":436
10311 : *
10312 : * cdef is_slice(self, obj):
10313 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10314 : * try:
10315 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10316 : */
10317 : }
10318 :
10319 : /* "View.MemoryView":443
10320 : * return None
10321 : *
10322 : * return obj # <<<<<<<<<<<<<<
10323 : *
10324 : * cdef setitem_slice_assignment(self, dst, src):
10325 : */
10326 0 : __Pyx_XDECREF(__pyx_r);
10327 0 : __Pyx_INCREF(__pyx_v_obj);
10328 0 : __pyx_r = __pyx_v_obj;
10329 0 : goto __pyx_L0;
10330 :
10331 : /* "View.MemoryView":435
10332 : * self.setitem_indexed(index, value)
10333 : *
10334 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10335 : * if not isinstance(obj, memoryview):
10336 : * try:
10337 : */
10338 :
10339 : /* function exit code */
10340 0 : __pyx_L1_error:;
10341 0 : __Pyx_XDECREF(__pyx_t_6);
10342 0 : __Pyx_XDECREF(__pyx_t_7);
10343 0 : __Pyx_XDECREF(__pyx_t_8);
10344 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10345 0 : __pyx_r = 0;
10346 0 : __pyx_L0:;
10347 0 : __Pyx_XDECREF(__pyx_v_obj);
10348 0 : __Pyx_XGIVEREF(__pyx_r);
10349 0 : __Pyx_RefNannyFinishContext();
10350 0 : return __pyx_r;
10351 : }
10352 :
10353 : /* "View.MemoryView":445
10354 : * return obj
10355 : *
10356 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10357 : * cdef __Pyx_memviewslice dst_slice
10358 : * cdef __Pyx_memviewslice src_slice
10359 : */
10360 :
10361 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10362 0 : __Pyx_memviewslice __pyx_v_dst_slice;
10363 0 : __Pyx_memviewslice __pyx_v_src_slice;
10364 0 : __Pyx_memviewslice __pyx_v_msrc;
10365 0 : __Pyx_memviewslice __pyx_v_mdst;
10366 0 : PyObject *__pyx_r = NULL;
10367 : __Pyx_RefNannyDeclarations
10368 0 : __Pyx_memviewslice *__pyx_t_1;
10369 0 : PyObject *__pyx_t_2 = NULL;
10370 0 : int __pyx_t_3;
10371 0 : int __pyx_t_4;
10372 0 : int __pyx_t_5;
10373 0 : int __pyx_lineno = 0;
10374 0 : const char *__pyx_filename = NULL;
10375 0 : int __pyx_clineno = 0;
10376 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
10377 :
10378 : /* "View.MemoryView":448
10379 : * cdef __Pyx_memviewslice dst_slice
10380 : * cdef __Pyx_memviewslice src_slice
10381 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
10382 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
10383 : *
10384 : */
10385 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
10386 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
10387 0 : __pyx_v_msrc = (__pyx_t_1[0]);
10388 :
10389 : /* "View.MemoryView":449
10390 : * cdef __Pyx_memviewslice src_slice
10391 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
10392 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
10393 : *
10394 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
10395 : */
10396 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
10397 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
10398 0 : __pyx_v_mdst = (__pyx_t_1[0]);
10399 :
10400 : /* "View.MemoryView":451
10401 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
10402 : *
10403 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10404 : *
10405 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10406 : */
10407 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
10408 0 : __Pyx_GOTREF(__pyx_t_2);
10409 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
10410 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10411 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
10412 0 : __Pyx_GOTREF(__pyx_t_2);
10413 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
10414 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10415 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
10416 :
10417 : /* "View.MemoryView":445
10418 : * return obj
10419 : *
10420 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10421 : * cdef __Pyx_memviewslice dst_slice
10422 : * cdef __Pyx_memviewslice src_slice
10423 : */
10424 :
10425 : /* function exit code */
10426 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10427 0 : goto __pyx_L0;
10428 0 : __pyx_L1_error:;
10429 0 : __Pyx_XDECREF(__pyx_t_2);
10430 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10431 0 : __pyx_r = 0;
10432 0 : __pyx_L0:;
10433 0 : __Pyx_XGIVEREF(__pyx_r);
10434 0 : __Pyx_RefNannyFinishContext();
10435 0 : return __pyx_r;
10436 : }
10437 :
10438 : /* "View.MemoryView":453
10439 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
10440 : *
10441 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10442 : * cdef int array[128]
10443 : * cdef void *tmp = NULL
10444 : */
10445 :
10446 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10447 0 : int __pyx_v_array[0x80];
10448 0 : void *__pyx_v_tmp;
10449 0 : void *__pyx_v_item;
10450 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
10451 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
10452 0 : PyObject *__pyx_r = NULL;
10453 : __Pyx_RefNannyDeclarations
10454 0 : __Pyx_memviewslice *__pyx_t_1;
10455 0 : int __pyx_t_2;
10456 0 : PyObject *__pyx_t_3 = NULL;
10457 0 : int __pyx_t_4;
10458 0 : int __pyx_t_5;
10459 0 : char const *__pyx_t_6;
10460 0 : PyObject *__pyx_t_7 = NULL;
10461 0 : PyObject *__pyx_t_8 = NULL;
10462 0 : PyObject *__pyx_t_9 = NULL;
10463 0 : PyObject *__pyx_t_10 = NULL;
10464 0 : PyObject *__pyx_t_11 = NULL;
10465 0 : PyObject *__pyx_t_12 = NULL;
10466 0 : int __pyx_lineno = 0;
10467 0 : const char *__pyx_filename = NULL;
10468 0 : int __pyx_clineno = 0;
10469 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
10470 :
10471 : /* "View.MemoryView":455
10472 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10473 : * cdef int array[128]
10474 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10475 : * cdef void *item
10476 : *
10477 : */
10478 0 : __pyx_v_tmp = NULL;
10479 :
10480 : /* "View.MemoryView":460
10481 : * cdef __Pyx_memviewslice *dst_slice
10482 : * cdef __Pyx_memviewslice tmp_slice
10483 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10484 : *
10485 : * if <size_t>self.view.itemsize > sizeof(array):
10486 : */
10487 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
10488 0 : __pyx_v_dst_slice = __pyx_t_1;
10489 :
10490 : /* "View.MemoryView":462
10491 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10492 : *
10493 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10494 : * tmp = PyMem_Malloc(self.view.itemsize)
10495 : * if tmp == NULL:
10496 : */
10497 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
10498 0 : if (__pyx_t_2) {
10499 :
10500 : /* "View.MemoryView":463
10501 : *
10502 : * if <size_t>self.view.itemsize > sizeof(array):
10503 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
10504 : * if tmp == NULL:
10505 : * raise MemoryError
10506 : */
10507 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10508 :
10509 : /* "View.MemoryView":464
10510 : * if <size_t>self.view.itemsize > sizeof(array):
10511 : * tmp = PyMem_Malloc(self.view.itemsize)
10512 : * if tmp == NULL: # <<<<<<<<<<<<<<
10513 : * raise MemoryError
10514 : * item = tmp
10515 : */
10516 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
10517 0 : if (unlikely(__pyx_t_2)) {
10518 :
10519 : /* "View.MemoryView":465
10520 : * tmp = PyMem_Malloc(self.view.itemsize)
10521 : * if tmp == NULL:
10522 : * raise MemoryError # <<<<<<<<<<<<<<
10523 : * item = tmp
10524 : * else:
10525 : */
10526 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
10527 :
10528 : /* "View.MemoryView":464
10529 : * if <size_t>self.view.itemsize > sizeof(array):
10530 : * tmp = PyMem_Malloc(self.view.itemsize)
10531 : * if tmp == NULL: # <<<<<<<<<<<<<<
10532 : * raise MemoryError
10533 : * item = tmp
10534 : */
10535 : }
10536 :
10537 : /* "View.MemoryView":466
10538 : * if tmp == NULL:
10539 : * raise MemoryError
10540 : * item = tmp # <<<<<<<<<<<<<<
10541 : * else:
10542 : * item = <void *> array
10543 : */
10544 0 : __pyx_v_item = __pyx_v_tmp;
10545 :
10546 : /* "View.MemoryView":462
10547 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10548 : *
10549 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10550 : * tmp = PyMem_Malloc(self.view.itemsize)
10551 : * if tmp == NULL:
10552 : */
10553 0 : goto __pyx_L3;
10554 : }
10555 :
10556 : /* "View.MemoryView":468
10557 : * item = tmp
10558 : * else:
10559 : * item = <void *> array # <<<<<<<<<<<<<<
10560 : *
10561 : * try:
10562 : */
10563 : /*else*/ {
10564 : __pyx_v_item = ((void *)__pyx_v_array);
10565 : }
10566 0 : __pyx_L3:;
10567 :
10568 : /* "View.MemoryView":470
10569 : * item = <void *> array
10570 : *
10571 : * try: # <<<<<<<<<<<<<<
10572 : * if self.dtype_is_object:
10573 : * (<PyObject **> item)[0] = <PyObject *> value
10574 : */
10575 : /*try:*/ {
10576 :
10577 : /* "View.MemoryView":471
10578 : *
10579 : * try:
10580 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
10581 : * (<PyObject **> item)[0] = <PyObject *> value
10582 : * else:
10583 : */
10584 0 : if (__pyx_v_self->dtype_is_object) {
10585 :
10586 : /* "View.MemoryView":472
10587 : * try:
10588 : * if self.dtype_is_object:
10589 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
10590 : * else:
10591 : * self.assign_item_from_object(<char *> item, value)
10592 : */
10593 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10594 :
10595 : /* "View.MemoryView":471
10596 : *
10597 : * try:
10598 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
10599 : * (<PyObject **> item)[0] = <PyObject *> value
10600 : * else:
10601 : */
10602 0 : goto __pyx_L8;
10603 : }
10604 :
10605 : /* "View.MemoryView":474
10606 : * (<PyObject **> item)[0] = <PyObject *> value
10607 : * else:
10608 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
10609 : *
10610 : *
10611 : */
10612 : /*else*/ {
10613 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
10614 0 : __Pyx_GOTREF(__pyx_t_3);
10615 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10616 : }
10617 0 : __pyx_L8:;
10618 :
10619 : /* "View.MemoryView":478
10620 : *
10621 : *
10622 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10623 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10624 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10625 : */
10626 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
10627 0 : if (__pyx_t_2) {
10628 :
10629 : /* "View.MemoryView":479
10630 : *
10631 : * if self.view.suboffsets != NULL:
10632 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
10633 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10634 : * item, self.dtype_is_object)
10635 : */
10636 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
10637 :
10638 : /* "View.MemoryView":478
10639 : *
10640 : *
10641 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10642 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10643 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10644 : */
10645 : }
10646 :
10647 : /* "View.MemoryView":480
10648 : * if self.view.suboffsets != NULL:
10649 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10650 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
10651 : * item, self.dtype_is_object)
10652 : * finally:
10653 : */
10654 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10655 : }
10656 :
10657 : /* "View.MemoryView":483
10658 : * item, self.dtype_is_object)
10659 : * finally:
10660 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
10661 : *
10662 : * cdef setitem_indexed(self, index, value):
10663 : */
10664 : /*finally:*/ {
10665 : /*normal exit:*/{
10666 0 : PyMem_Free(__pyx_v_tmp);
10667 0 : goto __pyx_L7;
10668 : }
10669 0 : __pyx_L6_error:;
10670 : /*exception exit:*/{
10671 0 : __Pyx_PyThreadState_declare
10672 0 : __Pyx_PyThreadState_assign
10673 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10674 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10675 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10676 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10677 0 : __Pyx_XGOTREF(__pyx_t_7);
10678 0 : __Pyx_XGOTREF(__pyx_t_8);
10679 0 : __Pyx_XGOTREF(__pyx_t_9);
10680 0 : __Pyx_XGOTREF(__pyx_t_10);
10681 0 : __Pyx_XGOTREF(__pyx_t_11);
10682 0 : __Pyx_XGOTREF(__pyx_t_12);
10683 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10684 : {
10685 0 : PyMem_Free(__pyx_v_tmp);
10686 : }
10687 0 : if (PY_MAJOR_VERSION >= 3) {
10688 0 : __Pyx_XGIVEREF(__pyx_t_10);
10689 0 : __Pyx_XGIVEREF(__pyx_t_11);
10690 0 : __Pyx_XGIVEREF(__pyx_t_12);
10691 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10692 : }
10693 0 : __Pyx_XGIVEREF(__pyx_t_7);
10694 0 : __Pyx_XGIVEREF(__pyx_t_8);
10695 0 : __Pyx_XGIVEREF(__pyx_t_9);
10696 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10697 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10698 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10699 0 : goto __pyx_L1_error;
10700 : }
10701 0 : __pyx_L7:;
10702 : }
10703 :
10704 : /* "View.MemoryView":453
10705 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
10706 : *
10707 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10708 : * cdef int array[128]
10709 : * cdef void *tmp = NULL
10710 : */
10711 :
10712 : /* function exit code */
10713 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10714 0 : goto __pyx_L0;
10715 0 : __pyx_L1_error:;
10716 0 : __Pyx_XDECREF(__pyx_t_3);
10717 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10718 0 : __pyx_r = 0;
10719 0 : __pyx_L0:;
10720 0 : __Pyx_XGIVEREF(__pyx_r);
10721 0 : __Pyx_RefNannyFinishContext();
10722 0 : return __pyx_r;
10723 : }
10724 :
10725 : /* "View.MemoryView":485
10726 : * PyMem_Free(tmp)
10727 : *
10728 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10729 : * cdef char *itemp = self.get_item_pointer(index)
10730 : * self.assign_item_from_object(itemp, value)
10731 : */
10732 :
10733 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10734 0 : char *__pyx_v_itemp;
10735 0 : PyObject *__pyx_r = NULL;
10736 : __Pyx_RefNannyDeclarations
10737 0 : char *__pyx_t_1;
10738 0 : PyObject *__pyx_t_2 = NULL;
10739 0 : int __pyx_lineno = 0;
10740 0 : const char *__pyx_filename = NULL;
10741 0 : int __pyx_clineno = 0;
10742 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
10743 :
10744 : /* "View.MemoryView":486
10745 : *
10746 : * cdef setitem_indexed(self, index, value):
10747 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10748 : * self.assign_item_from_object(itemp, value)
10749 : *
10750 : */
10751 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
10752 0 : __pyx_v_itemp = __pyx_t_1;
10753 :
10754 : /* "View.MemoryView":487
10755 : * cdef setitem_indexed(self, index, value):
10756 : * cdef char *itemp = self.get_item_pointer(index)
10757 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10758 : *
10759 : * cdef convert_item_to_object(self, char *itemp):
10760 : */
10761 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
10762 0 : __Pyx_GOTREF(__pyx_t_2);
10763 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10764 :
10765 : /* "View.MemoryView":485
10766 : * PyMem_Free(tmp)
10767 : *
10768 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10769 : * cdef char *itemp = self.get_item_pointer(index)
10770 : * self.assign_item_from_object(itemp, value)
10771 : */
10772 :
10773 : /* function exit code */
10774 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10775 0 : goto __pyx_L0;
10776 0 : __pyx_L1_error:;
10777 0 : __Pyx_XDECREF(__pyx_t_2);
10778 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10779 0 : __pyx_r = 0;
10780 0 : __pyx_L0:;
10781 0 : __Pyx_XGIVEREF(__pyx_r);
10782 0 : __Pyx_RefNannyFinishContext();
10783 0 : return __pyx_r;
10784 : }
10785 :
10786 : /* "View.MemoryView":489
10787 : * self.assign_item_from_object(itemp, value)
10788 : *
10789 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10790 : * """Only used if instantiated manually by the user, or if Cython doesn't
10791 : * know how to convert the type"""
10792 : */
10793 :
10794 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10795 0 : PyObject *__pyx_v_struct = NULL;
10796 0 : PyObject *__pyx_v_bytesitem = 0;
10797 0 : PyObject *__pyx_v_result = NULL;
10798 0 : PyObject *__pyx_r = NULL;
10799 : __Pyx_RefNannyDeclarations
10800 0 : PyObject *__pyx_t_1 = NULL;
10801 0 : PyObject *__pyx_t_2 = NULL;
10802 0 : PyObject *__pyx_t_3 = NULL;
10803 0 : PyObject *__pyx_t_4 = NULL;
10804 0 : PyObject *__pyx_t_5 = NULL;
10805 0 : PyObject *__pyx_t_6 = NULL;
10806 0 : PyObject *__pyx_t_7 = NULL;
10807 0 : unsigned int __pyx_t_8;
10808 0 : Py_ssize_t __pyx_t_9;
10809 0 : int __pyx_t_10;
10810 0 : int __pyx_t_11;
10811 0 : int __pyx_lineno = 0;
10812 0 : const char *__pyx_filename = NULL;
10813 0 : int __pyx_clineno = 0;
10814 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
10815 :
10816 : /* "View.MemoryView":492
10817 : * """Only used if instantiated manually by the user, or if Cython doesn't
10818 : * know how to convert the type"""
10819 : * import struct # <<<<<<<<<<<<<<
10820 : * cdef bytes bytesitem
10821 : *
10822 : */
10823 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
10824 0 : __Pyx_GOTREF(__pyx_t_1);
10825 0 : __pyx_v_struct = __pyx_t_1;
10826 0 : __pyx_t_1 = 0;
10827 :
10828 : /* "View.MemoryView":495
10829 : * cdef bytes bytesitem
10830 : *
10831 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10832 : * try:
10833 : * result = struct.unpack(self.view.format, bytesitem)
10834 : */
10835 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
10836 0 : __Pyx_GOTREF(__pyx_t_1);
10837 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10838 0 : __pyx_t_1 = 0;
10839 :
10840 : /* "View.MemoryView":496
10841 : *
10842 : * bytesitem = itemp[:self.view.itemsize]
10843 : * try: # <<<<<<<<<<<<<<
10844 : * result = struct.unpack(self.view.format, bytesitem)
10845 : * except struct.error:
10846 : */
10847 : {
10848 0 : __Pyx_PyThreadState_declare
10849 0 : __Pyx_PyThreadState_assign
10850 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10851 0 : __Pyx_XGOTREF(__pyx_t_2);
10852 0 : __Pyx_XGOTREF(__pyx_t_3);
10853 0 : __Pyx_XGOTREF(__pyx_t_4);
10854 : /*try:*/ {
10855 :
10856 : /* "View.MemoryView":497
10857 : * bytesitem = itemp[:self.view.itemsize]
10858 : * try:
10859 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10860 : * except struct.error:
10861 : * raise ValueError, "Unable to convert item to object"
10862 : */
10863 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
10864 0 : __Pyx_GOTREF(__pyx_t_5);
10865 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
10866 0 : __Pyx_GOTREF(__pyx_t_6);
10867 0 : __pyx_t_7 = NULL;
10868 0 : __pyx_t_8 = 0;
10869 : #if CYTHON_UNPACK_METHODS
10870 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
10871 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10872 0 : if (likely(__pyx_t_7)) {
10873 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10874 0 : __Pyx_INCREF(__pyx_t_7);
10875 0 : __Pyx_INCREF(function);
10876 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
10877 : __pyx_t_8 = 1;
10878 : }
10879 : }
10880 : #endif
10881 : {
10882 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10883 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
10884 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10885 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10886 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
10887 0 : __Pyx_GOTREF(__pyx_t_1);
10888 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10889 : }
10890 0 : __pyx_v_result = __pyx_t_1;
10891 0 : __pyx_t_1 = 0;
10892 :
10893 : /* "View.MemoryView":496
10894 : *
10895 : * bytesitem = itemp[:self.view.itemsize]
10896 : * try: # <<<<<<<<<<<<<<
10897 : * result = struct.unpack(self.view.format, bytesitem)
10898 : * except struct.error:
10899 : */
10900 : }
10901 :
10902 : /* "View.MemoryView":501
10903 : * raise ValueError, "Unable to convert item to object"
10904 : * else:
10905 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10906 : * return result[0]
10907 : * return result
10908 : */
10909 : /*else:*/ {
10910 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
10911 0 : __pyx_t_10 = (__pyx_t_9 == 1);
10912 0 : if (__pyx_t_10) {
10913 :
10914 : /* "View.MemoryView":502
10915 : * else:
10916 : * if len(self.view.format) == 1:
10917 : * return result[0] # <<<<<<<<<<<<<<
10918 : * return result
10919 : *
10920 : */
10921 0 : __Pyx_XDECREF(__pyx_r);
10922 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
10923 0 : __Pyx_GOTREF(__pyx_t_1);
10924 0 : __pyx_r = __pyx_t_1;
10925 0 : __pyx_t_1 = 0;
10926 0 : goto __pyx_L6_except_return;
10927 :
10928 : /* "View.MemoryView":501
10929 : * raise ValueError, "Unable to convert item to object"
10930 : * else:
10931 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10932 : * return result[0]
10933 : * return result
10934 : */
10935 : }
10936 :
10937 : /* "View.MemoryView":503
10938 : * if len(self.view.format) == 1:
10939 : * return result[0]
10940 : * return result # <<<<<<<<<<<<<<
10941 : *
10942 : * cdef assign_item_from_object(self, char *itemp, object value):
10943 : */
10944 0 : __Pyx_XDECREF(__pyx_r);
10945 0 : __Pyx_INCREF(__pyx_v_result);
10946 0 : __pyx_r = __pyx_v_result;
10947 0 : goto __pyx_L6_except_return;
10948 : }
10949 0 : __pyx_L3_error:;
10950 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10951 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10952 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10953 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10954 :
10955 : /* "View.MemoryView":498
10956 : * try:
10957 : * result = struct.unpack(self.view.format, bytesitem)
10958 : * except struct.error: # <<<<<<<<<<<<<<
10959 : * raise ValueError, "Unable to convert item to object"
10960 : * else:
10961 : */
10962 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
10963 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
10964 0 : __Pyx_GOTREF(__pyx_t_7);
10965 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
10966 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10967 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
10968 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
10969 0 : if (__pyx_t_11) {
10970 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10971 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
10972 0 : __Pyx_XGOTREF(__pyx_t_6);
10973 0 : __Pyx_XGOTREF(__pyx_t_5);
10974 0 : __Pyx_XGOTREF(__pyx_t_1);
10975 :
10976 : /* "View.MemoryView":499
10977 : * result = struct.unpack(self.view.format, bytesitem)
10978 : * except struct.error:
10979 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
10980 : * else:
10981 : * if len(self.view.format) == 1:
10982 : */
10983 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
10984 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
10985 : }
10986 0 : goto __pyx_L5_except_error;
10987 :
10988 : /* "View.MemoryView":496
10989 : *
10990 : * bytesitem = itemp[:self.view.itemsize]
10991 : * try: # <<<<<<<<<<<<<<
10992 : * result = struct.unpack(self.view.format, bytesitem)
10993 : * except struct.error:
10994 : */
10995 0 : __pyx_L5_except_error:;
10996 0 : __Pyx_XGIVEREF(__pyx_t_2);
10997 0 : __Pyx_XGIVEREF(__pyx_t_3);
10998 0 : __Pyx_XGIVEREF(__pyx_t_4);
10999 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11000 0 : goto __pyx_L1_error;
11001 0 : __pyx_L6_except_return:;
11002 0 : __Pyx_XGIVEREF(__pyx_t_2);
11003 0 : __Pyx_XGIVEREF(__pyx_t_3);
11004 0 : __Pyx_XGIVEREF(__pyx_t_4);
11005 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11006 0 : goto __pyx_L0;
11007 : }
11008 :
11009 : /* "View.MemoryView":489
11010 : * self.assign_item_from_object(itemp, value)
11011 : *
11012 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11013 : * """Only used if instantiated manually by the user, or if Cython doesn't
11014 : * know how to convert the type"""
11015 : */
11016 :
11017 : /* function exit code */
11018 0 : __pyx_L1_error:;
11019 0 : __Pyx_XDECREF(__pyx_t_1);
11020 0 : __Pyx_XDECREF(__pyx_t_5);
11021 0 : __Pyx_XDECREF(__pyx_t_6);
11022 0 : __Pyx_XDECREF(__pyx_t_7);
11023 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11024 0 : __pyx_r = 0;
11025 0 : __pyx_L0:;
11026 0 : __Pyx_XDECREF(__pyx_v_struct);
11027 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
11028 0 : __Pyx_XDECREF(__pyx_v_result);
11029 0 : __Pyx_XGIVEREF(__pyx_r);
11030 0 : __Pyx_RefNannyFinishContext();
11031 0 : return __pyx_r;
11032 : }
11033 :
11034 : /* "View.MemoryView":505
11035 : * return result
11036 : *
11037 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11038 : * """Only used if instantiated manually by the user, or if Cython doesn't
11039 : * know how to convert the type"""
11040 : */
11041 :
11042 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11043 0 : PyObject *__pyx_v_struct = NULL;
11044 0 : char __pyx_v_c;
11045 0 : PyObject *__pyx_v_bytesvalue = 0;
11046 0 : Py_ssize_t __pyx_v_i;
11047 0 : PyObject *__pyx_r = NULL;
11048 : __Pyx_RefNannyDeclarations
11049 0 : PyObject *__pyx_t_1 = NULL;
11050 0 : int __pyx_t_2;
11051 0 : PyObject *__pyx_t_3 = NULL;
11052 0 : PyObject *__pyx_t_4 = NULL;
11053 0 : PyObject *__pyx_t_5 = NULL;
11054 0 : unsigned int __pyx_t_6;
11055 0 : Py_ssize_t __pyx_t_7;
11056 0 : PyObject *__pyx_t_8 = NULL;
11057 0 : char *__pyx_t_9;
11058 0 : char *__pyx_t_10;
11059 0 : char *__pyx_t_11;
11060 0 : char *__pyx_t_12;
11061 0 : int __pyx_lineno = 0;
11062 0 : const char *__pyx_filename = NULL;
11063 0 : int __pyx_clineno = 0;
11064 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
11065 :
11066 : /* "View.MemoryView":508
11067 : * """Only used if instantiated manually by the user, or if Cython doesn't
11068 : * know how to convert the type"""
11069 : * import struct # <<<<<<<<<<<<<<
11070 : * cdef char c
11071 : * cdef bytes bytesvalue
11072 : */
11073 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
11074 0 : __Pyx_GOTREF(__pyx_t_1);
11075 0 : __pyx_v_struct = __pyx_t_1;
11076 0 : __pyx_t_1 = 0;
11077 :
11078 : /* "View.MemoryView":513
11079 : * cdef Py_ssize_t i
11080 : *
11081 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11082 : * bytesvalue = struct.pack(self.view.format, *value)
11083 : * else:
11084 : */
11085 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11086 0 : if (__pyx_t_2) {
11087 :
11088 : /* "View.MemoryView":514
11089 : *
11090 : * if isinstance(value, tuple):
11091 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11092 : * else:
11093 : * bytesvalue = struct.pack(self.view.format, value)
11094 : */
11095 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
11096 0 : __Pyx_GOTREF(__pyx_t_1);
11097 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
11098 0 : __Pyx_GOTREF(__pyx_t_3);
11099 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11100 0 : __Pyx_GOTREF(__pyx_t_4);
11101 0 : __Pyx_GIVEREF(__pyx_t_3);
11102 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
11103 0 : __pyx_t_3 = 0;
11104 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
11105 0 : __Pyx_GOTREF(__pyx_t_3);
11106 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
11107 0 : __Pyx_GOTREF(__pyx_t_5);
11108 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11109 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11110 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
11111 0 : __Pyx_GOTREF(__pyx_t_3);
11112 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11113 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11114 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
11115 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
11116 0 : __pyx_t_3 = 0;
11117 :
11118 : /* "View.MemoryView":513
11119 : * cdef Py_ssize_t i
11120 : *
11121 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11122 : * bytesvalue = struct.pack(self.view.format, *value)
11123 : * else:
11124 : */
11125 0 : goto __pyx_L3;
11126 : }
11127 :
11128 : /* "View.MemoryView":516
11129 : * bytesvalue = struct.pack(self.view.format, *value)
11130 : * else:
11131 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11132 : *
11133 : * for i, c in enumerate(bytesvalue):
11134 : */
11135 : /*else*/ {
11136 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
11137 0 : __Pyx_GOTREF(__pyx_t_5);
11138 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
11139 0 : __Pyx_GOTREF(__pyx_t_1);
11140 0 : __pyx_t_4 = NULL;
11141 0 : __pyx_t_6 = 0;
11142 : #if CYTHON_UNPACK_METHODS
11143 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
11144 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
11145 0 : if (likely(__pyx_t_4)) {
11146 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11147 0 : __Pyx_INCREF(__pyx_t_4);
11148 0 : __Pyx_INCREF(function);
11149 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
11150 : __pyx_t_6 = 1;
11151 : }
11152 : }
11153 : #endif
11154 : {
11155 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
11156 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
11157 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11158 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11159 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
11160 0 : __Pyx_GOTREF(__pyx_t_3);
11161 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11162 : }
11163 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
11164 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
11165 : __pyx_t_3 = 0;
11166 : }
11167 0 : __pyx_L3:;
11168 :
11169 : /* "View.MemoryView":518
11170 : * bytesvalue = struct.pack(self.view.format, value)
11171 : *
11172 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11173 : * itemp[i] = c
11174 : *
11175 : */
11176 0 : __pyx_t_7 = 0;
11177 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11178 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11179 0 : __PYX_ERR(1, 518, __pyx_L1_error)
11180 : }
11181 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
11182 0 : __pyx_t_8 = __pyx_v_bytesvalue;
11183 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
11184 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
11185 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
11186 0 : __pyx_t_9 = __pyx_t_12;
11187 0 : __pyx_v_c = (__pyx_t_9[0]);
11188 :
11189 : /* "View.MemoryView":519
11190 : *
11191 : * for i, c in enumerate(bytesvalue):
11192 : * itemp[i] = c # <<<<<<<<<<<<<<
11193 : *
11194 : * @cname('getbuffer')
11195 : */
11196 0 : __pyx_v_i = __pyx_t_7;
11197 :
11198 : /* "View.MemoryView":518
11199 : * bytesvalue = struct.pack(self.view.format, value)
11200 : *
11201 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11202 : * itemp[i] = c
11203 : *
11204 : */
11205 0 : __pyx_t_7 = (__pyx_t_7 + 1);
11206 :
11207 : /* "View.MemoryView":519
11208 : *
11209 : * for i, c in enumerate(bytesvalue):
11210 : * itemp[i] = c # <<<<<<<<<<<<<<
11211 : *
11212 : * @cname('getbuffer')
11213 : */
11214 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11215 : }
11216 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11217 :
11218 : /* "View.MemoryView":505
11219 : * return result
11220 : *
11221 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11222 : * """Only used if instantiated manually by the user, or if Cython doesn't
11223 : * know how to convert the type"""
11224 : */
11225 :
11226 : /* function exit code */
11227 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11228 0 : goto __pyx_L0;
11229 0 : __pyx_L1_error:;
11230 0 : __Pyx_XDECREF(__pyx_t_1);
11231 0 : __Pyx_XDECREF(__pyx_t_3);
11232 0 : __Pyx_XDECREF(__pyx_t_4);
11233 0 : __Pyx_XDECREF(__pyx_t_5);
11234 0 : __Pyx_XDECREF(__pyx_t_8);
11235 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11236 0 : __pyx_r = 0;
11237 0 : __pyx_L0:;
11238 0 : __Pyx_XDECREF(__pyx_v_struct);
11239 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
11240 0 : __Pyx_XGIVEREF(__pyx_r);
11241 0 : __Pyx_RefNannyFinishContext();
11242 0 : return __pyx_r;
11243 : }
11244 :
11245 : /* "View.MemoryView":521
11246 : * itemp[i] = c
11247 : *
11248 : * @cname('getbuffer') # <<<<<<<<<<<<<<
11249 : * def __getbuffer__(self, Py_buffer *info, int flags):
11250 : * if flags & PyBUF_WRITABLE and self.view.readonly:
11251 : */
11252 :
11253 : /* Python wrapper */
11254 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11255 0 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11256 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11257 0 : int __pyx_r;
11258 : __Pyx_RefNannyDeclarations
11259 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
11260 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11261 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
11262 :
11263 : /* function exit code */
11264 0 : __Pyx_RefNannyFinishContext();
11265 0 : return __pyx_r;
11266 : }
11267 :
11268 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11269 0 : int __pyx_r;
11270 : __Pyx_RefNannyDeclarations
11271 0 : int __pyx_t_1;
11272 0 : int __pyx_t_2;
11273 0 : Py_ssize_t *__pyx_t_3;
11274 0 : char *__pyx_t_4;
11275 0 : void *__pyx_t_5;
11276 0 : int __pyx_t_6;
11277 0 : Py_ssize_t __pyx_t_7;
11278 0 : int __pyx_lineno = 0;
11279 0 : const char *__pyx_filename = NULL;
11280 0 : int __pyx_clineno = 0;
11281 0 : if (unlikely(__pyx_v_info == NULL)) {
11282 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11283 0 : return -1;
11284 : }
11285 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
11286 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11287 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
11288 :
11289 : /* "View.MemoryView":523
11290 : * @cname('getbuffer')
11291 : * def __getbuffer__(self, Py_buffer *info, int flags):
11292 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11293 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
11294 : *
11295 : */
11296 0 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11297 0 : if (__pyx_t_2) {
11298 0 : } else {
11299 0 : __pyx_t_1 = __pyx_t_2;
11300 0 : goto __pyx_L4_bool_binop_done;
11301 : }
11302 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
11303 0 : __pyx_L4_bool_binop_done:;
11304 0 : if (unlikely(__pyx_t_1)) {
11305 :
11306 : /* "View.MemoryView":524
11307 : * def __getbuffer__(self, Py_buffer *info, int flags):
11308 : * if flags & PyBUF_WRITABLE and self.view.readonly:
11309 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
11310 : *
11311 : * if flags & PyBUF_ND:
11312 : */
11313 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
11314 0 : __PYX_ERR(1, 524, __pyx_L1_error)
11315 :
11316 : /* "View.MemoryView":523
11317 : * @cname('getbuffer')
11318 : * def __getbuffer__(self, Py_buffer *info, int flags):
11319 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11320 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
11321 : *
11322 : */
11323 : }
11324 :
11325 : /* "View.MemoryView":526
11326 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
11327 : *
11328 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11329 : * info.shape = self.view.shape
11330 : * else:
11331 : */
11332 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11333 0 : if (__pyx_t_1) {
11334 :
11335 : /* "View.MemoryView":527
11336 : *
11337 : * if flags & PyBUF_ND:
11338 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
11339 : * else:
11340 : * info.shape = NULL
11341 : */
11342 0 : __pyx_t_3 = __pyx_v_self->view.shape;
11343 0 : __pyx_v_info->shape = __pyx_t_3;
11344 :
11345 : /* "View.MemoryView":526
11346 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
11347 : *
11348 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11349 : * info.shape = self.view.shape
11350 : * else:
11351 : */
11352 0 : goto __pyx_L6;
11353 : }
11354 :
11355 : /* "View.MemoryView":529
11356 : * info.shape = self.view.shape
11357 : * else:
11358 : * info.shape = NULL # <<<<<<<<<<<<<<
11359 : *
11360 : * if flags & PyBUF_STRIDES:
11361 : */
11362 : /*else*/ {
11363 0 : __pyx_v_info->shape = NULL;
11364 : }
11365 0 : __pyx_L6:;
11366 :
11367 : /* "View.MemoryView":531
11368 : * info.shape = NULL
11369 : *
11370 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11371 : * info.strides = self.view.strides
11372 : * else:
11373 : */
11374 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11375 0 : if (__pyx_t_1) {
11376 :
11377 : /* "View.MemoryView":532
11378 : *
11379 : * if flags & PyBUF_STRIDES:
11380 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
11381 : * else:
11382 : * info.strides = NULL
11383 : */
11384 0 : __pyx_t_3 = __pyx_v_self->view.strides;
11385 0 : __pyx_v_info->strides = __pyx_t_3;
11386 :
11387 : /* "View.MemoryView":531
11388 : * info.shape = NULL
11389 : *
11390 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11391 : * info.strides = self.view.strides
11392 : * else:
11393 : */
11394 0 : goto __pyx_L7;
11395 : }
11396 :
11397 : /* "View.MemoryView":534
11398 : * info.strides = self.view.strides
11399 : * else:
11400 : * info.strides = NULL # <<<<<<<<<<<<<<
11401 : *
11402 : * if flags & PyBUF_INDIRECT:
11403 : */
11404 : /*else*/ {
11405 0 : __pyx_v_info->strides = NULL;
11406 : }
11407 0 : __pyx_L7:;
11408 :
11409 : /* "View.MemoryView":536
11410 : * info.strides = NULL
11411 : *
11412 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11413 : * info.suboffsets = self.view.suboffsets
11414 : * else:
11415 : */
11416 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11417 0 : if (__pyx_t_1) {
11418 :
11419 : /* "View.MemoryView":537
11420 : *
11421 : * if flags & PyBUF_INDIRECT:
11422 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
11423 : * else:
11424 : * info.suboffsets = NULL
11425 : */
11426 0 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
11427 0 : __pyx_v_info->suboffsets = __pyx_t_3;
11428 :
11429 : /* "View.MemoryView":536
11430 : * info.strides = NULL
11431 : *
11432 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11433 : * info.suboffsets = self.view.suboffsets
11434 : * else:
11435 : */
11436 0 : goto __pyx_L8;
11437 : }
11438 :
11439 : /* "View.MemoryView":539
11440 : * info.suboffsets = self.view.suboffsets
11441 : * else:
11442 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
11443 : *
11444 : * if flags & PyBUF_FORMAT:
11445 : */
11446 : /*else*/ {
11447 0 : __pyx_v_info->suboffsets = NULL;
11448 : }
11449 0 : __pyx_L8:;
11450 :
11451 : /* "View.MemoryView":541
11452 : * info.suboffsets = NULL
11453 : *
11454 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11455 : * info.format = self.view.format
11456 : * else:
11457 : */
11458 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11459 0 : if (__pyx_t_1) {
11460 :
11461 : /* "View.MemoryView":542
11462 : *
11463 : * if flags & PyBUF_FORMAT:
11464 : * info.format = self.view.format # <<<<<<<<<<<<<<
11465 : * else:
11466 : * info.format = NULL
11467 : */
11468 0 : __pyx_t_4 = __pyx_v_self->view.format;
11469 0 : __pyx_v_info->format = __pyx_t_4;
11470 :
11471 : /* "View.MemoryView":541
11472 : * info.suboffsets = NULL
11473 : *
11474 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11475 : * info.format = self.view.format
11476 : * else:
11477 : */
11478 0 : goto __pyx_L9;
11479 : }
11480 :
11481 : /* "View.MemoryView":544
11482 : * info.format = self.view.format
11483 : * else:
11484 : * info.format = NULL # <<<<<<<<<<<<<<
11485 : *
11486 : * info.buf = self.view.buf
11487 : */
11488 : /*else*/ {
11489 0 : __pyx_v_info->format = NULL;
11490 : }
11491 0 : __pyx_L9:;
11492 :
11493 : /* "View.MemoryView":546
11494 : * info.format = NULL
11495 : *
11496 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
11497 : * info.ndim = self.view.ndim
11498 : * info.itemsize = self.view.itemsize
11499 : */
11500 0 : __pyx_t_5 = __pyx_v_self->view.buf;
11501 0 : __pyx_v_info->buf = __pyx_t_5;
11502 :
11503 : /* "View.MemoryView":547
11504 : *
11505 : * info.buf = self.view.buf
11506 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
11507 : * info.itemsize = self.view.itemsize
11508 : * info.len = self.view.len
11509 : */
11510 0 : __pyx_t_6 = __pyx_v_self->view.ndim;
11511 0 : __pyx_v_info->ndim = __pyx_t_6;
11512 :
11513 : /* "View.MemoryView":548
11514 : * info.buf = self.view.buf
11515 : * info.ndim = self.view.ndim
11516 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
11517 : * info.len = self.view.len
11518 : * info.readonly = self.view.readonly
11519 : */
11520 0 : __pyx_t_7 = __pyx_v_self->view.itemsize;
11521 0 : __pyx_v_info->itemsize = __pyx_t_7;
11522 :
11523 : /* "View.MemoryView":549
11524 : * info.ndim = self.view.ndim
11525 : * info.itemsize = self.view.itemsize
11526 : * info.len = self.view.len # <<<<<<<<<<<<<<
11527 : * info.readonly = self.view.readonly
11528 : * info.obj = self
11529 : */
11530 0 : __pyx_t_7 = __pyx_v_self->view.len;
11531 0 : __pyx_v_info->len = __pyx_t_7;
11532 :
11533 : /* "View.MemoryView":550
11534 : * info.itemsize = self.view.itemsize
11535 : * info.len = self.view.len
11536 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
11537 : * info.obj = self
11538 : *
11539 : */
11540 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
11541 0 : __pyx_v_info->readonly = __pyx_t_1;
11542 :
11543 : /* "View.MemoryView":551
11544 : * info.len = self.view.len
11545 : * info.readonly = self.view.readonly
11546 : * info.obj = self # <<<<<<<<<<<<<<
11547 : *
11548 : *
11549 : */
11550 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
11551 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
11552 0 : __Pyx_GOTREF(__pyx_v_info->obj);
11553 0 : __Pyx_DECREF(__pyx_v_info->obj);
11554 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11555 :
11556 : /* "View.MemoryView":521
11557 : * itemp[i] = c
11558 : *
11559 : * @cname('getbuffer') # <<<<<<<<<<<<<<
11560 : * def __getbuffer__(self, Py_buffer *info, int flags):
11561 : * if flags & PyBUF_WRITABLE and self.view.readonly:
11562 : */
11563 :
11564 : /* function exit code */
11565 0 : __pyx_r = 0;
11566 0 : goto __pyx_L0;
11567 0 : __pyx_L1_error:;
11568 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11569 0 : __pyx_r = -1;
11570 0 : if (__pyx_v_info->obj != NULL) {
11571 0 : __Pyx_GOTREF(__pyx_v_info->obj);
11572 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11573 : }
11574 0 : goto __pyx_L2;
11575 0 : __pyx_L0:;
11576 0 : if (__pyx_v_info->obj == Py_None) {
11577 0 : __Pyx_GOTREF(__pyx_v_info->obj);
11578 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11579 : }
11580 0 : __pyx_L2:;
11581 : __Pyx_RefNannyFinishContext();
11582 : return __pyx_r;
11583 : }
11584 :
11585 : /* "View.MemoryView":554
11586 : *
11587 : *
11588 : * @property # <<<<<<<<<<<<<<
11589 : * def T(self):
11590 : * cdef _memoryviewslice result = memoryview_copy(self)
11591 : */
11592 :
11593 : /* Python wrapper */
11594 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
11595 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11596 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11597 0 : PyObject *__pyx_r = 0;
11598 : __Pyx_RefNannyDeclarations
11599 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11600 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11601 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11602 :
11603 : /* function exit code */
11604 0 : __Pyx_RefNannyFinishContext();
11605 0 : return __pyx_r;
11606 : }
11607 :
11608 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11609 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11610 0 : PyObject *__pyx_r = NULL;
11611 : __Pyx_RefNannyDeclarations
11612 0 : PyObject *__pyx_t_1 = NULL;
11613 0 : int __pyx_t_2;
11614 0 : int __pyx_lineno = 0;
11615 0 : const char *__pyx_filename = NULL;
11616 0 : int __pyx_clineno = 0;
11617 0 : __Pyx_RefNannySetupContext("__get__", 1);
11618 :
11619 : /* "View.MemoryView":556
11620 : * @property
11621 : * def T(self):
11622 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
11623 : * transpose_memslice(&result.from_slice)
11624 : * return result
11625 : */
11626 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
11627 0 : __Pyx_GOTREF(__pyx_t_1);
11628 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
11629 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11630 0 : __pyx_t_1 = 0;
11631 :
11632 : /* "View.MemoryView":557
11633 : * def T(self):
11634 : * cdef _memoryviewslice result = memoryview_copy(self)
11635 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
11636 : * return result
11637 : *
11638 : */
11639 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
11640 :
11641 : /* "View.MemoryView":558
11642 : * cdef _memoryviewslice result = memoryview_copy(self)
11643 : * transpose_memslice(&result.from_slice)
11644 : * return result # <<<<<<<<<<<<<<
11645 : *
11646 : * @property
11647 : */
11648 0 : __Pyx_XDECREF(__pyx_r);
11649 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
11650 0 : __pyx_r = ((PyObject *)__pyx_v_result);
11651 0 : goto __pyx_L0;
11652 :
11653 : /* "View.MemoryView":554
11654 : *
11655 : *
11656 : * @property # <<<<<<<<<<<<<<
11657 : * def T(self):
11658 : * cdef _memoryviewslice result = memoryview_copy(self)
11659 : */
11660 :
11661 : /* function exit code */
11662 0 : __pyx_L1_error:;
11663 0 : __Pyx_XDECREF(__pyx_t_1);
11664 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11665 0 : __pyx_r = NULL;
11666 0 : __pyx_L0:;
11667 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
11668 0 : __Pyx_XGIVEREF(__pyx_r);
11669 0 : __Pyx_RefNannyFinishContext();
11670 0 : return __pyx_r;
11671 : }
11672 :
11673 : /* "View.MemoryView":560
11674 : * return result
11675 : *
11676 : * @property # <<<<<<<<<<<<<<
11677 : * def base(self):
11678 : * return self._get_base()
11679 : */
11680 :
11681 : /* Python wrapper */
11682 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
11683 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11684 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11685 0 : PyObject *__pyx_r = 0;
11686 : __Pyx_RefNannyDeclarations
11687 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11688 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11689 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11690 :
11691 : /* function exit code */
11692 0 : __Pyx_RefNannyFinishContext();
11693 0 : return __pyx_r;
11694 : }
11695 :
11696 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11697 0 : PyObject *__pyx_r = NULL;
11698 : __Pyx_RefNannyDeclarations
11699 0 : PyObject *__pyx_t_1 = NULL;
11700 0 : int __pyx_lineno = 0;
11701 0 : const char *__pyx_filename = NULL;
11702 0 : int __pyx_clineno = 0;
11703 0 : __Pyx_RefNannySetupContext("__get__", 1);
11704 :
11705 : /* "View.MemoryView":562
11706 : * @property
11707 : * def base(self):
11708 : * return self._get_base() # <<<<<<<<<<<<<<
11709 : *
11710 : * cdef _get_base(self):
11711 : */
11712 0 : __Pyx_XDECREF(__pyx_r);
11713 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
11714 0 : __Pyx_GOTREF(__pyx_t_1);
11715 0 : __pyx_r = __pyx_t_1;
11716 0 : __pyx_t_1 = 0;
11717 0 : goto __pyx_L0;
11718 :
11719 : /* "View.MemoryView":560
11720 : * return result
11721 : *
11722 : * @property # <<<<<<<<<<<<<<
11723 : * def base(self):
11724 : * return self._get_base()
11725 : */
11726 :
11727 : /* function exit code */
11728 0 : __pyx_L1_error:;
11729 0 : __Pyx_XDECREF(__pyx_t_1);
11730 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11731 0 : __pyx_r = NULL;
11732 0 : __pyx_L0:;
11733 0 : __Pyx_XGIVEREF(__pyx_r);
11734 0 : __Pyx_RefNannyFinishContext();
11735 0 : return __pyx_r;
11736 : }
11737 :
11738 : /* "View.MemoryView":564
11739 : * return self._get_base()
11740 : *
11741 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11742 : * return self.obj
11743 : *
11744 : */
11745 :
11746 0 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
11747 0 : PyObject *__pyx_r = NULL;
11748 : __Pyx_RefNannyDeclarations
11749 0 : __Pyx_RefNannySetupContext("_get_base", 1);
11750 :
11751 : /* "View.MemoryView":565
11752 : *
11753 : * cdef _get_base(self):
11754 : * return self.obj # <<<<<<<<<<<<<<
11755 : *
11756 : * @property
11757 : */
11758 0 : __Pyx_XDECREF(__pyx_r);
11759 0 : __Pyx_INCREF(__pyx_v_self->obj);
11760 0 : __pyx_r = __pyx_v_self->obj;
11761 0 : goto __pyx_L0;
11762 :
11763 : /* "View.MemoryView":564
11764 : * return self._get_base()
11765 : *
11766 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11767 : * return self.obj
11768 : *
11769 : */
11770 :
11771 : /* function exit code */
11772 0 : __pyx_L0:;
11773 0 : __Pyx_XGIVEREF(__pyx_r);
11774 0 : __Pyx_RefNannyFinishContext();
11775 0 : return __pyx_r;
11776 : }
11777 :
11778 : /* "View.MemoryView":567
11779 : * return self.obj
11780 : *
11781 : * @property # <<<<<<<<<<<<<<
11782 : * def shape(self):
11783 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11784 : */
11785 :
11786 : /* Python wrapper */
11787 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11788 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11789 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11790 0 : PyObject *__pyx_r = 0;
11791 : __Pyx_RefNannyDeclarations
11792 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11793 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11794 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11795 :
11796 : /* function exit code */
11797 0 : __Pyx_RefNannyFinishContext();
11798 0 : return __pyx_r;
11799 : }
11800 :
11801 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11802 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
11803 0 : PyObject *__pyx_r = NULL;
11804 : __Pyx_RefNannyDeclarations
11805 0 : PyObject *__pyx_t_1 = NULL;
11806 0 : Py_ssize_t *__pyx_t_2;
11807 0 : Py_ssize_t *__pyx_t_3;
11808 0 : Py_ssize_t *__pyx_t_4;
11809 0 : PyObject *__pyx_t_5 = NULL;
11810 0 : int __pyx_lineno = 0;
11811 0 : const char *__pyx_filename = NULL;
11812 0 : int __pyx_clineno = 0;
11813 0 : __Pyx_RefNannySetupContext("__get__", 1);
11814 :
11815 : /* "View.MemoryView":569
11816 : * @property
11817 : * def shape(self):
11818 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11819 : *
11820 : * @property
11821 : */
11822 0 : __Pyx_XDECREF(__pyx_r);
11823 : { /* enter inner scope */
11824 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
11825 0 : __Pyx_GOTREF(__pyx_t_1);
11826 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11827 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11828 0 : __pyx_t_2 = __pyx_t_4;
11829 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
11830 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11831 0 : __Pyx_GOTREF(__pyx_t_5);
11832 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
11833 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11834 : }
11835 : } /* exit inner scope */
11836 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11837 0 : __Pyx_GOTREF(__pyx_t_5);
11838 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11839 0 : __pyx_r = __pyx_t_5;
11840 0 : __pyx_t_5 = 0;
11841 0 : goto __pyx_L0;
11842 :
11843 : /* "View.MemoryView":567
11844 : * return self.obj
11845 : *
11846 : * @property # <<<<<<<<<<<<<<
11847 : * def shape(self):
11848 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11849 : */
11850 :
11851 : /* function exit code */
11852 0 : __pyx_L1_error:;
11853 0 : __Pyx_XDECREF(__pyx_t_1);
11854 0 : __Pyx_XDECREF(__pyx_t_5);
11855 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11856 0 : __pyx_r = NULL;
11857 0 : __pyx_L0:;
11858 0 : __Pyx_XGIVEREF(__pyx_r);
11859 0 : __Pyx_RefNannyFinishContext();
11860 0 : return __pyx_r;
11861 : }
11862 :
11863 : /* "View.MemoryView":571
11864 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11865 : *
11866 : * @property # <<<<<<<<<<<<<<
11867 : * def strides(self):
11868 : * if self.view.strides == NULL:
11869 : */
11870 :
11871 : /* Python wrapper */
11872 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11873 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11874 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11875 0 : PyObject *__pyx_r = 0;
11876 : __Pyx_RefNannyDeclarations
11877 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11878 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11879 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11880 :
11881 : /* function exit code */
11882 0 : __Pyx_RefNannyFinishContext();
11883 0 : return __pyx_r;
11884 : }
11885 :
11886 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11887 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
11888 0 : PyObject *__pyx_r = NULL;
11889 : __Pyx_RefNannyDeclarations
11890 0 : int __pyx_t_1;
11891 0 : PyObject *__pyx_t_2 = NULL;
11892 0 : Py_ssize_t *__pyx_t_3;
11893 0 : Py_ssize_t *__pyx_t_4;
11894 0 : Py_ssize_t *__pyx_t_5;
11895 0 : PyObject *__pyx_t_6 = NULL;
11896 0 : int __pyx_lineno = 0;
11897 0 : const char *__pyx_filename = NULL;
11898 0 : int __pyx_clineno = 0;
11899 0 : __Pyx_RefNannySetupContext("__get__", 1);
11900 :
11901 : /* "View.MemoryView":573
11902 : * @property
11903 : * def strides(self):
11904 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11905 : *
11906 : * raise ValueError, "Buffer view does not expose strides"
11907 : */
11908 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
11909 0 : if (unlikely(__pyx_t_1)) {
11910 :
11911 : /* "View.MemoryView":575
11912 : * if self.view.strides == NULL:
11913 : *
11914 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
11915 : *
11916 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11917 : */
11918 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
11919 0 : __PYX_ERR(1, 575, __pyx_L1_error)
11920 :
11921 : /* "View.MemoryView":573
11922 : * @property
11923 : * def strides(self):
11924 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11925 : *
11926 : * raise ValueError, "Buffer view does not expose strides"
11927 : */
11928 : }
11929 :
11930 : /* "View.MemoryView":577
11931 : * raise ValueError, "Buffer view does not expose strides"
11932 : *
11933 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11934 : *
11935 : * @property
11936 : */
11937 0 : __Pyx_XDECREF(__pyx_r);
11938 : { /* enter inner scope */
11939 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
11940 0 : __Pyx_GOTREF(__pyx_t_2);
11941 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11942 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11943 0 : __pyx_t_3 = __pyx_t_5;
11944 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
11945 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11946 0 : __Pyx_GOTREF(__pyx_t_6);
11947 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
11948 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11949 : }
11950 : } /* exit inner scope */
11951 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11952 0 : __Pyx_GOTREF(__pyx_t_6);
11953 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11954 0 : __pyx_r = __pyx_t_6;
11955 0 : __pyx_t_6 = 0;
11956 0 : goto __pyx_L0;
11957 :
11958 : /* "View.MemoryView":571
11959 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11960 : *
11961 : * @property # <<<<<<<<<<<<<<
11962 : * def strides(self):
11963 : * if self.view.strides == NULL:
11964 : */
11965 :
11966 : /* function exit code */
11967 0 : __pyx_L1_error:;
11968 0 : __Pyx_XDECREF(__pyx_t_2);
11969 0 : __Pyx_XDECREF(__pyx_t_6);
11970 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11971 0 : __pyx_r = NULL;
11972 0 : __pyx_L0:;
11973 0 : __Pyx_XGIVEREF(__pyx_r);
11974 0 : __Pyx_RefNannyFinishContext();
11975 0 : return __pyx_r;
11976 : }
11977 :
11978 : /* "View.MemoryView":579
11979 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11980 : *
11981 : * @property # <<<<<<<<<<<<<<
11982 : * def suboffsets(self):
11983 : * if self.view.suboffsets == NULL:
11984 : */
11985 :
11986 : /* Python wrapper */
11987 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11988 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11989 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11990 0 : PyObject *__pyx_r = 0;
11991 : __Pyx_RefNannyDeclarations
11992 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11993 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11994 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11995 :
11996 : /* function exit code */
11997 0 : __Pyx_RefNannyFinishContext();
11998 0 : return __pyx_r;
11999 : }
12000 :
12001 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12002 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
12003 0 : PyObject *__pyx_r = NULL;
12004 : __Pyx_RefNannyDeclarations
12005 0 : int __pyx_t_1;
12006 0 : PyObject *__pyx_t_2 = NULL;
12007 0 : Py_ssize_t *__pyx_t_3;
12008 0 : Py_ssize_t *__pyx_t_4;
12009 0 : Py_ssize_t *__pyx_t_5;
12010 0 : PyObject *__pyx_t_6 = NULL;
12011 0 : int __pyx_lineno = 0;
12012 0 : const char *__pyx_filename = NULL;
12013 0 : int __pyx_clineno = 0;
12014 0 : __Pyx_RefNannySetupContext("__get__", 1);
12015 :
12016 : /* "View.MemoryView":581
12017 : * @property
12018 : * def suboffsets(self):
12019 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12020 : * return (-1,) * self.view.ndim
12021 : *
12022 : */
12023 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
12024 0 : if (__pyx_t_1) {
12025 :
12026 : /* "View.MemoryView":582
12027 : * def suboffsets(self):
12028 : * if self.view.suboffsets == NULL:
12029 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12030 : *
12031 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12032 : */
12033 0 : __Pyx_XDECREF(__pyx_r);
12034 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
12035 0 : __Pyx_GOTREF(__pyx_t_2);
12036 0 : __pyx_r = __pyx_t_2;
12037 0 : __pyx_t_2 = 0;
12038 0 : goto __pyx_L0;
12039 :
12040 : /* "View.MemoryView":581
12041 : * @property
12042 : * def suboffsets(self):
12043 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12044 : * return (-1,) * self.view.ndim
12045 : *
12046 : */
12047 : }
12048 :
12049 : /* "View.MemoryView":584
12050 : * return (-1,) * self.view.ndim
12051 : *
12052 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12053 : *
12054 : * @property
12055 : */
12056 0 : __Pyx_XDECREF(__pyx_r);
12057 : { /* enter inner scope */
12058 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
12059 0 : __Pyx_GOTREF(__pyx_t_2);
12060 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12061 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12062 0 : __pyx_t_3 = __pyx_t_5;
12063 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
12064 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
12065 0 : __Pyx_GOTREF(__pyx_t_6);
12066 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
12067 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12068 : }
12069 : } /* exit inner scope */
12070 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
12071 0 : __Pyx_GOTREF(__pyx_t_6);
12072 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12073 0 : __pyx_r = __pyx_t_6;
12074 0 : __pyx_t_6 = 0;
12075 0 : goto __pyx_L0;
12076 :
12077 : /* "View.MemoryView":579
12078 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12079 : *
12080 : * @property # <<<<<<<<<<<<<<
12081 : * def suboffsets(self):
12082 : * if self.view.suboffsets == NULL:
12083 : */
12084 :
12085 : /* function exit code */
12086 0 : __pyx_L1_error:;
12087 0 : __Pyx_XDECREF(__pyx_t_2);
12088 0 : __Pyx_XDECREF(__pyx_t_6);
12089 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12090 0 : __pyx_r = NULL;
12091 0 : __pyx_L0:;
12092 0 : __Pyx_XGIVEREF(__pyx_r);
12093 0 : __Pyx_RefNannyFinishContext();
12094 0 : return __pyx_r;
12095 : }
12096 :
12097 : /* "View.MemoryView":586
12098 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12099 : *
12100 : * @property # <<<<<<<<<<<<<<
12101 : * def ndim(self):
12102 : * return self.view.ndim
12103 : */
12104 :
12105 : /* Python wrapper */
12106 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
12107 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12108 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12109 0 : PyObject *__pyx_r = 0;
12110 : __Pyx_RefNannyDeclarations
12111 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12112 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12113 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12114 :
12115 : /* function exit code */
12116 0 : __Pyx_RefNannyFinishContext();
12117 0 : return __pyx_r;
12118 : }
12119 :
12120 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12121 0 : PyObject *__pyx_r = NULL;
12122 : __Pyx_RefNannyDeclarations
12123 0 : PyObject *__pyx_t_1 = NULL;
12124 0 : int __pyx_lineno = 0;
12125 0 : const char *__pyx_filename = NULL;
12126 0 : int __pyx_clineno = 0;
12127 0 : __Pyx_RefNannySetupContext("__get__", 1);
12128 :
12129 : /* "View.MemoryView":588
12130 : * @property
12131 : * def ndim(self):
12132 : * return self.view.ndim # <<<<<<<<<<<<<<
12133 : *
12134 : * @property
12135 : */
12136 0 : __Pyx_XDECREF(__pyx_r);
12137 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
12138 0 : __Pyx_GOTREF(__pyx_t_1);
12139 0 : __pyx_r = __pyx_t_1;
12140 0 : __pyx_t_1 = 0;
12141 0 : goto __pyx_L0;
12142 :
12143 : /* "View.MemoryView":586
12144 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12145 : *
12146 : * @property # <<<<<<<<<<<<<<
12147 : * def ndim(self):
12148 : * return self.view.ndim
12149 : */
12150 :
12151 : /* function exit code */
12152 0 : __pyx_L1_error:;
12153 0 : __Pyx_XDECREF(__pyx_t_1);
12154 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12155 0 : __pyx_r = NULL;
12156 0 : __pyx_L0:;
12157 0 : __Pyx_XGIVEREF(__pyx_r);
12158 0 : __Pyx_RefNannyFinishContext();
12159 0 : return __pyx_r;
12160 : }
12161 :
12162 : /* "View.MemoryView":590
12163 : * return self.view.ndim
12164 : *
12165 : * @property # <<<<<<<<<<<<<<
12166 : * def itemsize(self):
12167 : * return self.view.itemsize
12168 : */
12169 :
12170 : /* Python wrapper */
12171 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12172 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12173 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12174 0 : PyObject *__pyx_r = 0;
12175 : __Pyx_RefNannyDeclarations
12176 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12177 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12178 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12179 :
12180 : /* function exit code */
12181 0 : __Pyx_RefNannyFinishContext();
12182 0 : return __pyx_r;
12183 : }
12184 :
12185 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12186 0 : PyObject *__pyx_r = NULL;
12187 : __Pyx_RefNannyDeclarations
12188 0 : PyObject *__pyx_t_1 = NULL;
12189 0 : int __pyx_lineno = 0;
12190 0 : const char *__pyx_filename = NULL;
12191 0 : int __pyx_clineno = 0;
12192 0 : __Pyx_RefNannySetupContext("__get__", 1);
12193 :
12194 : /* "View.MemoryView":592
12195 : * @property
12196 : * def itemsize(self):
12197 : * return self.view.itemsize # <<<<<<<<<<<<<<
12198 : *
12199 : * @property
12200 : */
12201 0 : __Pyx_XDECREF(__pyx_r);
12202 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
12203 0 : __Pyx_GOTREF(__pyx_t_1);
12204 0 : __pyx_r = __pyx_t_1;
12205 0 : __pyx_t_1 = 0;
12206 0 : goto __pyx_L0;
12207 :
12208 : /* "View.MemoryView":590
12209 : * return self.view.ndim
12210 : *
12211 : * @property # <<<<<<<<<<<<<<
12212 : * def itemsize(self):
12213 : * return self.view.itemsize
12214 : */
12215 :
12216 : /* function exit code */
12217 0 : __pyx_L1_error:;
12218 0 : __Pyx_XDECREF(__pyx_t_1);
12219 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12220 0 : __pyx_r = NULL;
12221 0 : __pyx_L0:;
12222 0 : __Pyx_XGIVEREF(__pyx_r);
12223 0 : __Pyx_RefNannyFinishContext();
12224 0 : return __pyx_r;
12225 : }
12226 :
12227 : /* "View.MemoryView":594
12228 : * return self.view.itemsize
12229 : *
12230 : * @property # <<<<<<<<<<<<<<
12231 : * def nbytes(self):
12232 : * return self.size * self.view.itemsize
12233 : */
12234 :
12235 : /* Python wrapper */
12236 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
12237 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12238 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12239 0 : PyObject *__pyx_r = 0;
12240 : __Pyx_RefNannyDeclarations
12241 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12242 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12243 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12244 :
12245 : /* function exit code */
12246 0 : __Pyx_RefNannyFinishContext();
12247 0 : return __pyx_r;
12248 : }
12249 :
12250 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12251 0 : PyObject *__pyx_r = NULL;
12252 : __Pyx_RefNannyDeclarations
12253 0 : PyObject *__pyx_t_1 = NULL;
12254 0 : PyObject *__pyx_t_2 = NULL;
12255 0 : PyObject *__pyx_t_3 = NULL;
12256 0 : int __pyx_lineno = 0;
12257 0 : const char *__pyx_filename = NULL;
12258 0 : int __pyx_clineno = 0;
12259 0 : __Pyx_RefNannySetupContext("__get__", 1);
12260 :
12261 : /* "View.MemoryView":596
12262 : * @property
12263 : * def nbytes(self):
12264 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12265 : *
12266 : * @property
12267 : */
12268 0 : __Pyx_XDECREF(__pyx_r);
12269 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
12270 0 : __Pyx_GOTREF(__pyx_t_1);
12271 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
12272 0 : __Pyx_GOTREF(__pyx_t_2);
12273 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
12274 0 : __Pyx_GOTREF(__pyx_t_3);
12275 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12276 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12277 0 : __pyx_r = __pyx_t_3;
12278 0 : __pyx_t_3 = 0;
12279 0 : goto __pyx_L0;
12280 :
12281 : /* "View.MemoryView":594
12282 : * return self.view.itemsize
12283 : *
12284 : * @property # <<<<<<<<<<<<<<
12285 : * def nbytes(self):
12286 : * return self.size * self.view.itemsize
12287 : */
12288 :
12289 : /* function exit code */
12290 0 : __pyx_L1_error:;
12291 0 : __Pyx_XDECREF(__pyx_t_1);
12292 0 : __Pyx_XDECREF(__pyx_t_2);
12293 0 : __Pyx_XDECREF(__pyx_t_3);
12294 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12295 0 : __pyx_r = NULL;
12296 0 : __pyx_L0:;
12297 0 : __Pyx_XGIVEREF(__pyx_r);
12298 0 : __Pyx_RefNannyFinishContext();
12299 0 : return __pyx_r;
12300 : }
12301 :
12302 : /* "View.MemoryView":598
12303 : * return self.size * self.view.itemsize
12304 : *
12305 : * @property # <<<<<<<<<<<<<<
12306 : * def size(self):
12307 : * if self._size is None:
12308 : */
12309 :
12310 : /* Python wrapper */
12311 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
12312 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12313 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12314 0 : PyObject *__pyx_r = 0;
12315 : __Pyx_RefNannyDeclarations
12316 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12317 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12318 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12319 :
12320 : /* function exit code */
12321 0 : __Pyx_RefNannyFinishContext();
12322 0 : return __pyx_r;
12323 : }
12324 :
12325 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12326 0 : PyObject *__pyx_v_result = NULL;
12327 0 : PyObject *__pyx_v_length = NULL;
12328 0 : PyObject *__pyx_r = NULL;
12329 : __Pyx_RefNannyDeclarations
12330 0 : int __pyx_t_1;
12331 0 : Py_ssize_t *__pyx_t_2;
12332 0 : Py_ssize_t *__pyx_t_3;
12333 0 : Py_ssize_t *__pyx_t_4;
12334 0 : PyObject *__pyx_t_5 = NULL;
12335 0 : int __pyx_lineno = 0;
12336 0 : const char *__pyx_filename = NULL;
12337 0 : int __pyx_clineno = 0;
12338 0 : __Pyx_RefNannySetupContext("__get__", 1);
12339 :
12340 : /* "View.MemoryView":600
12341 : * @property
12342 : * def size(self):
12343 : * if self._size is None: # <<<<<<<<<<<<<<
12344 : * result = 1
12345 : *
12346 : */
12347 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12348 0 : if (__pyx_t_1) {
12349 :
12350 : /* "View.MemoryView":601
12351 : * def size(self):
12352 : * if self._size is None:
12353 : * result = 1 # <<<<<<<<<<<<<<
12354 : *
12355 : * for length in self.view.shape[:self.view.ndim]:
12356 : */
12357 0 : __Pyx_INCREF(__pyx_int_1);
12358 0 : __pyx_v_result = __pyx_int_1;
12359 :
12360 : /* "View.MemoryView":603
12361 : * result = 1
12362 : *
12363 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12364 : * result *= length
12365 : *
12366 : */
12367 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12368 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12369 0 : __pyx_t_2 = __pyx_t_4;
12370 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
12371 0 : __Pyx_GOTREF(__pyx_t_5);
12372 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
12373 0 : __pyx_t_5 = 0;
12374 :
12375 : /* "View.MemoryView":604
12376 : *
12377 : * for length in self.view.shape[:self.view.ndim]:
12378 : * result *= length # <<<<<<<<<<<<<<
12379 : *
12380 : * self._size = result
12381 : */
12382 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
12383 0 : __Pyx_GOTREF(__pyx_t_5);
12384 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
12385 0 : __pyx_t_5 = 0;
12386 : }
12387 :
12388 : /* "View.MemoryView":606
12389 : * result *= length
12390 : *
12391 : * self._size = result # <<<<<<<<<<<<<<
12392 : *
12393 : * return self._size
12394 : */
12395 0 : __Pyx_INCREF(__pyx_v_result);
12396 0 : __Pyx_GIVEREF(__pyx_v_result);
12397 0 : __Pyx_GOTREF(__pyx_v_self->_size);
12398 0 : __Pyx_DECREF(__pyx_v_self->_size);
12399 0 : __pyx_v_self->_size = __pyx_v_result;
12400 :
12401 : /* "View.MemoryView":600
12402 : * @property
12403 : * def size(self):
12404 : * if self._size is None: # <<<<<<<<<<<<<<
12405 : * result = 1
12406 : *
12407 : */
12408 : }
12409 :
12410 : /* "View.MemoryView":608
12411 : * self._size = result
12412 : *
12413 : * return self._size # <<<<<<<<<<<<<<
12414 : *
12415 : * def __len__(self):
12416 : */
12417 0 : __Pyx_XDECREF(__pyx_r);
12418 0 : __Pyx_INCREF(__pyx_v_self->_size);
12419 0 : __pyx_r = __pyx_v_self->_size;
12420 0 : goto __pyx_L0;
12421 :
12422 : /* "View.MemoryView":598
12423 : * return self.size * self.view.itemsize
12424 : *
12425 : * @property # <<<<<<<<<<<<<<
12426 : * def size(self):
12427 : * if self._size is None:
12428 : */
12429 :
12430 : /* function exit code */
12431 0 : __pyx_L1_error:;
12432 0 : __Pyx_XDECREF(__pyx_t_5);
12433 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12434 0 : __pyx_r = NULL;
12435 0 : __pyx_L0:;
12436 0 : __Pyx_XDECREF(__pyx_v_result);
12437 0 : __Pyx_XDECREF(__pyx_v_length);
12438 0 : __Pyx_XGIVEREF(__pyx_r);
12439 0 : __Pyx_RefNannyFinishContext();
12440 0 : return __pyx_r;
12441 : }
12442 :
12443 : /* "View.MemoryView":610
12444 : * return self._size
12445 : *
12446 : * def __len__(self): # <<<<<<<<<<<<<<
12447 : * if self.view.ndim >= 1:
12448 : * return self.view.shape[0]
12449 : */
12450 :
12451 : /* Python wrapper */
12452 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
12453 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12454 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12455 0 : Py_ssize_t __pyx_r;
12456 : __Pyx_RefNannyDeclarations
12457 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12458 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12459 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12460 :
12461 : /* function exit code */
12462 0 : __Pyx_RefNannyFinishContext();
12463 0 : return __pyx_r;
12464 : }
12465 :
12466 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
12467 0 : Py_ssize_t __pyx_r;
12468 0 : int __pyx_t_1;
12469 :
12470 : /* "View.MemoryView":611
12471 : *
12472 : * def __len__(self):
12473 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12474 : * return self.view.shape[0]
12475 : *
12476 : */
12477 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
12478 0 : if (__pyx_t_1) {
12479 :
12480 : /* "View.MemoryView":612
12481 : * def __len__(self):
12482 : * if self.view.ndim >= 1:
12483 : * return self.view.shape[0] # <<<<<<<<<<<<<<
12484 : *
12485 : * return 0
12486 : */
12487 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
12488 0 : goto __pyx_L0;
12489 :
12490 : /* "View.MemoryView":611
12491 : *
12492 : * def __len__(self):
12493 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12494 : * return self.view.shape[0]
12495 : *
12496 : */
12497 : }
12498 :
12499 : /* "View.MemoryView":614
12500 : * return self.view.shape[0]
12501 : *
12502 : * return 0 # <<<<<<<<<<<<<<
12503 : *
12504 : * def __repr__(self):
12505 : */
12506 0 : __pyx_r = 0;
12507 0 : goto __pyx_L0;
12508 :
12509 : /* "View.MemoryView":610
12510 : * return self._size
12511 : *
12512 : * def __len__(self): # <<<<<<<<<<<<<<
12513 : * if self.view.ndim >= 1:
12514 : * return self.view.shape[0]
12515 : */
12516 :
12517 : /* function exit code */
12518 0 : __pyx_L0:;
12519 0 : return __pyx_r;
12520 : }
12521 :
12522 : /* "View.MemoryView":616
12523 : * return 0
12524 : *
12525 : * def __repr__(self): # <<<<<<<<<<<<<<
12526 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12527 : * id(self))
12528 : */
12529 :
12530 : /* Python wrapper */
12531 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
12532 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12533 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12534 0 : PyObject *__pyx_r = 0;
12535 : __Pyx_RefNannyDeclarations
12536 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12537 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12538 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12539 :
12540 : /* function exit code */
12541 0 : __Pyx_RefNannyFinishContext();
12542 0 : return __pyx_r;
12543 : }
12544 :
12545 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
12546 0 : PyObject *__pyx_r = NULL;
12547 : __Pyx_RefNannyDeclarations
12548 0 : PyObject *__pyx_t_1 = NULL;
12549 0 : PyObject *__pyx_t_2 = NULL;
12550 0 : PyObject *__pyx_t_3 = NULL;
12551 0 : int __pyx_lineno = 0;
12552 0 : const char *__pyx_filename = NULL;
12553 0 : int __pyx_clineno = 0;
12554 0 : __Pyx_RefNannySetupContext("__repr__", 1);
12555 :
12556 : /* "View.MemoryView":617
12557 : *
12558 : * def __repr__(self):
12559 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12560 : * id(self))
12561 : *
12562 : */
12563 0 : __Pyx_XDECREF(__pyx_r);
12564 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
12565 0 : __Pyx_GOTREF(__pyx_t_1);
12566 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
12567 0 : __Pyx_GOTREF(__pyx_t_2);
12568 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12569 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
12570 0 : __Pyx_GOTREF(__pyx_t_1);
12571 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12572 :
12573 : /* "View.MemoryView":618
12574 : * def __repr__(self):
12575 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12576 : * id(self)) # <<<<<<<<<<<<<<
12577 : *
12578 : * def __str__(self):
12579 : */
12580 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12581 0 : __Pyx_GOTREF(__pyx_t_2);
12582 :
12583 : /* "View.MemoryView":617
12584 : *
12585 : * def __repr__(self):
12586 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12587 : * id(self))
12588 : *
12589 : */
12590 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
12591 0 : __Pyx_GOTREF(__pyx_t_3);
12592 0 : __Pyx_GIVEREF(__pyx_t_1);
12593 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
12594 0 : __Pyx_GIVEREF(__pyx_t_2);
12595 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
12596 0 : __pyx_t_1 = 0;
12597 0 : __pyx_t_2 = 0;
12598 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
12599 0 : __Pyx_GOTREF(__pyx_t_2);
12600 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12601 0 : __pyx_r = __pyx_t_2;
12602 0 : __pyx_t_2 = 0;
12603 0 : goto __pyx_L0;
12604 :
12605 : /* "View.MemoryView":616
12606 : * return 0
12607 : *
12608 : * def __repr__(self): # <<<<<<<<<<<<<<
12609 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12610 : * id(self))
12611 : */
12612 :
12613 : /* function exit code */
12614 0 : __pyx_L1_error:;
12615 0 : __Pyx_XDECREF(__pyx_t_1);
12616 0 : __Pyx_XDECREF(__pyx_t_2);
12617 0 : __Pyx_XDECREF(__pyx_t_3);
12618 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12619 0 : __pyx_r = NULL;
12620 0 : __pyx_L0:;
12621 0 : __Pyx_XGIVEREF(__pyx_r);
12622 0 : __Pyx_RefNannyFinishContext();
12623 0 : return __pyx_r;
12624 : }
12625 :
12626 : /* "View.MemoryView":620
12627 : * id(self))
12628 : *
12629 : * def __str__(self): # <<<<<<<<<<<<<<
12630 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12631 : *
12632 : */
12633 :
12634 : /* Python wrapper */
12635 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
12636 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12637 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12638 0 : PyObject *__pyx_r = 0;
12639 : __Pyx_RefNannyDeclarations
12640 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12641 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12642 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12643 :
12644 : /* function exit code */
12645 0 : __Pyx_RefNannyFinishContext();
12646 0 : return __pyx_r;
12647 : }
12648 :
12649 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12650 0 : PyObject *__pyx_r = NULL;
12651 : __Pyx_RefNannyDeclarations
12652 0 : PyObject *__pyx_t_1 = NULL;
12653 0 : PyObject *__pyx_t_2 = NULL;
12654 0 : int __pyx_lineno = 0;
12655 0 : const char *__pyx_filename = NULL;
12656 0 : int __pyx_clineno = 0;
12657 0 : __Pyx_RefNannySetupContext("__str__", 1);
12658 :
12659 : /* "View.MemoryView":621
12660 : *
12661 : * def __str__(self):
12662 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
12663 : *
12664 : *
12665 : */
12666 0 : __Pyx_XDECREF(__pyx_r);
12667 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12668 0 : __Pyx_GOTREF(__pyx_t_1);
12669 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
12670 0 : __Pyx_GOTREF(__pyx_t_2);
12671 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12672 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12673 0 : __Pyx_GOTREF(__pyx_t_1);
12674 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12675 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
12676 0 : __Pyx_GOTREF(__pyx_t_2);
12677 0 : __Pyx_GIVEREF(__pyx_t_1);
12678 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
12679 0 : __pyx_t_1 = 0;
12680 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12681 0 : __Pyx_GOTREF(__pyx_t_1);
12682 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12683 0 : __pyx_r = __pyx_t_1;
12684 0 : __pyx_t_1 = 0;
12685 0 : goto __pyx_L0;
12686 :
12687 : /* "View.MemoryView":620
12688 : * id(self))
12689 : *
12690 : * def __str__(self): # <<<<<<<<<<<<<<
12691 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12692 : *
12693 : */
12694 :
12695 : /* function exit code */
12696 0 : __pyx_L1_error:;
12697 0 : __Pyx_XDECREF(__pyx_t_1);
12698 0 : __Pyx_XDECREF(__pyx_t_2);
12699 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12700 0 : __pyx_r = NULL;
12701 0 : __pyx_L0:;
12702 0 : __Pyx_XGIVEREF(__pyx_r);
12703 0 : __Pyx_RefNannyFinishContext();
12704 0 : return __pyx_r;
12705 : }
12706 :
12707 : /* "View.MemoryView":624
12708 : *
12709 : *
12710 : * def is_c_contig(self): # <<<<<<<<<<<<<<
12711 : * cdef __Pyx_memviewslice *mslice
12712 : * cdef __Pyx_memviewslice tmp
12713 : */
12714 :
12715 : /* Python wrapper */
12716 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12717 : #if CYTHON_METH_FASTCALL
12718 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12719 : #else
12720 : PyObject *__pyx_args, PyObject *__pyx_kwds
12721 : #endif
12722 : ); /*proto*/
12723 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12724 : #if CYTHON_METH_FASTCALL
12725 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12726 : #else
12727 : PyObject *__pyx_args, PyObject *__pyx_kwds
12728 : #endif
12729 : ) {
12730 : #if !CYTHON_METH_FASTCALL
12731 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12732 : #endif
12733 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12734 0 : PyObject *__pyx_r = 0;
12735 : __Pyx_RefNannyDeclarations
12736 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12737 : #if !CYTHON_METH_FASTCALL
12738 : #if CYTHON_ASSUME_SAFE_MACROS
12739 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12740 : #else
12741 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12742 : #endif
12743 : #endif
12744 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12745 0 : if (unlikely(__pyx_nargs > 0)) {
12746 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12747 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
12748 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12749 :
12750 : /* function exit code */
12751 0 : __Pyx_RefNannyFinishContext();
12752 0 : return __pyx_r;
12753 : }
12754 :
12755 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12756 0 : __Pyx_memviewslice *__pyx_v_mslice;
12757 0 : __Pyx_memviewslice __pyx_v_tmp;
12758 0 : PyObject *__pyx_r = NULL;
12759 : __Pyx_RefNannyDeclarations
12760 0 : __Pyx_memviewslice *__pyx_t_1;
12761 0 : PyObject *__pyx_t_2 = NULL;
12762 0 : int __pyx_lineno = 0;
12763 0 : const char *__pyx_filename = NULL;
12764 0 : int __pyx_clineno = 0;
12765 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
12766 :
12767 : /* "View.MemoryView":627
12768 : * cdef __Pyx_memviewslice *mslice
12769 : * cdef __Pyx_memviewslice tmp
12770 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12771 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12772 : *
12773 : */
12774 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
12775 0 : __pyx_v_mslice = __pyx_t_1;
12776 :
12777 : /* "View.MemoryView":628
12778 : * cdef __Pyx_memviewslice tmp
12779 : * mslice = get_slice_from_memview(self, &tmp)
12780 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12781 : *
12782 : * def is_f_contig(self):
12783 : */
12784 0 : __Pyx_XDECREF(__pyx_r);
12785 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
12786 0 : __Pyx_GOTREF(__pyx_t_2);
12787 0 : __pyx_r = __pyx_t_2;
12788 0 : __pyx_t_2 = 0;
12789 0 : goto __pyx_L0;
12790 :
12791 : /* "View.MemoryView":624
12792 : *
12793 : *
12794 : * def is_c_contig(self): # <<<<<<<<<<<<<<
12795 : * cdef __Pyx_memviewslice *mslice
12796 : * cdef __Pyx_memviewslice tmp
12797 : */
12798 :
12799 : /* function exit code */
12800 0 : __pyx_L1_error:;
12801 0 : __Pyx_XDECREF(__pyx_t_2);
12802 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12803 0 : __pyx_r = NULL;
12804 0 : __pyx_L0:;
12805 0 : __Pyx_XGIVEREF(__pyx_r);
12806 0 : __Pyx_RefNannyFinishContext();
12807 0 : return __pyx_r;
12808 : }
12809 :
12810 : /* "View.MemoryView":630
12811 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12812 : *
12813 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12814 : * cdef __Pyx_memviewslice *mslice
12815 : * cdef __Pyx_memviewslice tmp
12816 : */
12817 :
12818 : /* Python wrapper */
12819 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12820 : #if CYTHON_METH_FASTCALL
12821 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12822 : #else
12823 : PyObject *__pyx_args, PyObject *__pyx_kwds
12824 : #endif
12825 : ); /*proto*/
12826 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12827 : #if CYTHON_METH_FASTCALL
12828 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12829 : #else
12830 : PyObject *__pyx_args, PyObject *__pyx_kwds
12831 : #endif
12832 : ) {
12833 : #if !CYTHON_METH_FASTCALL
12834 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12835 : #endif
12836 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12837 0 : PyObject *__pyx_r = 0;
12838 : __Pyx_RefNannyDeclarations
12839 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12840 : #if !CYTHON_METH_FASTCALL
12841 : #if CYTHON_ASSUME_SAFE_MACROS
12842 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12843 : #else
12844 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12845 : #endif
12846 : #endif
12847 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12848 0 : if (unlikely(__pyx_nargs > 0)) {
12849 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12850 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
12851 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12852 :
12853 : /* function exit code */
12854 0 : __Pyx_RefNannyFinishContext();
12855 0 : return __pyx_r;
12856 : }
12857 :
12858 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12859 0 : __Pyx_memviewslice *__pyx_v_mslice;
12860 0 : __Pyx_memviewslice __pyx_v_tmp;
12861 0 : PyObject *__pyx_r = NULL;
12862 : __Pyx_RefNannyDeclarations
12863 0 : __Pyx_memviewslice *__pyx_t_1;
12864 0 : PyObject *__pyx_t_2 = NULL;
12865 0 : int __pyx_lineno = 0;
12866 0 : const char *__pyx_filename = NULL;
12867 0 : int __pyx_clineno = 0;
12868 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
12869 :
12870 : /* "View.MemoryView":633
12871 : * cdef __Pyx_memviewslice *mslice
12872 : * cdef __Pyx_memviewslice tmp
12873 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12874 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12875 : *
12876 : */
12877 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
12878 0 : __pyx_v_mslice = __pyx_t_1;
12879 :
12880 : /* "View.MemoryView":634
12881 : * cdef __Pyx_memviewslice tmp
12882 : * mslice = get_slice_from_memview(self, &tmp)
12883 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12884 : *
12885 : * def copy(self):
12886 : */
12887 0 : __Pyx_XDECREF(__pyx_r);
12888 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
12889 0 : __Pyx_GOTREF(__pyx_t_2);
12890 0 : __pyx_r = __pyx_t_2;
12891 0 : __pyx_t_2 = 0;
12892 0 : goto __pyx_L0;
12893 :
12894 : /* "View.MemoryView":630
12895 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12896 : *
12897 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12898 : * cdef __Pyx_memviewslice *mslice
12899 : * cdef __Pyx_memviewslice tmp
12900 : */
12901 :
12902 : /* function exit code */
12903 0 : __pyx_L1_error:;
12904 0 : __Pyx_XDECREF(__pyx_t_2);
12905 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12906 0 : __pyx_r = NULL;
12907 0 : __pyx_L0:;
12908 0 : __Pyx_XGIVEREF(__pyx_r);
12909 0 : __Pyx_RefNannyFinishContext();
12910 0 : return __pyx_r;
12911 : }
12912 :
12913 : /* "View.MemoryView":636
12914 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12915 : *
12916 : * def copy(self): # <<<<<<<<<<<<<<
12917 : * cdef __Pyx_memviewslice mslice
12918 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12919 : */
12920 :
12921 : /* Python wrapper */
12922 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12923 : #if CYTHON_METH_FASTCALL
12924 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12925 : #else
12926 : PyObject *__pyx_args, PyObject *__pyx_kwds
12927 : #endif
12928 : ); /*proto*/
12929 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12930 : #if CYTHON_METH_FASTCALL
12931 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12932 : #else
12933 : PyObject *__pyx_args, PyObject *__pyx_kwds
12934 : #endif
12935 : ) {
12936 : #if !CYTHON_METH_FASTCALL
12937 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12938 : #endif
12939 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12940 0 : PyObject *__pyx_r = 0;
12941 : __Pyx_RefNannyDeclarations
12942 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12943 : #if !CYTHON_METH_FASTCALL
12944 : #if CYTHON_ASSUME_SAFE_MACROS
12945 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12946 : #else
12947 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12948 : #endif
12949 : #endif
12950 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12951 0 : if (unlikely(__pyx_nargs > 0)) {
12952 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
12953 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
12954 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12955 :
12956 : /* function exit code */
12957 0 : __Pyx_RefNannyFinishContext();
12958 0 : return __pyx_r;
12959 : }
12960 :
12961 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12962 0 : __Pyx_memviewslice __pyx_v_mslice;
12963 0 : int __pyx_v_flags;
12964 0 : PyObject *__pyx_r = NULL;
12965 : __Pyx_RefNannyDeclarations
12966 0 : __Pyx_memviewslice __pyx_t_1;
12967 0 : PyObject *__pyx_t_2 = NULL;
12968 0 : int __pyx_lineno = 0;
12969 0 : const char *__pyx_filename = NULL;
12970 0 : int __pyx_clineno = 0;
12971 0 : __Pyx_RefNannySetupContext("copy", 1);
12972 :
12973 : /* "View.MemoryView":638
12974 : * def copy(self):
12975 : * cdef __Pyx_memviewslice mslice
12976 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12977 : *
12978 : * slice_copy(self, &mslice)
12979 : */
12980 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12981 :
12982 : /* "View.MemoryView":640
12983 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12984 : *
12985 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12986 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12987 : * self.view.itemsize,
12988 : */
12989 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12990 :
12991 : /* "View.MemoryView":641
12992 : *
12993 : * slice_copy(self, &mslice)
12994 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12995 : * self.view.itemsize,
12996 : * flags|PyBUF_C_CONTIGUOUS,
12997 : */
12998 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
12999 0 : __pyx_v_mslice = __pyx_t_1;
13000 :
13001 : /* "View.MemoryView":646
13002 : * self.dtype_is_object)
13003 : *
13004 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13005 : *
13006 : * def copy_fortran(self):
13007 : */
13008 0 : __Pyx_XDECREF(__pyx_r);
13009 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
13010 0 : __Pyx_GOTREF(__pyx_t_2);
13011 0 : __pyx_r = __pyx_t_2;
13012 0 : __pyx_t_2 = 0;
13013 0 : goto __pyx_L0;
13014 :
13015 : /* "View.MemoryView":636
13016 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13017 : *
13018 : * def copy(self): # <<<<<<<<<<<<<<
13019 : * cdef __Pyx_memviewslice mslice
13020 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13021 : */
13022 :
13023 : /* function exit code */
13024 0 : __pyx_L1_error:;
13025 0 : __Pyx_XDECREF(__pyx_t_2);
13026 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13027 0 : __pyx_r = NULL;
13028 0 : __pyx_L0:;
13029 0 : __Pyx_XGIVEREF(__pyx_r);
13030 0 : __Pyx_RefNannyFinishContext();
13031 0 : return __pyx_r;
13032 : }
13033 :
13034 : /* "View.MemoryView":648
13035 : * return memoryview_copy_from_slice(self, &mslice)
13036 : *
13037 : * def copy_fortran(self): # <<<<<<<<<<<<<<
13038 : * cdef __Pyx_memviewslice src, dst
13039 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13040 : */
13041 :
13042 : /* Python wrapper */
13043 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
13044 : #if CYTHON_METH_FASTCALL
13045 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13046 : #else
13047 : PyObject *__pyx_args, PyObject *__pyx_kwds
13048 : #endif
13049 : ); /*proto*/
13050 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
13051 : #if CYTHON_METH_FASTCALL
13052 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13053 : #else
13054 : PyObject *__pyx_args, PyObject *__pyx_kwds
13055 : #endif
13056 : ) {
13057 : #if !CYTHON_METH_FASTCALL
13058 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
13059 : #endif
13060 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
13061 0 : PyObject *__pyx_r = 0;
13062 : __Pyx_RefNannyDeclarations
13063 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13064 : #if !CYTHON_METH_FASTCALL
13065 : #if CYTHON_ASSUME_SAFE_MACROS
13066 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
13067 : #else
13068 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
13069 : #endif
13070 : #endif
13071 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
13072 0 : if (unlikely(__pyx_nargs > 0)) {
13073 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
13074 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
13075 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13076 :
13077 : /* function exit code */
13078 0 : __Pyx_RefNannyFinishContext();
13079 0 : return __pyx_r;
13080 : }
13081 :
13082 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13083 0 : __Pyx_memviewslice __pyx_v_src;
13084 0 : __Pyx_memviewslice __pyx_v_dst;
13085 0 : int __pyx_v_flags;
13086 0 : PyObject *__pyx_r = NULL;
13087 : __Pyx_RefNannyDeclarations
13088 0 : __Pyx_memviewslice __pyx_t_1;
13089 0 : PyObject *__pyx_t_2 = NULL;
13090 0 : int __pyx_lineno = 0;
13091 0 : const char *__pyx_filename = NULL;
13092 0 : int __pyx_clineno = 0;
13093 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
13094 :
13095 : /* "View.MemoryView":650
13096 : * def copy_fortran(self):
13097 : * cdef __Pyx_memviewslice src, dst
13098 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13099 : *
13100 : * slice_copy(self, &src)
13101 : */
13102 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13103 :
13104 : /* "View.MemoryView":652
13105 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13106 : *
13107 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
13108 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13109 : * self.view.itemsize,
13110 : */
13111 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13112 :
13113 : /* "View.MemoryView":653
13114 : *
13115 : * slice_copy(self, &src)
13116 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13117 : * self.view.itemsize,
13118 : * flags|PyBUF_F_CONTIGUOUS,
13119 : */
13120 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
13121 0 : __pyx_v_dst = __pyx_t_1;
13122 :
13123 : /* "View.MemoryView":658
13124 : * self.dtype_is_object)
13125 : *
13126 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13127 : *
13128 : *
13129 : */
13130 0 : __Pyx_XDECREF(__pyx_r);
13131 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13132 0 : __Pyx_GOTREF(__pyx_t_2);
13133 0 : __pyx_r = __pyx_t_2;
13134 0 : __pyx_t_2 = 0;
13135 0 : goto __pyx_L0;
13136 :
13137 : /* "View.MemoryView":648
13138 : * return memoryview_copy_from_slice(self, &mslice)
13139 : *
13140 : * def copy_fortran(self): # <<<<<<<<<<<<<<
13141 : * cdef __Pyx_memviewslice src, dst
13142 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13143 : */
13144 :
13145 : /* function exit code */
13146 0 : __pyx_L1_error:;
13147 0 : __Pyx_XDECREF(__pyx_t_2);
13148 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13149 0 : __pyx_r = NULL;
13150 0 : __pyx_L0:;
13151 0 : __Pyx_XGIVEREF(__pyx_r);
13152 0 : __Pyx_RefNannyFinishContext();
13153 0 : return __pyx_r;
13154 : }
13155 :
13156 : /* "(tree fragment)":1
13157 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13158 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13159 : * def __setstate_cython__(self, __pyx_state):
13160 : */
13161 :
13162 : /* Python wrapper */
13163 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
13164 : #if CYTHON_METH_FASTCALL
13165 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13166 : #else
13167 : PyObject *__pyx_args, PyObject *__pyx_kwds
13168 : #endif
13169 : ); /*proto*/
13170 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
13171 : #if CYTHON_METH_FASTCALL
13172 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13173 : #else
13174 : PyObject *__pyx_args, PyObject *__pyx_kwds
13175 : #endif
13176 : ) {
13177 : #if !CYTHON_METH_FASTCALL
13178 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
13179 : #endif
13180 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
13181 0 : PyObject *__pyx_r = 0;
13182 : __Pyx_RefNannyDeclarations
13183 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13184 : #if !CYTHON_METH_FASTCALL
13185 : #if CYTHON_ASSUME_SAFE_MACROS
13186 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
13187 : #else
13188 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
13189 : #endif
13190 : #endif
13191 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
13192 0 : if (unlikely(__pyx_nargs > 0)) {
13193 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
13194 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
13195 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13196 :
13197 : /* function exit code */
13198 0 : __Pyx_RefNannyFinishContext();
13199 0 : return __pyx_r;
13200 : }
13201 :
13202 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
13203 0 : PyObject *__pyx_r = NULL;
13204 : __Pyx_RefNannyDeclarations
13205 0 : int __pyx_lineno = 0;
13206 0 : const char *__pyx_filename = NULL;
13207 0 : int __pyx_clineno = 0;
13208 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
13209 :
13210 : /* "(tree fragment)":2
13211 : * def __reduce_cython__(self):
13212 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
13213 : * def __setstate_cython__(self, __pyx_state):
13214 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13215 : */
13216 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
13217 0 : __PYX_ERR(1, 2, __pyx_L1_error)
13218 :
13219 : /* "(tree fragment)":1
13220 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13221 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13222 : * def __setstate_cython__(self, __pyx_state):
13223 : */
13224 :
13225 : /* function exit code */
13226 0 : __pyx_L1_error:;
13227 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13228 0 : __pyx_r = NULL;
13229 0 : __Pyx_XGIVEREF(__pyx_r);
13230 0 : __Pyx_RefNannyFinishContext();
13231 0 : return __pyx_r;
13232 : }
13233 :
13234 : /* "(tree fragment)":3
13235 : * def __reduce_cython__(self):
13236 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13237 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13238 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13239 : */
13240 :
13241 : /* Python wrapper */
13242 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
13243 : #if CYTHON_METH_FASTCALL
13244 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13245 : #else
13246 : PyObject *__pyx_args, PyObject *__pyx_kwds
13247 : #endif
13248 : ); /*proto*/
13249 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
13250 : #if CYTHON_METH_FASTCALL
13251 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13252 : #else
13253 : PyObject *__pyx_args, PyObject *__pyx_kwds
13254 : #endif
13255 : ) {
13256 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
13257 : #if !CYTHON_METH_FASTCALL
13258 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
13259 : #endif
13260 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
13261 0 : PyObject* values[1] = {0};
13262 0 : int __pyx_lineno = 0;
13263 0 : const char *__pyx_filename = NULL;
13264 0 : int __pyx_clineno = 0;
13265 0 : PyObject *__pyx_r = 0;
13266 : __Pyx_RefNannyDeclarations
13267 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13268 : #if !CYTHON_METH_FASTCALL
13269 : #if CYTHON_ASSUME_SAFE_MACROS
13270 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
13271 : #else
13272 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
13273 : #endif
13274 : #endif
13275 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
13276 : {
13277 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
13278 0 : if (__pyx_kwds) {
13279 0 : Py_ssize_t kw_args;
13280 0 : switch (__pyx_nargs) {
13281 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
13282 0 : CYTHON_FALLTHROUGH;
13283 0 : case 0: break;
13284 0 : default: goto __pyx_L5_argtuple_error;
13285 : }
13286 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
13287 0 : switch (__pyx_nargs) {
13288 : case 0:
13289 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
13290 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
13291 0 : kw_args--;
13292 : }
13293 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
13294 0 : else goto __pyx_L5_argtuple_error;
13295 : }
13296 0 : if (unlikely(kw_args > 0)) {
13297 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
13298 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
13299 : }
13300 0 : } else if (unlikely(__pyx_nargs != 1)) {
13301 0 : goto __pyx_L5_argtuple_error;
13302 : } else {
13303 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
13304 : }
13305 0 : __pyx_v___pyx_state = values[0];
13306 : }
13307 0 : goto __pyx_L6_skip;
13308 0 : __pyx_L5_argtuple_error:;
13309 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
13310 0 : __pyx_L6_skip:;
13311 0 : goto __pyx_L4_argument_unpacking_done;
13312 0 : __pyx_L3_error:;
13313 : {
13314 0 : Py_ssize_t __pyx_temp;
13315 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13316 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
13317 : }
13318 : }
13319 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13320 0 : __Pyx_RefNannyFinishContext();
13321 0 : return NULL;
13322 0 : __pyx_L4_argument_unpacking_done:;
13323 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
13324 :
13325 : /* function exit code */
13326 : {
13327 0 : Py_ssize_t __pyx_temp;
13328 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13329 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
13330 : }
13331 : }
13332 : __Pyx_RefNannyFinishContext();
13333 : return __pyx_r;
13334 : }
13335 :
13336 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13337 0 : PyObject *__pyx_r = NULL;
13338 : __Pyx_RefNannyDeclarations
13339 0 : int __pyx_lineno = 0;
13340 0 : const char *__pyx_filename = NULL;
13341 0 : int __pyx_clineno = 0;
13342 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
13343 :
13344 : /* "(tree fragment)":4
13345 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13346 : * def __setstate_cython__(self, __pyx_state):
13347 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
13348 : */
13349 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
13350 0 : __PYX_ERR(1, 4, __pyx_L1_error)
13351 :
13352 : /* "(tree fragment)":3
13353 : * def __reduce_cython__(self):
13354 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13355 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13356 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
13357 : */
13358 :
13359 : /* function exit code */
13360 0 : __pyx_L1_error:;
13361 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13362 0 : __pyx_r = NULL;
13363 0 : __Pyx_XGIVEREF(__pyx_r);
13364 0 : __Pyx_RefNannyFinishContext();
13365 0 : return __pyx_r;
13366 : }
13367 :
13368 : /* "View.MemoryView":662
13369 : *
13370 : * @cname('__pyx_memoryview_new')
13371 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13372 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13373 : * result.typeinfo = typeinfo
13374 : */
13375 :
13376 219 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13377 219 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
13378 219 : PyObject *__pyx_r = NULL;
13379 : __Pyx_RefNannyDeclarations
13380 219 : PyObject *__pyx_t_1 = NULL;
13381 219 : PyObject *__pyx_t_2 = NULL;
13382 219 : PyObject *__pyx_t_3 = NULL;
13383 219 : int __pyx_lineno = 0;
13384 219 : const char *__pyx_filename = NULL;
13385 219 : int __pyx_clineno = 0;
13386 219 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
13387 :
13388 : /* "View.MemoryView":663
13389 : * @cname('__pyx_memoryview_new')
13390 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13391 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13392 : * result.typeinfo = typeinfo
13393 : * return result
13394 : */
13395 219 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
13396 219 : __Pyx_GOTREF(__pyx_t_1);
13397 219 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
13398 219 : __Pyx_GOTREF(__pyx_t_2);
13399 219 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
13400 219 : __Pyx_GOTREF(__pyx_t_3);
13401 219 : __Pyx_INCREF(__pyx_v_o);
13402 219 : __Pyx_GIVEREF(__pyx_v_o);
13403 219 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
13404 219 : __Pyx_GIVEREF(__pyx_t_1);
13405 219 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
13406 219 : __Pyx_GIVEREF(__pyx_t_2);
13407 219 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
13408 219 : __pyx_t_1 = 0;
13409 219 : __pyx_t_2 = 0;
13410 219 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
13411 219 : __Pyx_GOTREF(__pyx_t_2);
13412 219 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13413 219 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13414 219 : __pyx_t_2 = 0;
13415 :
13416 : /* "View.MemoryView":664
13417 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13418 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13419 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13420 : * return result
13421 : *
13422 : */
13423 219 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13424 :
13425 : /* "View.MemoryView":665
13426 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13427 : * result.typeinfo = typeinfo
13428 : * return result # <<<<<<<<<<<<<<
13429 : *
13430 : * @cname('__pyx_memoryview_check')
13431 : */
13432 219 : __Pyx_XDECREF(__pyx_r);
13433 219 : __Pyx_INCREF((PyObject *)__pyx_v_result);
13434 219 : __pyx_r = ((PyObject *)__pyx_v_result);
13435 219 : goto __pyx_L0;
13436 :
13437 : /* "View.MemoryView":662
13438 : *
13439 : * @cname('__pyx_memoryview_new')
13440 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13441 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13442 : * result.typeinfo = typeinfo
13443 : */
13444 :
13445 : /* function exit code */
13446 0 : __pyx_L1_error:;
13447 0 : __Pyx_XDECREF(__pyx_t_1);
13448 0 : __Pyx_XDECREF(__pyx_t_2);
13449 0 : __Pyx_XDECREF(__pyx_t_3);
13450 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13451 0 : __pyx_r = 0;
13452 219 : __pyx_L0:;
13453 219 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
13454 219 : __Pyx_XGIVEREF(__pyx_r);
13455 219 : __Pyx_RefNannyFinishContext();
13456 219 : return __pyx_r;
13457 : }
13458 :
13459 : /* "View.MemoryView":668
13460 : *
13461 : * @cname('__pyx_memoryview_check')
13462 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
13463 : * return isinstance(o, memoryview)
13464 : *
13465 : */
13466 :
13467 219 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13468 219 : int __pyx_r;
13469 219 : int __pyx_t_1;
13470 :
13471 : /* "View.MemoryView":669
13472 : * @cname('__pyx_memoryview_check')
13473 : * cdef inline bint memoryview_check(object o) noexcept:
13474 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13475 : *
13476 : * cdef tuple _unellipsify(object index, int ndim):
13477 : */
13478 219 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13479 219 : __pyx_r = __pyx_t_1;
13480 219 : goto __pyx_L0;
13481 :
13482 : /* "View.MemoryView":668
13483 : *
13484 : * @cname('__pyx_memoryview_check')
13485 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
13486 : * return isinstance(o, memoryview)
13487 : *
13488 : */
13489 :
13490 : /* function exit code */
13491 219 : __pyx_L0:;
13492 219 : return __pyx_r;
13493 : }
13494 :
13495 : /* "View.MemoryView":671
13496 : * return isinstance(o, memoryview)
13497 : *
13498 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13499 : * """
13500 : * Replace all ellipses with full slices and fill incomplete indices with
13501 : */
13502 :
13503 0 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13504 0 : Py_ssize_t __pyx_v_idx;
13505 0 : PyObject *__pyx_v_tup = NULL;
13506 0 : PyObject *__pyx_v_result = NULL;
13507 0 : int __pyx_v_have_slices;
13508 0 : int __pyx_v_seen_ellipsis;
13509 0 : PyObject *__pyx_v_item = NULL;
13510 0 : Py_ssize_t __pyx_v_nslices;
13511 0 : PyObject *__pyx_r = NULL;
13512 : __Pyx_RefNannyDeclarations
13513 0 : PyObject *__pyx_t_1 = NULL;
13514 0 : int __pyx_t_2;
13515 0 : PyObject *__pyx_t_3 = NULL;
13516 0 : Py_ssize_t __pyx_t_4;
13517 0 : Py_ssize_t __pyx_t_5;
13518 0 : Py_UCS4 __pyx_t_6;
13519 0 : PyObject *__pyx_t_7 = NULL;
13520 0 : int __pyx_lineno = 0;
13521 0 : const char *__pyx_filename = NULL;
13522 0 : int __pyx_clineno = 0;
13523 0 : __Pyx_RefNannySetupContext("_unellipsify", 1);
13524 :
13525 : /* "View.MemoryView":677
13526 : * """
13527 : * cdef Py_ssize_t idx
13528 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
13529 : *
13530 : * result = [slice(None)] * ndim
13531 : */
13532 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
13533 0 : if (__pyx_t_2) {
13534 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
13535 : __pyx_t_1 = __pyx_v_index;
13536 : } else {
13537 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
13538 0 : __Pyx_GOTREF(__pyx_t_3);
13539 0 : __Pyx_INCREF(__pyx_v_index);
13540 0 : __Pyx_GIVEREF(__pyx_v_index);
13541 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
13542 0 : __pyx_t_1 = __pyx_t_3;
13543 0 : __pyx_t_3 = 0;
13544 : }
13545 0 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
13546 0 : __pyx_t_1 = 0;
13547 :
13548 : /* "View.MemoryView":679
13549 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
13550 : *
13551 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
13552 : * have_slices = False
13553 : * seen_ellipsis = False
13554 : */
13555 0 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
13556 : __Pyx_GOTREF(__pyx_t_1);
13557 : { Py_ssize_t __pyx_temp;
13558 0 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
13559 0 : __Pyx_INCREF(__pyx_slice__5);
13560 0 : __Pyx_GIVEREF(__pyx_slice__5);
13561 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
13562 : }
13563 : }
13564 0 : __pyx_v_result = ((PyObject*)__pyx_t_1);
13565 0 : __pyx_t_1 = 0;
13566 :
13567 : /* "View.MemoryView":680
13568 : *
13569 : * result = [slice(None)] * ndim
13570 : * have_slices = False # <<<<<<<<<<<<<<
13571 : * seen_ellipsis = False
13572 : * idx = 0
13573 : */
13574 0 : __pyx_v_have_slices = 0;
13575 :
13576 : /* "View.MemoryView":681
13577 : * result = [slice(None)] * ndim
13578 : * have_slices = False
13579 : * seen_ellipsis = False # <<<<<<<<<<<<<<
13580 : * idx = 0
13581 : * for item in tup:
13582 : */
13583 0 : __pyx_v_seen_ellipsis = 0;
13584 :
13585 : /* "View.MemoryView":682
13586 : * have_slices = False
13587 : * seen_ellipsis = False
13588 : * idx = 0 # <<<<<<<<<<<<<<
13589 : * for item in tup:
13590 : * if item is Ellipsis:
13591 : */
13592 0 : __pyx_v_idx = 0;
13593 :
13594 : /* "View.MemoryView":683
13595 : * seen_ellipsis = False
13596 : * idx = 0
13597 : * for item in tup: # <<<<<<<<<<<<<<
13598 : * if item is Ellipsis:
13599 : * if not seen_ellipsis:
13600 : */
13601 0 : if (unlikely(__pyx_v_tup == Py_None)) {
13602 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
13603 0 : __PYX_ERR(1, 683, __pyx_L1_error)
13604 : }
13605 0 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
13606 : __pyx_t_4 = 0;
13607 0 : for (;;) {
13608 0 : {
13609 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
13610 : #if !CYTHON_ASSUME_SAFE_MACROS
13611 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
13612 : #endif
13613 0 : if (__pyx_t_4 >= __pyx_temp) break;
13614 : }
13615 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13616 0 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
13617 : #else
13618 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
13619 : __Pyx_GOTREF(__pyx_t_3);
13620 : #endif
13621 0 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
13622 0 : __pyx_t_3 = 0;
13623 :
13624 : /* "View.MemoryView":684
13625 : * idx = 0
13626 : * for item in tup:
13627 : * if item is Ellipsis: # <<<<<<<<<<<<<<
13628 : * if not seen_ellipsis:
13629 : * idx += ndim - len(tup)
13630 : */
13631 0 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13632 0 : if (__pyx_t_2) {
13633 :
13634 : /* "View.MemoryView":685
13635 : * for item in tup:
13636 : * if item is Ellipsis:
13637 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
13638 : * idx += ndim - len(tup)
13639 : * seen_ellipsis = True
13640 : */
13641 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
13642 0 : if (__pyx_t_2) {
13643 :
13644 : /* "View.MemoryView":686
13645 : * if item is Ellipsis:
13646 : * if not seen_ellipsis:
13647 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
13648 : * seen_ellipsis = True
13649 : * have_slices = True
13650 : */
13651 0 : if (unlikely(__pyx_v_tup == Py_None)) {
13652 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13653 : __PYX_ERR(1, 686, __pyx_L1_error)
13654 : }
13655 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
13656 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
13657 :
13658 : /* "View.MemoryView":687
13659 : * if not seen_ellipsis:
13660 : * idx += ndim - len(tup)
13661 : * seen_ellipsis = True # <<<<<<<<<<<<<<
13662 : * have_slices = True
13663 : * else:
13664 : */
13665 0 : __pyx_v_seen_ellipsis = 1;
13666 :
13667 : /* "View.MemoryView":685
13668 : * for item in tup:
13669 : * if item is Ellipsis:
13670 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
13671 : * idx += ndim - len(tup)
13672 : * seen_ellipsis = True
13673 : */
13674 : }
13675 :
13676 : /* "View.MemoryView":688
13677 : * idx += ndim - len(tup)
13678 : * seen_ellipsis = True
13679 : * have_slices = True # <<<<<<<<<<<<<<
13680 : * else:
13681 : * if isinstance(item, slice):
13682 : */
13683 0 : __pyx_v_have_slices = 1;
13684 :
13685 : /* "View.MemoryView":684
13686 : * idx = 0
13687 : * for item in tup:
13688 : * if item is Ellipsis: # <<<<<<<<<<<<<<
13689 : * if not seen_ellipsis:
13690 : * idx += ndim - len(tup)
13691 : */
13692 0 : goto __pyx_L5;
13693 : }
13694 :
13695 : /* "View.MemoryView":690
13696 : * have_slices = True
13697 : * else:
13698 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
13699 : * have_slices = True
13700 : * elif not PyIndex_Check(item):
13701 : */
13702 : /*else*/ {
13703 0 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
13704 0 : if (__pyx_t_2) {
13705 :
13706 : /* "View.MemoryView":691
13707 : * else:
13708 : * if isinstance(item, slice):
13709 : * have_slices = True # <<<<<<<<<<<<<<
13710 : * elif not PyIndex_Check(item):
13711 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13712 : */
13713 0 : __pyx_v_have_slices = 1;
13714 :
13715 : /* "View.MemoryView":690
13716 : * have_slices = True
13717 : * else:
13718 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
13719 : * have_slices = True
13720 : * elif not PyIndex_Check(item):
13721 : */
13722 0 : goto __pyx_L7;
13723 : }
13724 :
13725 : /* "View.MemoryView":692
13726 : * if isinstance(item, slice):
13727 : * have_slices = True
13728 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13729 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13730 : * result[idx] = item
13731 : */
13732 0 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
13733 0 : if (unlikely(__pyx_t_2)) {
13734 :
13735 : /* "View.MemoryView":693
13736 : * have_slices = True
13737 : * elif not PyIndex_Check(item):
13738 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
13739 : * result[idx] = item
13740 : * idx += 1
13741 : */
13742 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
13743 0 : __Pyx_GOTREF(__pyx_t_3);
13744 0 : __pyx_t_5 = 0;
13745 0 : __pyx_t_6 = 127;
13746 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
13747 0 : __pyx_t_5 += 24;
13748 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
13749 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
13750 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13751 0 : __Pyx_GOTREF(__pyx_t_7);
13752 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
13753 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
13754 0 : __Pyx_GIVEREF(__pyx_t_7);
13755 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
13756 0 : __pyx_t_7 = 0;
13757 0 : __Pyx_INCREF(__pyx_kp_u__6);
13758 0 : __pyx_t_5 += 1;
13759 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
13760 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
13761 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13762 0 : __Pyx_GOTREF(__pyx_t_7);
13763 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13764 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
13765 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13766 0 : __PYX_ERR(1, 693, __pyx_L1_error)
13767 :
13768 : /* "View.MemoryView":692
13769 : * if isinstance(item, slice):
13770 : * have_slices = True
13771 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13772 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13773 : * result[idx] = item
13774 : */
13775 : }
13776 0 : __pyx_L7:;
13777 :
13778 : /* "View.MemoryView":694
13779 : * elif not PyIndex_Check(item):
13780 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13781 : * result[idx] = item # <<<<<<<<<<<<<<
13782 : * idx += 1
13783 : *
13784 : */
13785 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
13786 : }
13787 0 : __pyx_L5:;
13788 :
13789 : /* "View.MemoryView":695
13790 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13791 : * result[idx] = item
13792 : * idx += 1 # <<<<<<<<<<<<<<
13793 : *
13794 : * nslices = ndim - idx
13795 : */
13796 0 : __pyx_v_idx = (__pyx_v_idx + 1);
13797 :
13798 : /* "View.MemoryView":683
13799 : * seen_ellipsis = False
13800 : * idx = 0
13801 : * for item in tup: # <<<<<<<<<<<<<<
13802 : * if item is Ellipsis:
13803 : * if not seen_ellipsis:
13804 : */
13805 : }
13806 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13807 :
13808 : /* "View.MemoryView":697
13809 : * idx += 1
13810 : *
13811 : * nslices = ndim - idx # <<<<<<<<<<<<<<
13812 : * return have_slices or nslices, tuple(result)
13813 : *
13814 : */
13815 0 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
13816 :
13817 : /* "View.MemoryView":698
13818 : *
13819 : * nslices = ndim - idx
13820 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13821 : *
13822 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13823 : */
13824 0 : __Pyx_XDECREF(__pyx_r);
13825 0 : if (!__pyx_v_have_slices) {
13826 0 : } else {
13827 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13828 0 : __Pyx_GOTREF(__pyx_t_7);
13829 0 : __pyx_t_1 = __pyx_t_7;
13830 0 : __pyx_t_7 = 0;
13831 0 : goto __pyx_L9_bool_binop_done;
13832 : }
13833 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13834 : __Pyx_GOTREF(__pyx_t_7);
13835 : __pyx_t_1 = __pyx_t_7;
13836 0 : __pyx_t_7 = 0;
13837 0 : __pyx_L9_bool_binop_done:;
13838 0 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13839 0 : __Pyx_GOTREF(__pyx_t_7);
13840 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
13841 0 : __Pyx_GOTREF(__pyx_t_3);
13842 0 : __Pyx_GIVEREF(__pyx_t_1);
13843 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
13844 0 : __Pyx_GIVEREF(__pyx_t_7);
13845 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
13846 0 : __pyx_t_1 = 0;
13847 0 : __pyx_t_7 = 0;
13848 0 : __pyx_r = ((PyObject*)__pyx_t_3);
13849 0 : __pyx_t_3 = 0;
13850 0 : goto __pyx_L0;
13851 :
13852 : /* "View.MemoryView":671
13853 : * return isinstance(o, memoryview)
13854 : *
13855 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13856 : * """
13857 : * Replace all ellipses with full slices and fill incomplete indices with
13858 : */
13859 :
13860 : /* function exit code */
13861 0 : __pyx_L1_error:;
13862 0 : __Pyx_XDECREF(__pyx_t_1);
13863 0 : __Pyx_XDECREF(__pyx_t_3);
13864 0 : __Pyx_XDECREF(__pyx_t_7);
13865 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13866 0 : __pyx_r = 0;
13867 0 : __pyx_L0:;
13868 0 : __Pyx_XDECREF(__pyx_v_tup);
13869 0 : __Pyx_XDECREF(__pyx_v_result);
13870 0 : __Pyx_XDECREF(__pyx_v_item);
13871 0 : __Pyx_XGIVEREF(__pyx_r);
13872 0 : __Pyx_RefNannyFinishContext();
13873 0 : return __pyx_r;
13874 : }
13875 :
13876 : /* "View.MemoryView":700
13877 : * return have_slices or nslices, tuple(result)
13878 : *
13879 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13880 : * for suboffset in suboffsets[:ndim]:
13881 : * if suboffset >= 0:
13882 : */
13883 :
13884 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13885 0 : Py_ssize_t __pyx_v_suboffset;
13886 0 : int __pyx_r;
13887 0 : Py_ssize_t *__pyx_t_1;
13888 0 : Py_ssize_t *__pyx_t_2;
13889 0 : Py_ssize_t *__pyx_t_3;
13890 0 : int __pyx_t_4;
13891 0 : int __pyx_lineno = 0;
13892 0 : const char *__pyx_filename = NULL;
13893 0 : int __pyx_clineno = 0;
13894 :
13895 : /* "View.MemoryView":701
13896 : *
13897 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13898 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13899 : * if suboffset >= 0:
13900 : * raise ValueError, "Indirect dimensions not supported"
13901 : */
13902 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13903 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13904 0 : __pyx_t_1 = __pyx_t_3;
13905 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
13906 :
13907 : /* "View.MemoryView":702
13908 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13909 : * for suboffset in suboffsets[:ndim]:
13910 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13911 : * raise ValueError, "Indirect dimensions not supported"
13912 : * return 0 # return type just used as an error flag
13913 : */
13914 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
13915 0 : if (unlikely(__pyx_t_4)) {
13916 :
13917 : /* "View.MemoryView":703
13918 : * for suboffset in suboffsets[:ndim]:
13919 : * if suboffset >= 0:
13920 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
13921 : * return 0 # return type just used as an error flag
13922 : *
13923 : */
13924 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
13925 0 : __PYX_ERR(1, 703, __pyx_L1_error)
13926 :
13927 : /* "View.MemoryView":702
13928 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13929 : * for suboffset in suboffsets[:ndim]:
13930 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13931 : * raise ValueError, "Indirect dimensions not supported"
13932 : * return 0 # return type just used as an error flag
13933 : */
13934 : }
13935 : }
13936 :
13937 : /* "View.MemoryView":704
13938 : * if suboffset >= 0:
13939 : * raise ValueError, "Indirect dimensions not supported"
13940 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13941 : *
13942 : *
13943 : */
13944 0 : __pyx_r = 0;
13945 0 : goto __pyx_L0;
13946 :
13947 : /* "View.MemoryView":700
13948 : * return have_slices or nslices, tuple(result)
13949 : *
13950 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13951 : * for suboffset in suboffsets[:ndim]:
13952 : * if suboffset >= 0:
13953 : */
13954 :
13955 : /* function exit code */
13956 0 : __pyx_L1_error:;
13957 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13958 0 : __pyx_r = -1;
13959 0 : __pyx_L0:;
13960 0 : return __pyx_r;
13961 : }
13962 :
13963 : /* "View.MemoryView":711
13964 : *
13965 : * @cname('__pyx_memview_slice')
13966 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13967 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13968 : * cdef bint negative_step
13969 : */
13970 :
13971 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13972 0 : int __pyx_v_new_ndim;
13973 0 : int __pyx_v_suboffset_dim;
13974 0 : int __pyx_v_dim;
13975 0 : __Pyx_memviewslice __pyx_v_src;
13976 0 : __Pyx_memviewslice __pyx_v_dst;
13977 0 : __Pyx_memviewslice *__pyx_v_p_src;
13978 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13979 0 : __Pyx_memviewslice *__pyx_v_p_dst;
13980 0 : int *__pyx_v_p_suboffset_dim;
13981 0 : Py_ssize_t __pyx_v_start;
13982 0 : Py_ssize_t __pyx_v_stop;
13983 0 : Py_ssize_t __pyx_v_step;
13984 0 : Py_ssize_t __pyx_v_cindex;
13985 0 : int __pyx_v_have_start;
13986 0 : int __pyx_v_have_stop;
13987 0 : int __pyx_v_have_step;
13988 0 : PyObject *__pyx_v_index = NULL;
13989 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
13990 : __Pyx_RefNannyDeclarations
13991 0 : int __pyx_t_1;
13992 0 : PyObject *__pyx_t_2 = NULL;
13993 0 : struct __pyx_memoryview_obj *__pyx_t_3;
13994 0 : char *__pyx_t_4;
13995 0 : int __pyx_t_5;
13996 0 : Py_ssize_t __pyx_t_6;
13997 0 : PyObject *(*__pyx_t_7)(PyObject *);
13998 0 : PyObject *__pyx_t_8 = NULL;
13999 0 : Py_ssize_t __pyx_t_9;
14000 0 : int __pyx_t_10;
14001 0 : Py_ssize_t __pyx_t_11;
14002 0 : int __pyx_lineno = 0;
14003 0 : const char *__pyx_filename = NULL;
14004 0 : int __pyx_clineno = 0;
14005 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
14006 :
14007 : /* "View.MemoryView":712
14008 : * @cname('__pyx_memview_slice')
14009 : * cdef memoryview memview_slice(memoryview memview, object indices):
14010 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14011 : * cdef bint negative_step
14012 : * cdef __Pyx_memviewslice src, dst
14013 : */
14014 0 : __pyx_v_new_ndim = 0;
14015 0 : __pyx_v_suboffset_dim = -1;
14016 :
14017 : /* "View.MemoryView":719
14018 : *
14019 : *
14020 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14021 : *
14022 : * cdef _memoryviewslice memviewsliceobj
14023 : */
14024 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14025 :
14026 : /* "View.MemoryView":723
14027 : * cdef _memoryviewslice memviewsliceobj
14028 : *
14029 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14030 : *
14031 : * if isinstance(memview, _memoryviewslice):
14032 : */
14033 : #ifndef CYTHON_WITHOUT_ASSERTIONS
14034 0 : if (unlikely(__pyx_assertions_enabled())) {
14035 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
14036 0 : if (unlikely(!__pyx_t_1)) {
14037 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
14038 0 : __PYX_ERR(1, 723, __pyx_L1_error)
14039 : }
14040 : }
14041 : #else
14042 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
14043 : #endif
14044 :
14045 : /* "View.MemoryView":725
14046 : * assert memview.view.ndim > 0
14047 : *
14048 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14049 : * memviewsliceobj = memview
14050 : * p_src = &memviewsliceobj.from_slice
14051 : */
14052 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14053 0 : if (__pyx_t_1) {
14054 :
14055 : /* "View.MemoryView":726
14056 : *
14057 : * if isinstance(memview, _memoryviewslice):
14058 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
14059 : * p_src = &memviewsliceobj.from_slice
14060 : * else:
14061 : */
14062 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
14063 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
14064 0 : __Pyx_INCREF(__pyx_t_2);
14065 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14066 0 : __pyx_t_2 = 0;
14067 :
14068 : /* "View.MemoryView":727
14069 : * if isinstance(memview, _memoryviewslice):
14070 : * memviewsliceobj = memview
14071 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14072 : * else:
14073 : * slice_copy(memview, &src)
14074 : */
14075 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14076 :
14077 : /* "View.MemoryView":725
14078 : * assert memview.view.ndim > 0
14079 : *
14080 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14081 : * memviewsliceobj = memview
14082 : * p_src = &memviewsliceobj.from_slice
14083 : */
14084 0 : goto __pyx_L3;
14085 : }
14086 :
14087 : /* "View.MemoryView":729
14088 : * p_src = &memviewsliceobj.from_slice
14089 : * else:
14090 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14091 : * p_src = &src
14092 : *
14093 : */
14094 : /*else*/ {
14095 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14096 :
14097 : /* "View.MemoryView":730
14098 : * else:
14099 : * slice_copy(memview, &src)
14100 : * p_src = &src # <<<<<<<<<<<<<<
14101 : *
14102 : *
14103 : */
14104 0 : __pyx_v_p_src = (&__pyx_v_src);
14105 : }
14106 0 : __pyx_L3:;
14107 :
14108 : /* "View.MemoryView":736
14109 : *
14110 : *
14111 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14112 : * dst.data = p_src.data
14113 : *
14114 : */
14115 0 : __pyx_t_3 = __pyx_v_p_src->memview;
14116 0 : __pyx_v_dst.memview = __pyx_t_3;
14117 :
14118 : /* "View.MemoryView":737
14119 : *
14120 : * dst.memview = p_src.memview
14121 : * dst.data = p_src.data # <<<<<<<<<<<<<<
14122 : *
14123 : *
14124 : */
14125 0 : __pyx_t_4 = __pyx_v_p_src->data;
14126 0 : __pyx_v_dst.data = __pyx_t_4;
14127 :
14128 : /* "View.MemoryView":742
14129 : *
14130 : *
14131 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14132 : * cdef int *p_suboffset_dim = &suboffset_dim
14133 : * cdef Py_ssize_t start, stop, step, cindex
14134 : */
14135 0 : __pyx_v_p_dst = (&__pyx_v_dst);
14136 :
14137 : /* "View.MemoryView":743
14138 : *
14139 : * cdef __Pyx_memviewslice *p_dst = &dst
14140 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14141 : * cdef Py_ssize_t start, stop, step, cindex
14142 : * cdef bint have_start, have_stop, have_step
14143 : */
14144 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14145 :
14146 : /* "View.MemoryView":747
14147 : * cdef bint have_start, have_stop, have_step
14148 : *
14149 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14150 : * if PyIndex_Check(index):
14151 : * cindex = index
14152 : */
14153 0 : __pyx_t_5 = 0;
14154 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14155 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
14156 0 : __pyx_t_6 = 0;
14157 0 : __pyx_t_7 = NULL;
14158 : } else {
14159 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
14160 0 : __Pyx_GOTREF(__pyx_t_2);
14161 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
14162 : }
14163 0 : for (;;) {
14164 0 : if (likely(!__pyx_t_7)) {
14165 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
14166 : {
14167 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
14168 : #if !CYTHON_ASSUME_SAFE_MACROS
14169 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
14170 : #endif
14171 0 : if (__pyx_t_6 >= __pyx_temp) break;
14172 : }
14173 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14174 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
14175 : #else
14176 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
14177 : __Pyx_GOTREF(__pyx_t_8);
14178 : #endif
14179 : } else {
14180 : {
14181 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
14182 : #if !CYTHON_ASSUME_SAFE_MACROS
14183 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
14184 : #endif
14185 0 : if (__pyx_t_6 >= __pyx_temp) break;
14186 : }
14187 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14188 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
14189 : #else
14190 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
14191 : __Pyx_GOTREF(__pyx_t_8);
14192 : #endif
14193 : }
14194 : } else {
14195 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
14196 0 : if (unlikely(!__pyx_t_8)) {
14197 0 : PyObject* exc_type = PyErr_Occurred();
14198 0 : if (exc_type) {
14199 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14200 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
14201 : }
14202 : break;
14203 : }
14204 0 : __Pyx_GOTREF(__pyx_t_8);
14205 : }
14206 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
14207 0 : __pyx_t_8 = 0;
14208 0 : __pyx_v_dim = __pyx_t_5;
14209 0 : __pyx_t_5 = (__pyx_t_5 + 1);
14210 :
14211 : /* "View.MemoryView":748
14212 : *
14213 : * for dim, index in enumerate(indices):
14214 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14215 : * cindex = index
14216 : * slice_memviewslice(
14217 : */
14218 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
14219 0 : if (__pyx_t_1) {
14220 :
14221 : /* "View.MemoryView":749
14222 : * for dim, index in enumerate(indices):
14223 : * if PyIndex_Check(index):
14224 : * cindex = index # <<<<<<<<<<<<<<
14225 : * slice_memviewslice(
14226 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14227 : */
14228 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
14229 0 : __pyx_v_cindex = __pyx_t_9;
14230 :
14231 : /* "View.MemoryView":750
14232 : * if PyIndex_Check(index):
14233 : * cindex = index
14234 : * slice_memviewslice( # <<<<<<<<<<<<<<
14235 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14236 : * dim, new_ndim, p_suboffset_dim,
14237 : */
14238 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
14239 :
14240 : /* "View.MemoryView":748
14241 : *
14242 : * for dim, index in enumerate(indices):
14243 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14244 : * cindex = index
14245 : * slice_memviewslice(
14246 : */
14247 0 : goto __pyx_L6;
14248 : }
14249 :
14250 : /* "View.MemoryView":756
14251 : * 0, 0, 0, # have_{start,stop,step}
14252 : * False)
14253 : * elif index is None: # <<<<<<<<<<<<<<
14254 : * p_dst.shape[new_ndim] = 1
14255 : * p_dst.strides[new_ndim] = 0
14256 : */
14257 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
14258 0 : if (__pyx_t_1) {
14259 :
14260 : /* "View.MemoryView":757
14261 : * False)
14262 : * elif index is None:
14263 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14264 : * p_dst.strides[new_ndim] = 0
14265 : * p_dst.suboffsets[new_ndim] = -1
14266 : */
14267 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14268 :
14269 : /* "View.MemoryView":758
14270 : * elif index is None:
14271 : * p_dst.shape[new_ndim] = 1
14272 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14273 : * p_dst.suboffsets[new_ndim] = -1
14274 : * new_ndim += 1
14275 : */
14276 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14277 :
14278 : /* "View.MemoryView":759
14279 : * p_dst.shape[new_ndim] = 1
14280 : * p_dst.strides[new_ndim] = 0
14281 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14282 : * new_ndim += 1
14283 : * else:
14284 : */
14285 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14286 :
14287 : /* "View.MemoryView":760
14288 : * p_dst.strides[new_ndim] = 0
14289 : * p_dst.suboffsets[new_ndim] = -1
14290 : * new_ndim += 1 # <<<<<<<<<<<<<<
14291 : * else:
14292 : * start = index.start or 0
14293 : */
14294 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14295 :
14296 : /* "View.MemoryView":756
14297 : * 0, 0, 0, # have_{start,stop,step}
14298 : * False)
14299 : * elif index is None: # <<<<<<<<<<<<<<
14300 : * p_dst.shape[new_ndim] = 1
14301 : * p_dst.strides[new_ndim] = 0
14302 : */
14303 0 : goto __pyx_L6;
14304 : }
14305 :
14306 : /* "View.MemoryView":762
14307 : * new_ndim += 1
14308 : * else:
14309 : * start = index.start or 0 # <<<<<<<<<<<<<<
14310 : * stop = index.stop or 0
14311 : * step = index.step or 0
14312 : */
14313 : /*else*/ {
14314 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
14315 0 : __Pyx_GOTREF(__pyx_t_8);
14316 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
14317 0 : if (!__pyx_t_1) {
14318 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14319 : } else {
14320 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14321 0 : __pyx_t_9 = __pyx_t_11;
14322 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14323 0 : goto __pyx_L7_bool_binop_done;
14324 : }
14325 : __pyx_t_9 = 0;
14326 0 : __pyx_L7_bool_binop_done:;
14327 0 : __pyx_v_start = __pyx_t_9;
14328 :
14329 : /* "View.MemoryView":763
14330 : * else:
14331 : * start = index.start or 0
14332 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
14333 : * step = index.step or 0
14334 : *
14335 : */
14336 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
14337 0 : __Pyx_GOTREF(__pyx_t_8);
14338 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
14339 0 : if (!__pyx_t_1) {
14340 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14341 : } else {
14342 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
14343 0 : __pyx_t_9 = __pyx_t_11;
14344 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14345 0 : goto __pyx_L9_bool_binop_done;
14346 : }
14347 : __pyx_t_9 = 0;
14348 0 : __pyx_L9_bool_binop_done:;
14349 0 : __pyx_v_stop = __pyx_t_9;
14350 :
14351 : /* "View.MemoryView":764
14352 : * start = index.start or 0
14353 : * stop = index.stop or 0
14354 : * step = index.step or 0 # <<<<<<<<<<<<<<
14355 : *
14356 : * have_start = index.start is not None
14357 : */
14358 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
14359 0 : __Pyx_GOTREF(__pyx_t_8);
14360 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
14361 0 : if (!__pyx_t_1) {
14362 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14363 : } else {
14364 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
14365 0 : __pyx_t_9 = __pyx_t_11;
14366 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14367 0 : goto __pyx_L11_bool_binop_done;
14368 : }
14369 : __pyx_t_9 = 0;
14370 0 : __pyx_L11_bool_binop_done:;
14371 0 : __pyx_v_step = __pyx_t_9;
14372 :
14373 : /* "View.MemoryView":766
14374 : * step = index.step or 0
14375 : *
14376 : * have_start = index.start is not None # <<<<<<<<<<<<<<
14377 : * have_stop = index.stop is not None
14378 : * have_step = index.step is not None
14379 : */
14380 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
14381 0 : __Pyx_GOTREF(__pyx_t_8);
14382 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
14383 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14384 0 : __pyx_v_have_start = __pyx_t_1;
14385 :
14386 : /* "View.MemoryView":767
14387 : *
14388 : * have_start = index.start is not None
14389 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14390 : * have_step = index.step is not None
14391 : *
14392 : */
14393 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
14394 0 : __Pyx_GOTREF(__pyx_t_8);
14395 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
14396 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14397 0 : __pyx_v_have_stop = __pyx_t_1;
14398 :
14399 : /* "View.MemoryView":768
14400 : * have_start = index.start is not None
14401 : * have_stop = index.stop is not None
14402 : * have_step = index.step is not None # <<<<<<<<<<<<<<
14403 : *
14404 : * slice_memviewslice(
14405 : */
14406 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
14407 0 : __Pyx_GOTREF(__pyx_t_8);
14408 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
14409 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14410 0 : __pyx_v_have_step = __pyx_t_1;
14411 :
14412 : /* "View.MemoryView":770
14413 : * have_step = index.step is not None
14414 : *
14415 : * slice_memviewslice( # <<<<<<<<<<<<<<
14416 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14417 : * dim, new_ndim, p_suboffset_dim,
14418 : */
14419 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
14420 :
14421 : /* "View.MemoryView":776
14422 : * have_start, have_stop, have_step,
14423 : * True)
14424 : * new_ndim += 1 # <<<<<<<<<<<<<<
14425 : *
14426 : * if isinstance(memview, _memoryviewslice):
14427 : */
14428 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14429 : }
14430 0 : __pyx_L6:;
14431 :
14432 : /* "View.MemoryView":747
14433 : * cdef bint have_start, have_stop, have_step
14434 : *
14435 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14436 : * if PyIndex_Check(index):
14437 : * cindex = index
14438 : */
14439 : }
14440 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14441 :
14442 : /* "View.MemoryView":778
14443 : * new_ndim += 1
14444 : *
14445 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14446 : * return memoryview_fromslice(dst, new_ndim,
14447 : * memviewsliceobj.to_object_func,
14448 : */
14449 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14450 0 : if (__pyx_t_1) {
14451 :
14452 : /* "View.MemoryView":779
14453 : *
14454 : * if isinstance(memview, _memoryviewslice):
14455 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14456 : * memviewsliceobj.to_object_func,
14457 : * memviewsliceobj.to_dtype_func,
14458 : */
14459 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
14460 :
14461 : /* "View.MemoryView":780
14462 : * if isinstance(memview, _memoryviewslice):
14463 : * return memoryview_fromslice(dst, new_ndim,
14464 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14465 : * memviewsliceobj.to_dtype_func,
14466 : * memview.dtype_is_object)
14467 : */
14468 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
14469 :
14470 : /* "View.MemoryView":781
14471 : * return memoryview_fromslice(dst, new_ndim,
14472 : * memviewsliceobj.to_object_func,
14473 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14474 : * memview.dtype_is_object)
14475 : * else:
14476 : */
14477 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
14478 :
14479 : /* "View.MemoryView":779
14480 : *
14481 : * if isinstance(memview, _memoryviewslice):
14482 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14483 : * memviewsliceobj.to_object_func,
14484 : * memviewsliceobj.to_dtype_func,
14485 : */
14486 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
14487 0 : __Pyx_GOTREF(__pyx_t_2);
14488 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
14489 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14490 0 : __pyx_t_2 = 0;
14491 0 : goto __pyx_L0;
14492 :
14493 : /* "View.MemoryView":778
14494 : * new_ndim += 1
14495 : *
14496 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14497 : * return memoryview_fromslice(dst, new_ndim,
14498 : * memviewsliceobj.to_object_func,
14499 : */
14500 : }
14501 :
14502 : /* "View.MemoryView":784
14503 : * memview.dtype_is_object)
14504 : * else:
14505 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14506 : * memview.dtype_is_object)
14507 : *
14508 : */
14509 : /*else*/ {
14510 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
14511 :
14512 : /* "View.MemoryView":785
14513 : * else:
14514 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14515 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
14516 : *
14517 : *
14518 : */
14519 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
14520 0 : __Pyx_GOTREF(__pyx_t_2);
14521 :
14522 : /* "View.MemoryView":784
14523 : * memview.dtype_is_object)
14524 : * else:
14525 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14526 : * memview.dtype_is_object)
14527 : *
14528 : */
14529 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
14530 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14531 0 : __pyx_t_2 = 0;
14532 0 : goto __pyx_L0;
14533 : }
14534 :
14535 : /* "View.MemoryView":711
14536 : *
14537 : * @cname('__pyx_memview_slice')
14538 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14539 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
14540 : * cdef bint negative_step
14541 : */
14542 :
14543 : /* function exit code */
14544 0 : __pyx_L1_error:;
14545 0 : __Pyx_XDECREF(__pyx_t_2);
14546 0 : __Pyx_XDECREF(__pyx_t_8);
14547 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14548 0 : __pyx_r = 0;
14549 0 : __pyx_L0:;
14550 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14551 0 : __Pyx_XDECREF(__pyx_v_index);
14552 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
14553 0 : __Pyx_RefNannyFinishContext();
14554 0 : return __pyx_r;
14555 : }
14556 :
14557 : /* "View.MemoryView":793
14558 : *
14559 : * @cname('__pyx_memoryview_slice_memviewslice')
14560 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14561 : * __Pyx_memviewslice *dst,
14562 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14563 : */
14564 :
14565 0 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
14566 0 : Py_ssize_t __pyx_v_new_shape;
14567 0 : int __pyx_v_negative_step;
14568 0 : int __pyx_r;
14569 0 : int __pyx_t_1;
14570 0 : int __pyx_t_2;
14571 0 : int __pyx_t_3;
14572 0 : int __pyx_lineno = 0;
14573 0 : const char *__pyx_filename = NULL;
14574 0 : int __pyx_clineno = 0;
14575 : #ifdef WITH_THREAD
14576 0 : PyGILState_STATE __pyx_gilstate_save;
14577 : #endif
14578 :
14579 : /* "View.MemoryView":813
14580 : * cdef bint negative_step
14581 : *
14582 : * if not is_slice: # <<<<<<<<<<<<<<
14583 : *
14584 : * if start < 0:
14585 : */
14586 0 : __pyx_t_1 = (!__pyx_v_is_slice);
14587 0 : if (__pyx_t_1) {
14588 :
14589 : /* "View.MemoryView":815
14590 : * if not is_slice:
14591 : *
14592 : * if start < 0: # <<<<<<<<<<<<<<
14593 : * start += shape
14594 : * if not 0 <= start < shape:
14595 : */
14596 0 : __pyx_t_1 = (__pyx_v_start < 0);
14597 0 : if (__pyx_t_1) {
14598 :
14599 : /* "View.MemoryView":816
14600 : *
14601 : * if start < 0:
14602 : * start += shape # <<<<<<<<<<<<<<
14603 : * if not 0 <= start < shape:
14604 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14605 : */
14606 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14607 :
14608 : /* "View.MemoryView":815
14609 : * if not is_slice:
14610 : *
14611 : * if start < 0: # <<<<<<<<<<<<<<
14612 : * start += shape
14613 : * if not 0 <= start < shape:
14614 : */
14615 : }
14616 :
14617 : /* "View.MemoryView":817
14618 : * if start < 0:
14619 : * start += shape
14620 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14621 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14622 : * else:
14623 : */
14624 0 : __pyx_t_1 = (0 <= __pyx_v_start);
14625 0 : if (__pyx_t_1) {
14626 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14627 : }
14628 0 : __pyx_t_2 = (!__pyx_t_1);
14629 0 : if (__pyx_t_2) {
14630 :
14631 : /* "View.MemoryView":818
14632 : * start += shape
14633 : * if not 0 <= start < shape:
14634 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14635 : * else:
14636 : *
14637 : */
14638 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
14639 :
14640 : /* "View.MemoryView":817
14641 : * if start < 0:
14642 : * start += shape
14643 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14644 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14645 : * else:
14646 : */
14647 : }
14648 :
14649 : /* "View.MemoryView":813
14650 : * cdef bint negative_step
14651 : *
14652 : * if not is_slice: # <<<<<<<<<<<<<<
14653 : *
14654 : * if start < 0:
14655 : */
14656 0 : goto __pyx_L3;
14657 : }
14658 :
14659 : /* "View.MemoryView":821
14660 : * else:
14661 : *
14662 : * if have_step: # <<<<<<<<<<<<<<
14663 : * negative_step = step < 0
14664 : * if step == 0:
14665 : */
14666 : /*else*/ {
14667 0 : __pyx_t_2 = (__pyx_v_have_step != 0);
14668 0 : if (__pyx_t_2) {
14669 :
14670 : /* "View.MemoryView":822
14671 : *
14672 : * if have_step:
14673 : * negative_step = step < 0 # <<<<<<<<<<<<<<
14674 : * if step == 0:
14675 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14676 : */
14677 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
14678 :
14679 : /* "View.MemoryView":823
14680 : * if have_step:
14681 : * negative_step = step < 0
14682 : * if step == 0: # <<<<<<<<<<<<<<
14683 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14684 : * else:
14685 : */
14686 0 : __pyx_t_2 = (__pyx_v_step == 0);
14687 0 : if (__pyx_t_2) {
14688 :
14689 : /* "View.MemoryView":824
14690 : * negative_step = step < 0
14691 : * if step == 0:
14692 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
14693 : * else:
14694 : * negative_step = False
14695 : */
14696 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
14697 :
14698 : /* "View.MemoryView":823
14699 : * if have_step:
14700 : * negative_step = step < 0
14701 : * if step == 0: # <<<<<<<<<<<<<<
14702 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14703 : * else:
14704 : */
14705 : }
14706 :
14707 : /* "View.MemoryView":821
14708 : * else:
14709 : *
14710 : * if have_step: # <<<<<<<<<<<<<<
14711 : * negative_step = step < 0
14712 : * if step == 0:
14713 : */
14714 0 : goto __pyx_L6;
14715 : }
14716 :
14717 : /* "View.MemoryView":826
14718 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14719 : * else:
14720 : * negative_step = False # <<<<<<<<<<<<<<
14721 : * step = 1
14722 : *
14723 : */
14724 : /*else*/ {
14725 : __pyx_v_negative_step = 0;
14726 :
14727 : /* "View.MemoryView":827
14728 : * else:
14729 : * negative_step = False
14730 : * step = 1 # <<<<<<<<<<<<<<
14731 : *
14732 : *
14733 : */
14734 : __pyx_v_step = 1;
14735 : }
14736 0 : __pyx_L6:;
14737 :
14738 : /* "View.MemoryView":830
14739 : *
14740 : *
14741 : * if have_start: # <<<<<<<<<<<<<<
14742 : * if start < 0:
14743 : * start += shape
14744 : */
14745 0 : __pyx_t_2 = (__pyx_v_have_start != 0);
14746 0 : if (__pyx_t_2) {
14747 :
14748 : /* "View.MemoryView":831
14749 : *
14750 : * if have_start:
14751 : * if start < 0: # <<<<<<<<<<<<<<
14752 : * start += shape
14753 : * if start < 0:
14754 : */
14755 0 : __pyx_t_2 = (__pyx_v_start < 0);
14756 0 : if (__pyx_t_2) {
14757 :
14758 : /* "View.MemoryView":832
14759 : * if have_start:
14760 : * if start < 0:
14761 : * start += shape # <<<<<<<<<<<<<<
14762 : * if start < 0:
14763 : * start = 0
14764 : */
14765 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14766 :
14767 : /* "View.MemoryView":833
14768 : * if start < 0:
14769 : * start += shape
14770 : * if start < 0: # <<<<<<<<<<<<<<
14771 : * start = 0
14772 : * elif start >= shape:
14773 : */
14774 0 : __pyx_t_2 = (__pyx_v_start < 0);
14775 0 : if (__pyx_t_2) {
14776 :
14777 : /* "View.MemoryView":834
14778 : * start += shape
14779 : * if start < 0:
14780 : * start = 0 # <<<<<<<<<<<<<<
14781 : * elif start >= shape:
14782 : * if negative_step:
14783 : */
14784 : __pyx_v_start = 0;
14785 :
14786 : /* "View.MemoryView":833
14787 : * if start < 0:
14788 : * start += shape
14789 : * if start < 0: # <<<<<<<<<<<<<<
14790 : * start = 0
14791 : * elif start >= shape:
14792 : */
14793 : }
14794 :
14795 : /* "View.MemoryView":831
14796 : *
14797 : * if have_start:
14798 : * if start < 0: # <<<<<<<<<<<<<<
14799 : * start += shape
14800 : * if start < 0:
14801 : */
14802 0 : goto __pyx_L9;
14803 : }
14804 :
14805 : /* "View.MemoryView":835
14806 : * if start < 0:
14807 : * start = 0
14808 : * elif start >= shape: # <<<<<<<<<<<<<<
14809 : * if negative_step:
14810 : * start = shape - 1
14811 : */
14812 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
14813 0 : if (__pyx_t_2) {
14814 :
14815 : /* "View.MemoryView":836
14816 : * start = 0
14817 : * elif start >= shape:
14818 : * if negative_step: # <<<<<<<<<<<<<<
14819 : * start = shape - 1
14820 : * else:
14821 : */
14822 0 : if (__pyx_v_negative_step) {
14823 :
14824 : /* "View.MemoryView":837
14825 : * elif start >= shape:
14826 : * if negative_step:
14827 : * start = shape - 1 # <<<<<<<<<<<<<<
14828 : * else:
14829 : * start = shape
14830 : */
14831 0 : __pyx_v_start = (__pyx_v_shape - 1);
14832 :
14833 : /* "View.MemoryView":836
14834 : * start = 0
14835 : * elif start >= shape:
14836 : * if negative_step: # <<<<<<<<<<<<<<
14837 : * start = shape - 1
14838 : * else:
14839 : */
14840 0 : goto __pyx_L11;
14841 : }
14842 :
14843 : /* "View.MemoryView":839
14844 : * start = shape - 1
14845 : * else:
14846 : * start = shape # <<<<<<<<<<<<<<
14847 : * else:
14848 : * if negative_step:
14849 : */
14850 : /*else*/ {
14851 : __pyx_v_start = __pyx_v_shape;
14852 : }
14853 0 : __pyx_L11:;
14854 :
14855 : /* "View.MemoryView":835
14856 : * if start < 0:
14857 : * start = 0
14858 : * elif start >= shape: # <<<<<<<<<<<<<<
14859 : * if negative_step:
14860 : * start = shape - 1
14861 : */
14862 : }
14863 0 : __pyx_L9:;
14864 :
14865 : /* "View.MemoryView":830
14866 : *
14867 : *
14868 : * if have_start: # <<<<<<<<<<<<<<
14869 : * if start < 0:
14870 : * start += shape
14871 : */
14872 0 : goto __pyx_L8;
14873 : }
14874 :
14875 : /* "View.MemoryView":841
14876 : * start = shape
14877 : * else:
14878 : * if negative_step: # <<<<<<<<<<<<<<
14879 : * start = shape - 1
14880 : * else:
14881 : */
14882 : /*else*/ {
14883 0 : if (__pyx_v_negative_step) {
14884 :
14885 : /* "View.MemoryView":842
14886 : * else:
14887 : * if negative_step:
14888 : * start = shape - 1 # <<<<<<<<<<<<<<
14889 : * else:
14890 : * start = 0
14891 : */
14892 0 : __pyx_v_start = (__pyx_v_shape - 1);
14893 :
14894 : /* "View.MemoryView":841
14895 : * start = shape
14896 : * else:
14897 : * if negative_step: # <<<<<<<<<<<<<<
14898 : * start = shape - 1
14899 : * else:
14900 : */
14901 0 : goto __pyx_L12;
14902 : }
14903 :
14904 : /* "View.MemoryView":844
14905 : * start = shape - 1
14906 : * else:
14907 : * start = 0 # <<<<<<<<<<<<<<
14908 : *
14909 : * if have_stop:
14910 : */
14911 : /*else*/ {
14912 : __pyx_v_start = 0;
14913 : }
14914 0 : __pyx_L12:;
14915 : }
14916 0 : __pyx_L8:;
14917 :
14918 : /* "View.MemoryView":846
14919 : * start = 0
14920 : *
14921 : * if have_stop: # <<<<<<<<<<<<<<
14922 : * if stop < 0:
14923 : * stop += shape
14924 : */
14925 0 : __pyx_t_2 = (__pyx_v_have_stop != 0);
14926 0 : if (__pyx_t_2) {
14927 :
14928 : /* "View.MemoryView":847
14929 : *
14930 : * if have_stop:
14931 : * if stop < 0: # <<<<<<<<<<<<<<
14932 : * stop += shape
14933 : * if stop < 0:
14934 : */
14935 0 : __pyx_t_2 = (__pyx_v_stop < 0);
14936 0 : if (__pyx_t_2) {
14937 :
14938 : /* "View.MemoryView":848
14939 : * if have_stop:
14940 : * if stop < 0:
14941 : * stop += shape # <<<<<<<<<<<<<<
14942 : * if stop < 0:
14943 : * stop = 0
14944 : */
14945 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14946 :
14947 : /* "View.MemoryView":849
14948 : * if stop < 0:
14949 : * stop += shape
14950 : * if stop < 0: # <<<<<<<<<<<<<<
14951 : * stop = 0
14952 : * elif stop > shape:
14953 : */
14954 0 : __pyx_t_2 = (__pyx_v_stop < 0);
14955 0 : if (__pyx_t_2) {
14956 :
14957 : /* "View.MemoryView":850
14958 : * stop += shape
14959 : * if stop < 0:
14960 : * stop = 0 # <<<<<<<<<<<<<<
14961 : * elif stop > shape:
14962 : * stop = shape
14963 : */
14964 : __pyx_v_stop = 0;
14965 :
14966 : /* "View.MemoryView":849
14967 : * if stop < 0:
14968 : * stop += shape
14969 : * if stop < 0: # <<<<<<<<<<<<<<
14970 : * stop = 0
14971 : * elif stop > shape:
14972 : */
14973 : }
14974 :
14975 : /* "View.MemoryView":847
14976 : *
14977 : * if have_stop:
14978 : * if stop < 0: # <<<<<<<<<<<<<<
14979 : * stop += shape
14980 : * if stop < 0:
14981 : */
14982 0 : goto __pyx_L14;
14983 : }
14984 :
14985 : /* "View.MemoryView":851
14986 : * if stop < 0:
14987 : * stop = 0
14988 : * elif stop > shape: # <<<<<<<<<<<<<<
14989 : * stop = shape
14990 : * else:
14991 : */
14992 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
14993 0 : if (__pyx_t_2) {
14994 :
14995 : /* "View.MemoryView":852
14996 : * stop = 0
14997 : * elif stop > shape:
14998 : * stop = shape # <<<<<<<<<<<<<<
14999 : * else:
15000 : * if negative_step:
15001 : */
15002 : __pyx_v_stop = __pyx_v_shape;
15003 :
15004 : /* "View.MemoryView":851
15005 : * if stop < 0:
15006 : * stop = 0
15007 : * elif stop > shape: # <<<<<<<<<<<<<<
15008 : * stop = shape
15009 : * else:
15010 : */
15011 : }
15012 0 : __pyx_L14:;
15013 :
15014 : /* "View.MemoryView":846
15015 : * start = 0
15016 : *
15017 : * if have_stop: # <<<<<<<<<<<<<<
15018 : * if stop < 0:
15019 : * stop += shape
15020 : */
15021 0 : goto __pyx_L13;
15022 : }
15023 :
15024 : /* "View.MemoryView":854
15025 : * stop = shape
15026 : * else:
15027 : * if negative_step: # <<<<<<<<<<<<<<
15028 : * stop = -1
15029 : * else:
15030 : */
15031 : /*else*/ {
15032 0 : if (__pyx_v_negative_step) {
15033 :
15034 : /* "View.MemoryView":855
15035 : * else:
15036 : * if negative_step:
15037 : * stop = -1 # <<<<<<<<<<<<<<
15038 : * else:
15039 : * stop = shape
15040 : */
15041 0 : __pyx_v_stop = -1L;
15042 :
15043 : /* "View.MemoryView":854
15044 : * stop = shape
15045 : * else:
15046 : * if negative_step: # <<<<<<<<<<<<<<
15047 : * stop = -1
15048 : * else:
15049 : */
15050 0 : goto __pyx_L16;
15051 : }
15052 :
15053 : /* "View.MemoryView":857
15054 : * stop = -1
15055 : * else:
15056 : * stop = shape # <<<<<<<<<<<<<<
15057 : *
15058 : *
15059 : */
15060 : /*else*/ {
15061 : __pyx_v_stop = __pyx_v_shape;
15062 : }
15063 0 : __pyx_L16:;
15064 : }
15065 0 : __pyx_L13:;
15066 :
15067 : /* "View.MemoryView":861
15068 : *
15069 : * with cython.cdivision(True):
15070 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15071 : *
15072 : * if (stop - start) - step * new_shape:
15073 : */
15074 0 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15075 :
15076 : /* "View.MemoryView":863
15077 : * new_shape = (stop - start) // step
15078 : *
15079 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15080 : * new_shape += 1
15081 : *
15082 : */
15083 0 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15084 0 : if (__pyx_t_2) {
15085 :
15086 : /* "View.MemoryView":864
15087 : *
15088 : * if (stop - start) - step * new_shape:
15089 : * new_shape += 1 # <<<<<<<<<<<<<<
15090 : *
15091 : * if new_shape < 0:
15092 : */
15093 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15094 :
15095 : /* "View.MemoryView":863
15096 : * new_shape = (stop - start) // step
15097 : *
15098 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15099 : * new_shape += 1
15100 : *
15101 : */
15102 : }
15103 :
15104 : /* "View.MemoryView":866
15105 : * new_shape += 1
15106 : *
15107 : * if new_shape < 0: # <<<<<<<<<<<<<<
15108 : * new_shape = 0
15109 : *
15110 : */
15111 0 : __pyx_t_2 = (__pyx_v_new_shape < 0);
15112 0 : if (__pyx_t_2) {
15113 :
15114 : /* "View.MemoryView":867
15115 : *
15116 : * if new_shape < 0:
15117 : * new_shape = 0 # <<<<<<<<<<<<<<
15118 : *
15119 : *
15120 : */
15121 : __pyx_v_new_shape = 0;
15122 :
15123 : /* "View.MemoryView":866
15124 : * new_shape += 1
15125 : *
15126 : * if new_shape < 0: # <<<<<<<<<<<<<<
15127 : * new_shape = 0
15128 : *
15129 : */
15130 : }
15131 :
15132 : /* "View.MemoryView":870
15133 : *
15134 : *
15135 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15136 : * dst.shape[new_ndim] = new_shape
15137 : * dst.suboffsets[new_ndim] = suboffset
15138 : */
15139 0 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15140 :
15141 : /* "View.MemoryView":871
15142 : *
15143 : * dst.strides[new_ndim] = stride * step
15144 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15145 : * dst.suboffsets[new_ndim] = suboffset
15146 : *
15147 : */
15148 0 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15149 :
15150 : /* "View.MemoryView":872
15151 : * dst.strides[new_ndim] = stride * step
15152 : * dst.shape[new_ndim] = new_shape
15153 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15154 : *
15155 : *
15156 : */
15157 0 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15158 : }
15159 0 : __pyx_L3:;
15160 :
15161 : /* "View.MemoryView":875
15162 : *
15163 : *
15164 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15165 : * dst.data += start * stride
15166 : * else:
15167 : */
15168 0 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
15169 0 : if (__pyx_t_2) {
15170 :
15171 : /* "View.MemoryView":876
15172 : *
15173 : * if suboffset_dim[0] < 0:
15174 : * dst.data += start * stride # <<<<<<<<<<<<<<
15175 : * else:
15176 : * dst.suboffsets[suboffset_dim[0]] += start * stride
15177 : */
15178 0 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15179 :
15180 : /* "View.MemoryView":875
15181 : *
15182 : *
15183 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15184 : * dst.data += start * stride
15185 : * else:
15186 : */
15187 0 : goto __pyx_L19;
15188 : }
15189 :
15190 : /* "View.MemoryView":878
15191 : * dst.data += start * stride
15192 : * else:
15193 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15194 : *
15195 : * if suboffset >= 0:
15196 : */
15197 : /*else*/ {
15198 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15199 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15200 : }
15201 0 : __pyx_L19:;
15202 :
15203 : /* "View.MemoryView":880
15204 : * dst.suboffsets[suboffset_dim[0]] += start * stride
15205 : *
15206 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15207 : * if not is_slice:
15208 : * if new_ndim == 0:
15209 : */
15210 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
15211 0 : if (__pyx_t_2) {
15212 :
15213 : /* "View.MemoryView":881
15214 : *
15215 : * if suboffset >= 0:
15216 : * if not is_slice: # <<<<<<<<<<<<<<
15217 : * if new_ndim == 0:
15218 : * dst.data = (<char **> dst.data)[0] + suboffset
15219 : */
15220 0 : __pyx_t_2 = (!__pyx_v_is_slice);
15221 0 : if (__pyx_t_2) {
15222 :
15223 : /* "View.MemoryView":882
15224 : * if suboffset >= 0:
15225 : * if not is_slice:
15226 : * if new_ndim == 0: # <<<<<<<<<<<<<<
15227 : * dst.data = (<char **> dst.data)[0] + suboffset
15228 : * else:
15229 : */
15230 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
15231 0 : if (__pyx_t_2) {
15232 :
15233 : /* "View.MemoryView":883
15234 : * if not is_slice:
15235 : * if new_ndim == 0:
15236 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15237 : * else:
15238 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
15239 : */
15240 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15241 :
15242 : /* "View.MemoryView":882
15243 : * if suboffset >= 0:
15244 : * if not is_slice:
15245 : * if new_ndim == 0: # <<<<<<<<<<<<<<
15246 : * dst.data = (<char **> dst.data)[0] + suboffset
15247 : * else:
15248 : */
15249 0 : goto __pyx_L22;
15250 : }
15251 :
15252 : /* "View.MemoryView":885
15253 : * dst.data = (<char **> dst.data)[0] + suboffset
15254 : * else:
15255 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15256 : * "must be indexed and not sliced", dim)
15257 : * else:
15258 : */
15259 : /*else*/ {
15260 :
15261 : /* "View.MemoryView":886
15262 : * else:
15263 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
15264 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15265 : * else:
15266 : * suboffset_dim[0] = new_ndim
15267 : */
15268 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
15269 : }
15270 0 : __pyx_L22:;
15271 :
15272 : /* "View.MemoryView":881
15273 : *
15274 : * if suboffset >= 0:
15275 : * if not is_slice: # <<<<<<<<<<<<<<
15276 : * if new_ndim == 0:
15277 : * dst.data = (<char **> dst.data)[0] + suboffset
15278 : */
15279 0 : goto __pyx_L21;
15280 : }
15281 :
15282 : /* "View.MemoryView":888
15283 : * "must be indexed and not sliced", dim)
15284 : * else:
15285 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15286 : *
15287 : * return 0
15288 : */
15289 : /*else*/ {
15290 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15291 : }
15292 0 : __pyx_L21:;
15293 :
15294 : /* "View.MemoryView":880
15295 : * dst.suboffsets[suboffset_dim[0]] += start * stride
15296 : *
15297 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15298 : * if not is_slice:
15299 : * if new_ndim == 0:
15300 : */
15301 : }
15302 :
15303 : /* "View.MemoryView":890
15304 : * suboffset_dim[0] = new_ndim
15305 : *
15306 : * return 0 # <<<<<<<<<<<<<<
15307 : *
15308 : *
15309 : */
15310 0 : __pyx_r = 0;
15311 0 : goto __pyx_L0;
15312 :
15313 : /* "View.MemoryView":793
15314 : *
15315 : * @cname('__pyx_memoryview_slice_memviewslice')
15316 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15317 : * __Pyx_memviewslice *dst,
15318 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15319 : */
15320 :
15321 : /* function exit code */
15322 0 : __pyx_L1_error:;
15323 : #ifdef WITH_THREAD
15324 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15325 : #endif
15326 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15327 0 : __pyx_r = -1;
15328 : #ifdef WITH_THREAD
15329 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
15330 : #endif
15331 0 : __pyx_L0:;
15332 0 : return __pyx_r;
15333 : }
15334 :
15335 : /* "View.MemoryView":896
15336 : *
15337 : * @cname('__pyx_pybuffer_index')
15338 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15339 : * Py_ssize_t dim) except NULL:
15340 : * cdef Py_ssize_t shape, stride, suboffset = -1
15341 : */
15342 :
15343 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15344 0 : Py_ssize_t __pyx_v_shape;
15345 0 : Py_ssize_t __pyx_v_stride;
15346 0 : Py_ssize_t __pyx_v_suboffset;
15347 0 : Py_ssize_t __pyx_v_itemsize;
15348 0 : char *__pyx_v_resultp;
15349 0 : char *__pyx_r;
15350 : __Pyx_RefNannyDeclarations
15351 0 : Py_ssize_t __pyx_t_1;
15352 0 : int __pyx_t_2;
15353 0 : PyObject *__pyx_t_3 = NULL;
15354 0 : Py_UCS4 __pyx_t_4;
15355 0 : PyObject *__pyx_t_5 = NULL;
15356 0 : int __pyx_lineno = 0;
15357 0 : const char *__pyx_filename = NULL;
15358 0 : int __pyx_clineno = 0;
15359 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
15360 :
15361 : /* "View.MemoryView":898
15362 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
15363 : * Py_ssize_t dim) except NULL:
15364 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
15365 : * cdef Py_ssize_t itemsize = view.itemsize
15366 : * cdef char *resultp
15367 : */
15368 0 : __pyx_v_suboffset = -1L;
15369 :
15370 : /* "View.MemoryView":899
15371 : * Py_ssize_t dim) except NULL:
15372 : * cdef Py_ssize_t shape, stride, suboffset = -1
15373 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
15374 : * cdef char *resultp
15375 : *
15376 : */
15377 0 : __pyx_t_1 = __pyx_v_view->itemsize;
15378 0 : __pyx_v_itemsize = __pyx_t_1;
15379 :
15380 : /* "View.MemoryView":902
15381 : * cdef char *resultp
15382 : *
15383 : * if view.ndim == 0: # <<<<<<<<<<<<<<
15384 : * shape = view.len // itemsize
15385 : * stride = itemsize
15386 : */
15387 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
15388 0 : if (__pyx_t_2) {
15389 :
15390 : /* "View.MemoryView":903
15391 : *
15392 : * if view.ndim == 0:
15393 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
15394 : * stride = itemsize
15395 : * else:
15396 : */
15397 0 : if (unlikely(__pyx_v_itemsize == 0)) {
15398 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
15399 0 : __PYX_ERR(1, 903, __pyx_L1_error)
15400 : }
15401 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15402 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
15403 0 : __PYX_ERR(1, 903, __pyx_L1_error)
15404 : }
15405 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
15406 :
15407 : /* "View.MemoryView":904
15408 : * if view.ndim == 0:
15409 : * shape = view.len // itemsize
15410 : * stride = itemsize # <<<<<<<<<<<<<<
15411 : * else:
15412 : * shape = view.shape[dim]
15413 : */
15414 0 : __pyx_v_stride = __pyx_v_itemsize;
15415 :
15416 : /* "View.MemoryView":902
15417 : * cdef char *resultp
15418 : *
15419 : * if view.ndim == 0: # <<<<<<<<<<<<<<
15420 : * shape = view.len // itemsize
15421 : * stride = itemsize
15422 : */
15423 0 : goto __pyx_L3;
15424 : }
15425 :
15426 : /* "View.MemoryView":906
15427 : * stride = itemsize
15428 : * else:
15429 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
15430 : * stride = view.strides[dim]
15431 : * if view.suboffsets != NULL:
15432 : */
15433 : /*else*/ {
15434 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15435 :
15436 : /* "View.MemoryView":907
15437 : * else:
15438 : * shape = view.shape[dim]
15439 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
15440 : * if view.suboffsets != NULL:
15441 : * suboffset = view.suboffsets[dim]
15442 : */
15443 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15444 :
15445 : /* "View.MemoryView":908
15446 : * shape = view.shape[dim]
15447 : * stride = view.strides[dim]
15448 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15449 : * suboffset = view.suboffsets[dim]
15450 : *
15451 : */
15452 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
15453 0 : if (__pyx_t_2) {
15454 :
15455 : /* "View.MemoryView":909
15456 : * stride = view.strides[dim]
15457 : * if view.suboffsets != NULL:
15458 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
15459 : *
15460 : * if index < 0:
15461 : */
15462 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15463 :
15464 : /* "View.MemoryView":908
15465 : * shape = view.shape[dim]
15466 : * stride = view.strides[dim]
15467 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15468 : * suboffset = view.suboffsets[dim]
15469 : *
15470 : */
15471 : }
15472 : }
15473 0 : __pyx_L3:;
15474 :
15475 : /* "View.MemoryView":911
15476 : * suboffset = view.suboffsets[dim]
15477 : *
15478 : * if index < 0: # <<<<<<<<<<<<<<
15479 : * index += view.shape[dim]
15480 : * if index < 0:
15481 : */
15482 0 : __pyx_t_2 = (__pyx_v_index < 0);
15483 0 : if (__pyx_t_2) {
15484 :
15485 : /* "View.MemoryView":912
15486 : *
15487 : * if index < 0:
15488 : * index += view.shape[dim] # <<<<<<<<<<<<<<
15489 : * if index < 0:
15490 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15491 : */
15492 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15493 :
15494 : /* "View.MemoryView":913
15495 : * if index < 0:
15496 : * index += view.shape[dim]
15497 : * if index < 0: # <<<<<<<<<<<<<<
15498 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15499 : *
15500 : */
15501 0 : __pyx_t_2 = (__pyx_v_index < 0);
15502 0 : if (unlikely(__pyx_t_2)) {
15503 :
15504 : /* "View.MemoryView":914
15505 : * index += view.shape[dim]
15506 : * if index < 0:
15507 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
15508 : *
15509 : * if index >= shape:
15510 : */
15511 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
15512 0 : __Pyx_GOTREF(__pyx_t_3);
15513 0 : __pyx_t_1 = 0;
15514 0 : __pyx_t_4 = 127;
15515 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15516 0 : __pyx_t_1 += 37;
15517 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15518 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15519 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
15520 0 : __Pyx_GOTREF(__pyx_t_5);
15521 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
15522 0 : __Pyx_GIVEREF(__pyx_t_5);
15523 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
15524 0 : __pyx_t_5 = 0;
15525 0 : __Pyx_INCREF(__pyx_kp_u__7);
15526 0 : __pyx_t_1 += 1;
15527 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
15528 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
15529 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
15530 0 : __Pyx_GOTREF(__pyx_t_5);
15531 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15532 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
15533 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15534 0 : __PYX_ERR(1, 914, __pyx_L1_error)
15535 :
15536 : /* "View.MemoryView":913
15537 : * if index < 0:
15538 : * index += view.shape[dim]
15539 : * if index < 0: # <<<<<<<<<<<<<<
15540 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15541 : *
15542 : */
15543 : }
15544 :
15545 : /* "View.MemoryView":911
15546 : * suboffset = view.suboffsets[dim]
15547 : *
15548 : * if index < 0: # <<<<<<<<<<<<<<
15549 : * index += view.shape[dim]
15550 : * if index < 0:
15551 : */
15552 : }
15553 :
15554 : /* "View.MemoryView":916
15555 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15556 : *
15557 : * if index >= shape: # <<<<<<<<<<<<<<
15558 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15559 : *
15560 : */
15561 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
15562 0 : if (unlikely(__pyx_t_2)) {
15563 :
15564 : /* "View.MemoryView":917
15565 : *
15566 : * if index >= shape:
15567 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
15568 : *
15569 : * resultp = bufp + index * stride
15570 : */
15571 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
15572 0 : __Pyx_GOTREF(__pyx_t_5);
15573 0 : __pyx_t_1 = 0;
15574 0 : __pyx_t_4 = 127;
15575 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15576 0 : __pyx_t_1 += 37;
15577 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15578 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15579 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
15580 0 : __Pyx_GOTREF(__pyx_t_3);
15581 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
15582 0 : __Pyx_GIVEREF(__pyx_t_3);
15583 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
15584 0 : __pyx_t_3 = 0;
15585 0 : __Pyx_INCREF(__pyx_kp_u__7);
15586 0 : __pyx_t_1 += 1;
15587 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
15588 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
15589 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
15590 0 : __Pyx_GOTREF(__pyx_t_3);
15591 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15592 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
15593 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15594 0 : __PYX_ERR(1, 917, __pyx_L1_error)
15595 :
15596 : /* "View.MemoryView":916
15597 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15598 : *
15599 : * if index >= shape: # <<<<<<<<<<<<<<
15600 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15601 : *
15602 : */
15603 : }
15604 :
15605 : /* "View.MemoryView":919
15606 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15607 : *
15608 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15609 : * if suboffset >= 0:
15610 : * resultp = (<char **> resultp)[0] + suboffset
15611 : */
15612 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15613 :
15614 : /* "View.MemoryView":920
15615 : *
15616 : * resultp = bufp + index * stride
15617 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15618 : * resultp = (<char **> resultp)[0] + suboffset
15619 : *
15620 : */
15621 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
15622 0 : if (__pyx_t_2) {
15623 :
15624 : /* "View.MemoryView":921
15625 : * resultp = bufp + index * stride
15626 : * if suboffset >= 0:
15627 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15628 : *
15629 : * return resultp
15630 : */
15631 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15632 :
15633 : /* "View.MemoryView":920
15634 : *
15635 : * resultp = bufp + index * stride
15636 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15637 : * resultp = (<char **> resultp)[0] + suboffset
15638 : *
15639 : */
15640 : }
15641 :
15642 : /* "View.MemoryView":923
15643 : * resultp = (<char **> resultp)[0] + suboffset
15644 : *
15645 : * return resultp # <<<<<<<<<<<<<<
15646 : *
15647 : *
15648 : */
15649 0 : __pyx_r = __pyx_v_resultp;
15650 0 : goto __pyx_L0;
15651 :
15652 : /* "View.MemoryView":896
15653 : *
15654 : * @cname('__pyx_pybuffer_index')
15655 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15656 : * Py_ssize_t dim) except NULL:
15657 : * cdef Py_ssize_t shape, stride, suboffset = -1
15658 : */
15659 :
15660 : /* function exit code */
15661 0 : __pyx_L1_error:;
15662 0 : __Pyx_XDECREF(__pyx_t_3);
15663 0 : __Pyx_XDECREF(__pyx_t_5);
15664 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15665 0 : __pyx_r = NULL;
15666 0 : __pyx_L0:;
15667 0 : __Pyx_RefNannyFinishContext();
15668 0 : return __pyx_r;
15669 : }
15670 :
15671 : /* "View.MemoryView":929
15672 : *
15673 : * @cname('__pyx_memslice_transpose')
15674 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
15675 : * cdef int ndim = memslice.memview.view.ndim
15676 : *
15677 : */
15678 :
15679 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15680 0 : int __pyx_v_ndim;
15681 0 : Py_ssize_t *__pyx_v_shape;
15682 0 : Py_ssize_t *__pyx_v_strides;
15683 0 : int __pyx_v_i;
15684 0 : int __pyx_v_j;
15685 0 : int __pyx_r;
15686 0 : int __pyx_t_1;
15687 0 : Py_ssize_t *__pyx_t_2;
15688 0 : long __pyx_t_3;
15689 0 : long __pyx_t_4;
15690 0 : Py_ssize_t __pyx_t_5;
15691 0 : Py_ssize_t __pyx_t_6;
15692 0 : int __pyx_t_7;
15693 0 : int __pyx_t_8;
15694 0 : int __pyx_t_9;
15695 0 : int __pyx_lineno = 0;
15696 0 : const char *__pyx_filename = NULL;
15697 0 : int __pyx_clineno = 0;
15698 : #ifdef WITH_THREAD
15699 0 : PyGILState_STATE __pyx_gilstate_save;
15700 : #endif
15701 :
15702 : /* "View.MemoryView":930
15703 : * @cname('__pyx_memslice_transpose')
15704 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
15705 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
15706 : *
15707 : * cdef Py_ssize_t *shape = memslice.shape
15708 : */
15709 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15710 0 : __pyx_v_ndim = __pyx_t_1;
15711 :
15712 : /* "View.MemoryView":932
15713 : * cdef int ndim = memslice.memview.view.ndim
15714 : *
15715 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
15716 : * cdef Py_ssize_t *strides = memslice.strides
15717 : *
15718 : */
15719 0 : __pyx_t_2 = __pyx_v_memslice->shape;
15720 0 : __pyx_v_shape = __pyx_t_2;
15721 :
15722 : /* "View.MemoryView":933
15723 : *
15724 : * cdef Py_ssize_t *shape = memslice.shape
15725 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15726 : *
15727 : *
15728 : */
15729 0 : __pyx_t_2 = __pyx_v_memslice->strides;
15730 0 : __pyx_v_strides = __pyx_t_2;
15731 :
15732 : /* "View.MemoryView":937
15733 : *
15734 : * cdef int i, j
15735 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
15736 : * j = ndim - 1 - i
15737 : * strides[i], strides[j] = strides[j], strides[i]
15738 : */
15739 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
15740 0 : __pyx_t_4 = __pyx_t_3;
15741 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15742 0 : __pyx_v_i = __pyx_t_1;
15743 :
15744 : /* "View.MemoryView":938
15745 : * cdef int i, j
15746 : * for i in range(ndim // 2):
15747 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
15748 : * strides[i], strides[j] = strides[j], strides[i]
15749 : * shape[i], shape[j] = shape[j], shape[i]
15750 : */
15751 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15752 :
15753 : /* "View.MemoryView":939
15754 : * for i in range(ndim // 2):
15755 : * j = ndim - 1 - i
15756 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15757 : * shape[i], shape[j] = shape[j], shape[i]
15758 : *
15759 : */
15760 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15761 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15762 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15763 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15764 :
15765 : /* "View.MemoryView":940
15766 : * j = ndim - 1 - i
15767 : * strides[i], strides[j] = strides[j], strides[i]
15768 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15769 : *
15770 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15771 : */
15772 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15773 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15774 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15775 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15776 :
15777 : /* "View.MemoryView":942
15778 : * shape[i], shape[j] = shape[j], shape[i]
15779 : *
15780 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15781 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15782 : *
15783 : */
15784 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
15785 0 : if (!__pyx_t_8) {
15786 0 : } else {
15787 0 : __pyx_t_7 = __pyx_t_8;
15788 0 : goto __pyx_L6_bool_binop_done;
15789 : }
15790 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
15791 0 : __pyx_t_7 = __pyx_t_8;
15792 0 : __pyx_L6_bool_binop_done:;
15793 0 : if (__pyx_t_7) {
15794 :
15795 : /* "View.MemoryView":943
15796 : *
15797 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15798 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15799 : *
15800 : * return 0
15801 : */
15802 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
15803 :
15804 : /* "View.MemoryView":942
15805 : * shape[i], shape[j] = shape[j], shape[i]
15806 : *
15807 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15808 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15809 : *
15810 : */
15811 : }
15812 : }
15813 :
15814 : /* "View.MemoryView":945
15815 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15816 : *
15817 : * return 0 # <<<<<<<<<<<<<<
15818 : *
15819 : *
15820 : */
15821 0 : __pyx_r = 0;
15822 0 : goto __pyx_L0;
15823 :
15824 : /* "View.MemoryView":929
15825 : *
15826 : * @cname('__pyx_memslice_transpose')
15827 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
15828 : * cdef int ndim = memslice.memview.view.ndim
15829 : *
15830 : */
15831 :
15832 : /* function exit code */
15833 0 : __pyx_L1_error:;
15834 : #ifdef WITH_THREAD
15835 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15836 : #endif
15837 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15838 0 : __pyx_r = -1;
15839 : #ifdef WITH_THREAD
15840 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
15841 : #endif
15842 0 : __pyx_L0:;
15843 0 : return __pyx_r;
15844 : }
15845 :
15846 : /* "View.MemoryView":963
15847 : * cdef int (*to_dtype_func)(char *, object) except 0
15848 : *
15849 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15850 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15851 : *
15852 : */
15853 :
15854 : /* Python wrapper */
15855 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15856 0 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15857 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15858 : __Pyx_RefNannyDeclarations
15859 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15860 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
15861 0 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15862 :
15863 : /* function exit code */
15864 0 : __Pyx_RefNannyFinishContext();
15865 : }
15866 :
15867 0 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15868 :
15869 : /* "View.MemoryView":964
15870 : *
15871 : * def __dealloc__(self):
15872 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15873 : *
15874 : * cdef convert_item_to_object(self, char *itemp):
15875 : */
15876 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
15877 :
15878 : /* "View.MemoryView":963
15879 : * cdef int (*to_dtype_func)(char *, object) except 0
15880 : *
15881 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15882 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15883 : *
15884 : */
15885 :
15886 : /* function exit code */
15887 : }
15888 :
15889 : /* "View.MemoryView":966
15890 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15891 : *
15892 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15893 : * if self.to_object_func != NULL:
15894 : * return self.to_object_func(itemp)
15895 : */
15896 :
15897 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15898 0 : PyObject *__pyx_r = NULL;
15899 : __Pyx_RefNannyDeclarations
15900 0 : int __pyx_t_1;
15901 0 : PyObject *__pyx_t_2 = NULL;
15902 0 : int __pyx_lineno = 0;
15903 0 : const char *__pyx_filename = NULL;
15904 0 : int __pyx_clineno = 0;
15905 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
15906 :
15907 : /* "View.MemoryView":967
15908 : *
15909 : * cdef convert_item_to_object(self, char *itemp):
15910 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15911 : * return self.to_object_func(itemp)
15912 : * else:
15913 : */
15914 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
15915 0 : if (__pyx_t_1) {
15916 :
15917 : /* "View.MemoryView":968
15918 : * cdef convert_item_to_object(self, char *itemp):
15919 : * if self.to_object_func != NULL:
15920 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15921 : * else:
15922 : * return memoryview.convert_item_to_object(self, itemp)
15923 : */
15924 0 : __Pyx_XDECREF(__pyx_r);
15925 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
15926 0 : __Pyx_GOTREF(__pyx_t_2);
15927 0 : __pyx_r = __pyx_t_2;
15928 0 : __pyx_t_2 = 0;
15929 0 : goto __pyx_L0;
15930 :
15931 : /* "View.MemoryView":967
15932 : *
15933 : * cdef convert_item_to_object(self, char *itemp):
15934 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15935 : * return self.to_object_func(itemp)
15936 : * else:
15937 : */
15938 : }
15939 :
15940 : /* "View.MemoryView":970
15941 : * return self.to_object_func(itemp)
15942 : * else:
15943 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15944 : *
15945 : * cdef assign_item_from_object(self, char *itemp, object value):
15946 : */
15947 : /*else*/ {
15948 0 : __Pyx_XDECREF(__pyx_r);
15949 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
15950 0 : __Pyx_GOTREF(__pyx_t_2);
15951 0 : __pyx_r = __pyx_t_2;
15952 0 : __pyx_t_2 = 0;
15953 0 : goto __pyx_L0;
15954 : }
15955 :
15956 : /* "View.MemoryView":966
15957 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15958 : *
15959 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15960 : * if self.to_object_func != NULL:
15961 : * return self.to_object_func(itemp)
15962 : */
15963 :
15964 : /* function exit code */
15965 0 : __pyx_L1_error:;
15966 0 : __Pyx_XDECREF(__pyx_t_2);
15967 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15968 0 : __pyx_r = 0;
15969 0 : __pyx_L0:;
15970 0 : __Pyx_XGIVEREF(__pyx_r);
15971 0 : __Pyx_RefNannyFinishContext();
15972 0 : return __pyx_r;
15973 : }
15974 :
15975 : /* "View.MemoryView":972
15976 : * return memoryview.convert_item_to_object(self, itemp)
15977 : *
15978 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15979 : * if self.to_dtype_func != NULL:
15980 : * self.to_dtype_func(itemp, value)
15981 : */
15982 :
15983 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15984 0 : PyObject *__pyx_r = NULL;
15985 : __Pyx_RefNannyDeclarations
15986 0 : int __pyx_t_1;
15987 0 : int __pyx_t_2;
15988 0 : PyObject *__pyx_t_3 = NULL;
15989 0 : int __pyx_lineno = 0;
15990 0 : const char *__pyx_filename = NULL;
15991 0 : int __pyx_clineno = 0;
15992 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
15993 :
15994 : /* "View.MemoryView":973
15995 : *
15996 : * cdef assign_item_from_object(self, char *itemp, object value):
15997 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15998 : * self.to_dtype_func(itemp, value)
15999 : * else:
16000 : */
16001 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
16002 0 : if (__pyx_t_1) {
16003 :
16004 : /* "View.MemoryView":974
16005 : * cdef assign_item_from_object(self, char *itemp, object value):
16006 : * if self.to_dtype_func != NULL:
16007 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16008 : * else:
16009 : * memoryview.assign_item_from_object(self, itemp, value)
16010 : */
16011 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
16012 :
16013 : /* "View.MemoryView":973
16014 : *
16015 : * cdef assign_item_from_object(self, char *itemp, object value):
16016 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16017 : * self.to_dtype_func(itemp, value)
16018 : * else:
16019 : */
16020 0 : goto __pyx_L3;
16021 : }
16022 :
16023 : /* "View.MemoryView":976
16024 : * self.to_dtype_func(itemp, value)
16025 : * else:
16026 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16027 : *
16028 : * cdef _get_base(self):
16029 : */
16030 : /*else*/ {
16031 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
16032 0 : __Pyx_GOTREF(__pyx_t_3);
16033 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16034 : }
16035 0 : __pyx_L3:;
16036 :
16037 : /* "View.MemoryView":972
16038 : * return memoryview.convert_item_to_object(self, itemp)
16039 : *
16040 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16041 : * if self.to_dtype_func != NULL:
16042 : * self.to_dtype_func(itemp, value)
16043 : */
16044 :
16045 : /* function exit code */
16046 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16047 0 : goto __pyx_L0;
16048 0 : __pyx_L1_error:;
16049 0 : __Pyx_XDECREF(__pyx_t_3);
16050 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16051 0 : __pyx_r = 0;
16052 0 : __pyx_L0:;
16053 0 : __Pyx_XGIVEREF(__pyx_r);
16054 0 : __Pyx_RefNannyFinishContext();
16055 0 : return __pyx_r;
16056 : }
16057 :
16058 : /* "View.MemoryView":978
16059 : * memoryview.assign_item_from_object(self, itemp, value)
16060 : *
16061 : * cdef _get_base(self): # <<<<<<<<<<<<<<
16062 : * return self.from_object
16063 : *
16064 : */
16065 :
16066 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16067 0 : PyObject *__pyx_r = NULL;
16068 : __Pyx_RefNannyDeclarations
16069 0 : __Pyx_RefNannySetupContext("_get_base", 1);
16070 :
16071 : /* "View.MemoryView":979
16072 : *
16073 : * cdef _get_base(self):
16074 : * return self.from_object # <<<<<<<<<<<<<<
16075 : *
16076 : *
16077 : */
16078 0 : __Pyx_XDECREF(__pyx_r);
16079 0 : __Pyx_INCREF(__pyx_v_self->from_object);
16080 0 : __pyx_r = __pyx_v_self->from_object;
16081 0 : goto __pyx_L0;
16082 :
16083 : /* "View.MemoryView":978
16084 : * memoryview.assign_item_from_object(self, itemp, value)
16085 : *
16086 : * cdef _get_base(self): # <<<<<<<<<<<<<<
16087 : * return self.from_object
16088 : *
16089 : */
16090 :
16091 : /* function exit code */
16092 0 : __pyx_L0:;
16093 0 : __Pyx_XGIVEREF(__pyx_r);
16094 0 : __Pyx_RefNannyFinishContext();
16095 0 : return __pyx_r;
16096 : }
16097 :
16098 : /* "(tree fragment)":1
16099 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16100 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16101 : * def __setstate_cython__(self, __pyx_state):
16102 : */
16103 :
16104 : /* Python wrapper */
16105 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
16106 : #if CYTHON_METH_FASTCALL
16107 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16108 : #else
16109 : PyObject *__pyx_args, PyObject *__pyx_kwds
16110 : #endif
16111 : ); /*proto*/
16112 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
16113 : #if CYTHON_METH_FASTCALL
16114 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16115 : #else
16116 : PyObject *__pyx_args, PyObject *__pyx_kwds
16117 : #endif
16118 : ) {
16119 : #if !CYTHON_METH_FASTCALL
16120 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
16121 : #endif
16122 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
16123 0 : PyObject *__pyx_r = 0;
16124 : __Pyx_RefNannyDeclarations
16125 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16126 : #if !CYTHON_METH_FASTCALL
16127 : #if CYTHON_ASSUME_SAFE_MACROS
16128 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
16129 : #else
16130 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
16131 : #endif
16132 : #endif
16133 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
16134 0 : if (unlikely(__pyx_nargs > 0)) {
16135 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
16136 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
16137 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16138 :
16139 : /* function exit code */
16140 0 : __Pyx_RefNannyFinishContext();
16141 0 : return __pyx_r;
16142 : }
16143 :
16144 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16145 0 : PyObject *__pyx_r = NULL;
16146 : __Pyx_RefNannyDeclarations
16147 0 : int __pyx_lineno = 0;
16148 0 : const char *__pyx_filename = NULL;
16149 0 : int __pyx_clineno = 0;
16150 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
16151 :
16152 : /* "(tree fragment)":2
16153 : * def __reduce_cython__(self):
16154 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
16155 : * def __setstate_cython__(self, __pyx_state):
16156 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16157 : */
16158 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
16159 0 : __PYX_ERR(1, 2, __pyx_L1_error)
16160 :
16161 : /* "(tree fragment)":1
16162 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16163 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16164 : * def __setstate_cython__(self, __pyx_state):
16165 : */
16166 :
16167 : /* function exit code */
16168 0 : __pyx_L1_error:;
16169 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16170 0 : __pyx_r = NULL;
16171 0 : __Pyx_XGIVEREF(__pyx_r);
16172 0 : __Pyx_RefNannyFinishContext();
16173 0 : return __pyx_r;
16174 : }
16175 :
16176 : /* "(tree fragment)":3
16177 : * def __reduce_cython__(self):
16178 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16179 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16180 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16181 : */
16182 :
16183 : /* Python wrapper */
16184 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
16185 : #if CYTHON_METH_FASTCALL
16186 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16187 : #else
16188 : PyObject *__pyx_args, PyObject *__pyx_kwds
16189 : #endif
16190 : ); /*proto*/
16191 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
16192 : #if CYTHON_METH_FASTCALL
16193 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
16194 : #else
16195 : PyObject *__pyx_args, PyObject *__pyx_kwds
16196 : #endif
16197 : ) {
16198 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
16199 : #if !CYTHON_METH_FASTCALL
16200 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
16201 : #endif
16202 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
16203 0 : PyObject* values[1] = {0};
16204 0 : int __pyx_lineno = 0;
16205 0 : const char *__pyx_filename = NULL;
16206 0 : int __pyx_clineno = 0;
16207 0 : PyObject *__pyx_r = 0;
16208 : __Pyx_RefNannyDeclarations
16209 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16210 : #if !CYTHON_METH_FASTCALL
16211 : #if CYTHON_ASSUME_SAFE_MACROS
16212 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
16213 : #else
16214 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
16215 : #endif
16216 : #endif
16217 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
16218 : {
16219 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
16220 0 : if (__pyx_kwds) {
16221 0 : Py_ssize_t kw_args;
16222 0 : switch (__pyx_nargs) {
16223 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
16224 0 : CYTHON_FALLTHROUGH;
16225 0 : case 0: break;
16226 0 : default: goto __pyx_L5_argtuple_error;
16227 : }
16228 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
16229 0 : switch (__pyx_nargs) {
16230 : case 0:
16231 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
16232 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
16233 0 : kw_args--;
16234 : }
16235 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
16236 0 : else goto __pyx_L5_argtuple_error;
16237 : }
16238 0 : if (unlikely(kw_args > 0)) {
16239 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
16240 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
16241 : }
16242 0 : } else if (unlikely(__pyx_nargs != 1)) {
16243 0 : goto __pyx_L5_argtuple_error;
16244 : } else {
16245 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
16246 : }
16247 0 : __pyx_v___pyx_state = values[0];
16248 : }
16249 0 : goto __pyx_L6_skip;
16250 0 : __pyx_L5_argtuple_error:;
16251 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
16252 0 : __pyx_L6_skip:;
16253 0 : goto __pyx_L4_argument_unpacking_done;
16254 0 : __pyx_L3_error:;
16255 : {
16256 0 : Py_ssize_t __pyx_temp;
16257 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
16258 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
16259 : }
16260 : }
16261 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16262 0 : __Pyx_RefNannyFinishContext();
16263 0 : return NULL;
16264 0 : __pyx_L4_argument_unpacking_done:;
16265 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
16266 :
16267 : /* function exit code */
16268 : {
16269 0 : Py_ssize_t __pyx_temp;
16270 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
16271 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
16272 : }
16273 : }
16274 : __Pyx_RefNannyFinishContext();
16275 : return __pyx_r;
16276 : }
16277 :
16278 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16279 0 : PyObject *__pyx_r = NULL;
16280 : __Pyx_RefNannyDeclarations
16281 0 : int __pyx_lineno = 0;
16282 0 : const char *__pyx_filename = NULL;
16283 0 : int __pyx_clineno = 0;
16284 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
16285 :
16286 : /* "(tree fragment)":4
16287 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16288 : * def __setstate_cython__(self, __pyx_state):
16289 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
16290 : */
16291 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
16292 0 : __PYX_ERR(1, 4, __pyx_L1_error)
16293 :
16294 : /* "(tree fragment)":3
16295 : * def __reduce_cython__(self):
16296 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16297 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16298 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
16299 : */
16300 :
16301 : /* function exit code */
16302 0 : __pyx_L1_error:;
16303 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16304 0 : __pyx_r = NULL;
16305 0 : __Pyx_XGIVEREF(__pyx_r);
16306 0 : __Pyx_RefNannyFinishContext();
16307 0 : return __pyx_r;
16308 : }
16309 :
16310 : /* "View.MemoryView":999
16311 : *
16312 : * @cname('__pyx_memoryview_fromslice')
16313 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16314 : * int ndim,
16315 : * object (*to_object_func)(char *),
16316 : */
16317 :
16318 0 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
16319 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16320 0 : Py_ssize_t __pyx_v_suboffset;
16321 0 : PyObject *__pyx_v_length = NULL;
16322 0 : PyObject *__pyx_r = NULL;
16323 : __Pyx_RefNannyDeclarations
16324 0 : int __pyx_t_1;
16325 0 : PyObject *__pyx_t_2 = NULL;
16326 0 : PyObject *__pyx_t_3 = NULL;
16327 0 : __Pyx_TypeInfo *__pyx_t_4;
16328 0 : Py_buffer __pyx_t_5;
16329 0 : Py_ssize_t *__pyx_t_6;
16330 0 : Py_ssize_t *__pyx_t_7;
16331 0 : Py_ssize_t *__pyx_t_8;
16332 0 : Py_ssize_t __pyx_t_9;
16333 0 : int __pyx_lineno = 0;
16334 0 : const char *__pyx_filename = NULL;
16335 0 : int __pyx_clineno = 0;
16336 0 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
16337 :
16338 : /* "View.MemoryView":1007
16339 : * cdef _memoryviewslice result
16340 : *
16341 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16342 : * return None
16343 : *
16344 : */
16345 0 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
16346 0 : if (__pyx_t_1) {
16347 :
16348 : /* "View.MemoryView":1008
16349 : *
16350 : * if <PyObject *> memviewslice.memview == Py_None:
16351 : * return None # <<<<<<<<<<<<<<
16352 : *
16353 : *
16354 : */
16355 0 : __Pyx_XDECREF(__pyx_r);
16356 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16357 0 : goto __pyx_L0;
16358 :
16359 : /* "View.MemoryView":1007
16360 : * cdef _memoryviewslice result
16361 : *
16362 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16363 : * return None
16364 : *
16365 : */
16366 : }
16367 :
16368 : /* "View.MemoryView":1013
16369 : *
16370 : *
16371 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
16372 : *
16373 : * result.from_slice = memviewslice
16374 : */
16375 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16376 0 : __Pyx_GOTREF(__pyx_t_2);
16377 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
16378 0 : __Pyx_GOTREF(__pyx_t_3);
16379 0 : __Pyx_INCREF(Py_None);
16380 0 : __Pyx_GIVEREF(Py_None);
16381 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
16382 0 : __Pyx_INCREF(__pyx_int_0);
16383 0 : __Pyx_GIVEREF(__pyx_int_0);
16384 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
16385 0 : __Pyx_GIVEREF(__pyx_t_2);
16386 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
16387 0 : __pyx_t_2 = 0;
16388 0 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
16389 0 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
16390 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16391 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16392 0 : __pyx_t_2 = 0;
16393 :
16394 : /* "View.MemoryView":1015
16395 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
16396 : *
16397 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
16398 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
16399 : *
16400 : */
16401 0 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
16402 :
16403 : /* "View.MemoryView":1016
16404 : *
16405 : * result.from_slice = memviewslice
16406 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
16407 : *
16408 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
16409 : */
16410 0 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16411 :
16412 : /* "View.MemoryView":1018
16413 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
16414 : *
16415 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
16416 : * result.typeinfo = memviewslice.memview.typeinfo
16417 : *
16418 : */
16419 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
16420 0 : __Pyx_GOTREF(__pyx_t_2);
16421 0 : __Pyx_GIVEREF(__pyx_t_2);
16422 0 : __Pyx_GOTREF(__pyx_v_result->from_object);
16423 0 : __Pyx_DECREF(__pyx_v_result->from_object);
16424 0 : __pyx_v_result->from_object = __pyx_t_2;
16425 0 : __pyx_t_2 = 0;
16426 :
16427 : /* "View.MemoryView":1019
16428 : *
16429 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
16430 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
16431 : *
16432 : * result.view = memviewslice.memview.view
16433 : */
16434 0 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16435 0 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16436 :
16437 : /* "View.MemoryView":1021
16438 : * result.typeinfo = memviewslice.memview.typeinfo
16439 : *
16440 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
16441 : * result.view.buf = <void *> memviewslice.data
16442 : * result.view.ndim = ndim
16443 : */
16444 0 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16445 0 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
16446 :
16447 : /* "View.MemoryView":1022
16448 : *
16449 : * result.view = memviewslice.memview.view
16450 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
16451 : * result.view.ndim = ndim
16452 : * (<__pyx_buffer *> &result.view).obj = Py_None
16453 : */
16454 0 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
16455 :
16456 : /* "View.MemoryView":1023
16457 : * result.view = memviewslice.memview.view
16458 : * result.view.buf = <void *> memviewslice.data
16459 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
16460 : * (<__pyx_buffer *> &result.view).obj = Py_None
16461 : * Py_INCREF(Py_None)
16462 : */
16463 0 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16464 :
16465 : /* "View.MemoryView":1024
16466 : * result.view.buf = <void *> memviewslice.data
16467 : * result.view.ndim = ndim
16468 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
16469 : * Py_INCREF(Py_None)
16470 : *
16471 : */
16472 0 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16473 :
16474 : /* "View.MemoryView":1025
16475 : * result.view.ndim = ndim
16476 : * (<__pyx_buffer *> &result.view).obj = Py_None
16477 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
16478 : *
16479 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16480 : */
16481 0 : Py_INCREF(Py_None);
16482 :
16483 : /* "View.MemoryView":1027
16484 : * Py_INCREF(Py_None)
16485 : *
16486 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16487 : * result.flags = PyBUF_RECORDS
16488 : * else:
16489 : */
16490 0 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16491 0 : if (__pyx_t_1) {
16492 :
16493 : /* "View.MemoryView":1028
16494 : *
16495 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16496 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
16497 : * else:
16498 : * result.flags = PyBUF_RECORDS_RO
16499 : */
16500 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16501 :
16502 : /* "View.MemoryView":1027
16503 : * Py_INCREF(Py_None)
16504 : *
16505 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16506 : * result.flags = PyBUF_RECORDS
16507 : * else:
16508 : */
16509 0 : goto __pyx_L4;
16510 : }
16511 :
16512 : /* "View.MemoryView":1030
16513 : * result.flags = PyBUF_RECORDS
16514 : * else:
16515 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
16516 : *
16517 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16518 : */
16519 : /*else*/ {
16520 0 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16521 : }
16522 0 : __pyx_L4:;
16523 :
16524 : /* "View.MemoryView":1032
16525 : * result.flags = PyBUF_RECORDS_RO
16526 : *
16527 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
16528 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
16529 : *
16530 : */
16531 0 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16532 :
16533 : /* "View.MemoryView":1033
16534 : *
16535 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16536 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
16537 : *
16538 : *
16539 : */
16540 0 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16541 :
16542 : /* "View.MemoryView":1036
16543 : *
16544 : *
16545 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
16546 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16547 : * if suboffset >= 0:
16548 : */
16549 0 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16550 :
16551 : /* "View.MemoryView":1037
16552 : *
16553 : * result.view.suboffsets = NULL
16554 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16555 : * if suboffset >= 0:
16556 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16557 : */
16558 0 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16559 0 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16560 0 : __pyx_t_6 = __pyx_t_8;
16561 0 : __pyx_v_suboffset = (__pyx_t_6[0]);
16562 :
16563 : /* "View.MemoryView":1038
16564 : * result.view.suboffsets = NULL
16565 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16566 : * if suboffset >= 0: # <<<<<<<<<<<<<<
16567 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16568 : * break
16569 : */
16570 0 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
16571 0 : if (__pyx_t_1) {
16572 :
16573 : /* "View.MemoryView":1039
16574 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16575 : * if suboffset >= 0:
16576 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16577 : * break
16578 : *
16579 : */
16580 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16581 :
16582 : /* "View.MemoryView":1040
16583 : * if suboffset >= 0:
16584 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16585 : * break # <<<<<<<<<<<<<<
16586 : *
16587 : * result.view.len = result.view.itemsize
16588 : */
16589 0 : goto __pyx_L6_break;
16590 :
16591 : /* "View.MemoryView":1038
16592 : * result.view.suboffsets = NULL
16593 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16594 : * if suboffset >= 0: # <<<<<<<<<<<<<<
16595 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16596 : * break
16597 : */
16598 : }
16599 : }
16600 0 : __pyx_L6_break:;
16601 :
16602 : /* "View.MemoryView":1042
16603 : * break
16604 : *
16605 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16606 : * for length in result.view.shape[:ndim]:
16607 : * result.view.len *= length
16608 : */
16609 0 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16610 0 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16611 :
16612 : /* "View.MemoryView":1043
16613 : *
16614 : * result.view.len = result.view.itemsize
16615 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16616 : * result.view.len *= length
16617 : *
16618 : */
16619 0 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16620 0 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16621 0 : __pyx_t_6 = __pyx_t_8;
16622 0 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
16623 0 : __Pyx_GOTREF(__pyx_t_2);
16624 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16625 0 : __pyx_t_2 = 0;
16626 :
16627 : /* "View.MemoryView":1044
16628 : * result.view.len = result.view.itemsize
16629 : * for length in result.view.shape[:ndim]:
16630 : * result.view.len *= length # <<<<<<<<<<<<<<
16631 : *
16632 : * result.to_object_func = to_object_func
16633 : */
16634 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
16635 0 : __Pyx_GOTREF(__pyx_t_2);
16636 0 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
16637 0 : __Pyx_GOTREF(__pyx_t_3);
16638 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16639 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
16640 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16641 0 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16642 : }
16643 :
16644 : /* "View.MemoryView":1046
16645 : * result.view.len *= length
16646 : *
16647 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16648 : * result.to_dtype_func = to_dtype_func
16649 : *
16650 : */
16651 0 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16652 :
16653 : /* "View.MemoryView":1047
16654 : *
16655 : * result.to_object_func = to_object_func
16656 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16657 : *
16658 : * return result
16659 : */
16660 0 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16661 :
16662 : /* "View.MemoryView":1049
16663 : * result.to_dtype_func = to_dtype_func
16664 : *
16665 : * return result # <<<<<<<<<<<<<<
16666 : *
16667 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16668 : */
16669 0 : __Pyx_XDECREF(__pyx_r);
16670 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
16671 0 : __pyx_r = ((PyObject *)__pyx_v_result);
16672 0 : goto __pyx_L0;
16673 :
16674 : /* "View.MemoryView":999
16675 : *
16676 : * @cname('__pyx_memoryview_fromslice')
16677 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16678 : * int ndim,
16679 : * object (*to_object_func)(char *),
16680 : */
16681 :
16682 : /* function exit code */
16683 0 : __pyx_L1_error:;
16684 0 : __Pyx_XDECREF(__pyx_t_2);
16685 0 : __Pyx_XDECREF(__pyx_t_3);
16686 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16687 0 : __pyx_r = 0;
16688 0 : __pyx_L0:;
16689 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
16690 0 : __Pyx_XDECREF(__pyx_v_length);
16691 0 : __Pyx_XGIVEREF(__pyx_r);
16692 0 : __Pyx_RefNannyFinishContext();
16693 0 : return __pyx_r;
16694 : }
16695 :
16696 : /* "View.MemoryView":1052
16697 : *
16698 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16699 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16700 : * __Pyx_memviewslice *mslice) except NULL:
16701 : * cdef _memoryviewslice obj
16702 : */
16703 :
16704 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16705 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16706 0 : __Pyx_memviewslice *__pyx_r;
16707 : __Pyx_RefNannyDeclarations
16708 0 : int __pyx_t_1;
16709 0 : PyObject *__pyx_t_2 = NULL;
16710 0 : int __pyx_lineno = 0;
16711 0 : const char *__pyx_filename = NULL;
16712 0 : int __pyx_clineno = 0;
16713 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
16714 :
16715 : /* "View.MemoryView":1055
16716 : * __Pyx_memviewslice *mslice) except NULL:
16717 : * cdef _memoryviewslice obj
16718 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16719 : * obj = memview
16720 : * return &obj.from_slice
16721 : */
16722 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16723 0 : if (__pyx_t_1) {
16724 :
16725 : /* "View.MemoryView":1056
16726 : * cdef _memoryviewslice obj
16727 : * if isinstance(memview, _memoryviewslice):
16728 : * obj = memview # <<<<<<<<<<<<<<
16729 : * return &obj.from_slice
16730 : * else:
16731 : */
16732 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
16733 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
16734 0 : __Pyx_INCREF(__pyx_t_2);
16735 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16736 0 : __pyx_t_2 = 0;
16737 :
16738 : /* "View.MemoryView":1057
16739 : * if isinstance(memview, _memoryviewslice):
16740 : * obj = memview
16741 : * return &obj.from_slice # <<<<<<<<<<<<<<
16742 : * else:
16743 : * slice_copy(memview, mslice)
16744 : */
16745 0 : __pyx_r = (&__pyx_v_obj->from_slice);
16746 0 : goto __pyx_L0;
16747 :
16748 : /* "View.MemoryView":1055
16749 : * __Pyx_memviewslice *mslice) except NULL:
16750 : * cdef _memoryviewslice obj
16751 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16752 : * obj = memview
16753 : * return &obj.from_slice
16754 : */
16755 : }
16756 :
16757 : /* "View.MemoryView":1059
16758 : * return &obj.from_slice
16759 : * else:
16760 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16761 : * return mslice
16762 : *
16763 : */
16764 : /*else*/ {
16765 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16766 :
16767 : /* "View.MemoryView":1060
16768 : * else:
16769 : * slice_copy(memview, mslice)
16770 : * return mslice # <<<<<<<<<<<<<<
16771 : *
16772 : * @cname('__pyx_memoryview_slice_copy')
16773 : */
16774 0 : __pyx_r = __pyx_v_mslice;
16775 0 : goto __pyx_L0;
16776 : }
16777 :
16778 : /* "View.MemoryView":1052
16779 : *
16780 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16781 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16782 : * __Pyx_memviewslice *mslice) except NULL:
16783 : * cdef _memoryviewslice obj
16784 : */
16785 :
16786 : /* function exit code */
16787 0 : __pyx_L1_error:;
16788 0 : __Pyx_XDECREF(__pyx_t_2);
16789 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16790 0 : __pyx_r = NULL;
16791 0 : __pyx_L0:;
16792 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16793 0 : __Pyx_RefNannyFinishContext();
16794 0 : return __pyx_r;
16795 : }
16796 :
16797 : /* "View.MemoryView":1063
16798 : *
16799 : * @cname('__pyx_memoryview_slice_copy')
16800 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16801 : * cdef int dim
16802 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16803 : */
16804 :
16805 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16806 0 : int __pyx_v_dim;
16807 0 : Py_ssize_t *__pyx_v_shape;
16808 0 : Py_ssize_t *__pyx_v_strides;
16809 0 : Py_ssize_t *__pyx_v_suboffsets;
16810 0 : Py_ssize_t *__pyx_t_1;
16811 0 : int __pyx_t_2;
16812 0 : int __pyx_t_3;
16813 0 : int __pyx_t_4;
16814 0 : Py_ssize_t __pyx_t_5;
16815 0 : int __pyx_t_6;
16816 :
16817 : /* "View.MemoryView":1067
16818 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16819 : *
16820 : * shape = memview.view.shape # <<<<<<<<<<<<<<
16821 : * strides = memview.view.strides
16822 : * suboffsets = memview.view.suboffsets
16823 : */
16824 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
16825 0 : __pyx_v_shape = __pyx_t_1;
16826 :
16827 : /* "View.MemoryView":1068
16828 : *
16829 : * shape = memview.view.shape
16830 : * strides = memview.view.strides # <<<<<<<<<<<<<<
16831 : * suboffsets = memview.view.suboffsets
16832 : *
16833 : */
16834 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
16835 0 : __pyx_v_strides = __pyx_t_1;
16836 :
16837 : /* "View.MemoryView":1069
16838 : * shape = memview.view.shape
16839 : * strides = memview.view.strides
16840 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16841 : *
16842 : * dst.memview = <__pyx_memoryview *> memview
16843 : */
16844 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16845 0 : __pyx_v_suboffsets = __pyx_t_1;
16846 :
16847 : /* "View.MemoryView":1071
16848 : * suboffsets = memview.view.suboffsets
16849 : *
16850 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16851 : * dst.data = <char *> memview.view.buf
16852 : *
16853 : */
16854 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16855 :
16856 : /* "View.MemoryView":1072
16857 : *
16858 : * dst.memview = <__pyx_memoryview *> memview
16859 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16860 : *
16861 : * for dim in range(memview.view.ndim):
16862 : */
16863 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16864 :
16865 : /* "View.MemoryView":1074
16866 : * dst.data = <char *> memview.view.buf
16867 : *
16868 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16869 : * dst.shape[dim] = shape[dim]
16870 : * dst.strides[dim] = strides[dim]
16871 : */
16872 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
16873 0 : __pyx_t_3 = __pyx_t_2;
16874 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16875 0 : __pyx_v_dim = __pyx_t_4;
16876 :
16877 : /* "View.MemoryView":1075
16878 : *
16879 : * for dim in range(memview.view.ndim):
16880 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16881 : * dst.strides[dim] = strides[dim]
16882 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16883 : */
16884 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16885 :
16886 : /* "View.MemoryView":1076
16887 : * for dim in range(memview.view.ndim):
16888 : * dst.shape[dim] = shape[dim]
16889 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16890 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16891 : *
16892 : */
16893 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16894 :
16895 : /* "View.MemoryView":1077
16896 : * dst.shape[dim] = shape[dim]
16897 : * dst.strides[dim] = strides[dim]
16898 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16899 : *
16900 : * @cname('__pyx_memoryview_copy_object')
16901 : */
16902 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
16903 0 : if (__pyx_t_6) {
16904 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16905 : } else {
16906 : __pyx_t_5 = -1L;
16907 : }
16908 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16909 : }
16910 :
16911 : /* "View.MemoryView":1063
16912 : *
16913 : * @cname('__pyx_memoryview_slice_copy')
16914 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16915 : * cdef int dim
16916 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16917 : */
16918 :
16919 : /* function exit code */
16920 0 : }
16921 :
16922 : /* "View.MemoryView":1080
16923 : *
16924 : * @cname('__pyx_memoryview_copy_object')
16925 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16926 : * "Create a new memoryview object"
16927 : * cdef __Pyx_memviewslice memviewslice
16928 : */
16929 :
16930 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16931 0 : __Pyx_memviewslice __pyx_v_memviewslice;
16932 0 : PyObject *__pyx_r = NULL;
16933 : __Pyx_RefNannyDeclarations
16934 0 : PyObject *__pyx_t_1 = NULL;
16935 0 : int __pyx_lineno = 0;
16936 0 : const char *__pyx_filename = NULL;
16937 0 : int __pyx_clineno = 0;
16938 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
16939 :
16940 : /* "View.MemoryView":1083
16941 : * "Create a new memoryview object"
16942 : * cdef __Pyx_memviewslice memviewslice
16943 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16944 : * return memoryview_copy_from_slice(memview, &memviewslice)
16945 : *
16946 : */
16947 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16948 :
16949 : /* "View.MemoryView":1084
16950 : * cdef __Pyx_memviewslice memviewslice
16951 : * slice_copy(memview, &memviewslice)
16952 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16953 : *
16954 : * @cname('__pyx_memoryview_copy_object_from_slice')
16955 : */
16956 0 : __Pyx_XDECREF(__pyx_r);
16957 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
16958 0 : __Pyx_GOTREF(__pyx_t_1);
16959 0 : __pyx_r = __pyx_t_1;
16960 0 : __pyx_t_1 = 0;
16961 0 : goto __pyx_L0;
16962 :
16963 : /* "View.MemoryView":1080
16964 : *
16965 : * @cname('__pyx_memoryview_copy_object')
16966 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16967 : * "Create a new memoryview object"
16968 : * cdef __Pyx_memviewslice memviewslice
16969 : */
16970 :
16971 : /* function exit code */
16972 0 : __pyx_L1_error:;
16973 0 : __Pyx_XDECREF(__pyx_t_1);
16974 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16975 0 : __pyx_r = 0;
16976 0 : __pyx_L0:;
16977 0 : __Pyx_XGIVEREF(__pyx_r);
16978 0 : __Pyx_RefNannyFinishContext();
16979 0 : return __pyx_r;
16980 : }
16981 :
16982 : /* "View.MemoryView":1087
16983 : *
16984 : * @cname('__pyx_memoryview_copy_object_from_slice')
16985 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16986 : * """
16987 : * Create a new memoryview object from a given memoryview object and slice.
16988 : */
16989 :
16990 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16991 0 : PyObject *(*__pyx_v_to_object_func)(char *);
16992 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16993 0 : PyObject *__pyx_r = NULL;
16994 : __Pyx_RefNannyDeclarations
16995 0 : int __pyx_t_1;
16996 0 : PyObject *(*__pyx_t_2)(char *);
16997 0 : int (*__pyx_t_3)(char *, PyObject *);
16998 0 : PyObject *__pyx_t_4 = NULL;
16999 0 : int __pyx_lineno = 0;
17000 0 : const char *__pyx_filename = NULL;
17001 0 : int __pyx_clineno = 0;
17002 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
17003 :
17004 : /* "View.MemoryView":1094
17005 : * cdef int (*to_dtype_func)(char *, object) except 0
17006 : *
17007 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17008 : * to_object_func = (<_memoryviewslice> memview).to_object_func
17009 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17010 : */
17011 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17012 0 : if (__pyx_t_1) {
17013 :
17014 : /* "View.MemoryView":1095
17015 : *
17016 : * if isinstance(memview, _memoryviewslice):
17017 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17018 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17019 : * else:
17020 : */
17021 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17022 0 : __pyx_v_to_object_func = __pyx_t_2;
17023 :
17024 : /* "View.MemoryView":1096
17025 : * if isinstance(memview, _memoryviewslice):
17026 : * to_object_func = (<_memoryviewslice> memview).to_object_func
17027 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17028 : * else:
17029 : * to_object_func = NULL
17030 : */
17031 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17032 0 : __pyx_v_to_dtype_func = __pyx_t_3;
17033 :
17034 : /* "View.MemoryView":1094
17035 : * cdef int (*to_dtype_func)(char *, object) except 0
17036 : *
17037 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17038 : * to_object_func = (<_memoryviewslice> memview).to_object_func
17039 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17040 : */
17041 0 : goto __pyx_L3;
17042 : }
17043 :
17044 : /* "View.MemoryView":1098
17045 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17046 : * else:
17047 : * to_object_func = NULL # <<<<<<<<<<<<<<
17048 : * to_dtype_func = NULL
17049 : *
17050 : */
17051 : /*else*/ {
17052 : __pyx_v_to_object_func = NULL;
17053 :
17054 : /* "View.MemoryView":1099
17055 : * else:
17056 : * to_object_func = NULL
17057 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
17058 : *
17059 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17060 : */
17061 : __pyx_v_to_dtype_func = NULL;
17062 : }
17063 0 : __pyx_L3:;
17064 :
17065 : /* "View.MemoryView":1101
17066 : * to_dtype_func = NULL
17067 : *
17068 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17069 : * to_object_func, to_dtype_func,
17070 : * memview.dtype_is_object)
17071 : */
17072 0 : __Pyx_XDECREF(__pyx_r);
17073 :
17074 : /* "View.MemoryView":1103
17075 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17076 : * to_object_func, to_dtype_func,
17077 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
17078 : *
17079 : *
17080 : */
17081 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
17082 0 : __Pyx_GOTREF(__pyx_t_4);
17083 0 : __pyx_r = __pyx_t_4;
17084 0 : __pyx_t_4 = 0;
17085 0 : goto __pyx_L0;
17086 :
17087 : /* "View.MemoryView":1087
17088 : *
17089 : * @cname('__pyx_memoryview_copy_object_from_slice')
17090 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17091 : * """
17092 : * Create a new memoryview object from a given memoryview object and slice.
17093 : */
17094 :
17095 : /* function exit code */
17096 0 : __pyx_L1_error:;
17097 0 : __Pyx_XDECREF(__pyx_t_4);
17098 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17099 0 : __pyx_r = 0;
17100 0 : __pyx_L0:;
17101 0 : __Pyx_XGIVEREF(__pyx_r);
17102 0 : __Pyx_RefNannyFinishContext();
17103 0 : return __pyx_r;
17104 : }
17105 :
17106 : /* "View.MemoryView":1109
17107 : *
17108 : *
17109 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
17110 : * return -arg if arg < 0 else arg
17111 : *
17112 : */
17113 :
17114 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17115 0 : Py_ssize_t __pyx_r;
17116 0 : Py_ssize_t __pyx_t_1;
17117 0 : int __pyx_t_2;
17118 :
17119 : /* "View.MemoryView":1110
17120 : *
17121 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
17122 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
17123 : *
17124 : * @cname('__pyx_get_best_slice_order')
17125 : */
17126 0 : __pyx_t_2 = (__pyx_v_arg < 0);
17127 0 : if (__pyx_t_2) {
17128 : __pyx_t_1 = (-__pyx_v_arg);
17129 : } else {
17130 : __pyx_t_1 = __pyx_v_arg;
17131 : }
17132 0 : __pyx_r = __pyx_t_1;
17133 0 : goto __pyx_L0;
17134 :
17135 : /* "View.MemoryView":1109
17136 : *
17137 : *
17138 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
17139 : * return -arg if arg < 0 else arg
17140 : *
17141 : */
17142 :
17143 : /* function exit code */
17144 0 : __pyx_L0:;
17145 0 : return __pyx_r;
17146 : }
17147 :
17148 : /* "View.MemoryView":1113
17149 : *
17150 : * @cname('__pyx_get_best_slice_order')
17151 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17152 : * """
17153 : * Figure out the best memory access order for a given slice.
17154 : */
17155 :
17156 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17157 0 : int __pyx_v_i;
17158 0 : Py_ssize_t __pyx_v_c_stride;
17159 0 : Py_ssize_t __pyx_v_f_stride;
17160 0 : char __pyx_r;
17161 0 : int __pyx_t_1;
17162 0 : int __pyx_t_2;
17163 0 : int __pyx_t_3;
17164 0 : int __pyx_t_4;
17165 :
17166 : /* "View.MemoryView":1118
17167 : * """
17168 : * cdef int i
17169 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17170 : * cdef Py_ssize_t f_stride = 0
17171 : *
17172 : */
17173 0 : __pyx_v_c_stride = 0;
17174 :
17175 : /* "View.MemoryView":1119
17176 : * cdef int i
17177 : * cdef Py_ssize_t c_stride = 0
17178 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17179 : *
17180 : * for i in range(ndim - 1, -1, -1):
17181 : */
17182 0 : __pyx_v_f_stride = 0;
17183 :
17184 : /* "View.MemoryView":1121
17185 : * cdef Py_ssize_t f_stride = 0
17186 : *
17187 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17188 : * if mslice.shape[i] > 1:
17189 : * c_stride = mslice.strides[i]
17190 : */
17191 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17192 0 : __pyx_v_i = __pyx_t_1;
17193 :
17194 : /* "View.MemoryView":1122
17195 : *
17196 : * for i in range(ndim - 1, -1, -1):
17197 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17198 : * c_stride = mslice.strides[i]
17199 : * break
17200 : */
17201 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
17202 0 : if (__pyx_t_2) {
17203 :
17204 : /* "View.MemoryView":1123
17205 : * for i in range(ndim - 1, -1, -1):
17206 : * if mslice.shape[i] > 1:
17207 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17208 : * break
17209 : *
17210 : */
17211 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17212 :
17213 : /* "View.MemoryView":1124
17214 : * if mslice.shape[i] > 1:
17215 : * c_stride = mslice.strides[i]
17216 : * break # <<<<<<<<<<<<<<
17217 : *
17218 : * for i in range(ndim):
17219 : */
17220 0 : goto __pyx_L4_break;
17221 :
17222 : /* "View.MemoryView":1122
17223 : *
17224 : * for i in range(ndim - 1, -1, -1):
17225 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17226 : * c_stride = mslice.strides[i]
17227 : * break
17228 : */
17229 : }
17230 : }
17231 0 : __pyx_L4_break:;
17232 :
17233 : /* "View.MemoryView":1126
17234 : * break
17235 : *
17236 : * for i in range(ndim): # <<<<<<<<<<<<<<
17237 : * if mslice.shape[i] > 1:
17238 : * f_stride = mslice.strides[i]
17239 : */
17240 0 : __pyx_t_1 = __pyx_v_ndim;
17241 0 : __pyx_t_3 = __pyx_t_1;
17242 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17243 0 : __pyx_v_i = __pyx_t_4;
17244 :
17245 : /* "View.MemoryView":1127
17246 : *
17247 : * for i in range(ndim):
17248 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17249 : * f_stride = mslice.strides[i]
17250 : * break
17251 : */
17252 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
17253 0 : if (__pyx_t_2) {
17254 :
17255 : /* "View.MemoryView":1128
17256 : * for i in range(ndim):
17257 : * if mslice.shape[i] > 1:
17258 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17259 : * break
17260 : *
17261 : */
17262 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17263 :
17264 : /* "View.MemoryView":1129
17265 : * if mslice.shape[i] > 1:
17266 : * f_stride = mslice.strides[i]
17267 : * break # <<<<<<<<<<<<<<
17268 : *
17269 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17270 : */
17271 0 : goto __pyx_L7_break;
17272 :
17273 : /* "View.MemoryView":1127
17274 : *
17275 : * for i in range(ndim):
17276 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17277 : * f_stride = mslice.strides[i]
17278 : * break
17279 : */
17280 : }
17281 : }
17282 0 : __pyx_L7_break:;
17283 :
17284 : /* "View.MemoryView":1131
17285 : * break
17286 : *
17287 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17288 : * return 'C'
17289 : * else:
17290 : */
17291 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
17292 0 : if (__pyx_t_2) {
17293 :
17294 : /* "View.MemoryView":1132
17295 : *
17296 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17297 : * return 'C' # <<<<<<<<<<<<<<
17298 : * else:
17299 : * return 'F'
17300 : */
17301 0 : __pyx_r = 'C';
17302 0 : goto __pyx_L0;
17303 :
17304 : /* "View.MemoryView":1131
17305 : * break
17306 : *
17307 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17308 : * return 'C'
17309 : * else:
17310 : */
17311 : }
17312 :
17313 : /* "View.MemoryView":1134
17314 : * return 'C'
17315 : * else:
17316 : * return 'F' # <<<<<<<<<<<<<<
17317 : *
17318 : * @cython.cdivision(True)
17319 : */
17320 : /*else*/ {
17321 0 : __pyx_r = 'F';
17322 0 : goto __pyx_L0;
17323 : }
17324 :
17325 : /* "View.MemoryView":1113
17326 : *
17327 : * @cname('__pyx_get_best_slice_order')
17328 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17329 : * """
17330 : * Figure out the best memory access order for a given slice.
17331 : */
17332 :
17333 : /* function exit code */
17334 0 : __pyx_L0:;
17335 0 : return __pyx_r;
17336 : }
17337 :
17338 : /* "View.MemoryView":1137
17339 : *
17340 : * @cython.cdivision(True)
17341 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17342 : * char *dst_data, Py_ssize_t *dst_strides,
17343 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17344 : */
17345 :
17346 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17347 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17348 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17349 0 : Py_ssize_t __pyx_v_dst_extent;
17350 0 : Py_ssize_t __pyx_v_src_stride;
17351 0 : Py_ssize_t __pyx_v_dst_stride;
17352 0 : int __pyx_t_1;
17353 0 : int __pyx_t_2;
17354 0 : Py_ssize_t __pyx_t_3;
17355 0 : Py_ssize_t __pyx_t_4;
17356 0 : Py_ssize_t __pyx_t_5;
17357 :
17358 : /* "View.MemoryView":1144
17359 : *
17360 : * cdef Py_ssize_t i
17361 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
17362 : * cdef Py_ssize_t dst_extent = dst_shape[0]
17363 : * cdef Py_ssize_t src_stride = src_strides[0]
17364 : */
17365 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17366 :
17367 : /* "View.MemoryView":1145
17368 : * cdef Py_ssize_t i
17369 : * cdef Py_ssize_t src_extent = src_shape[0]
17370 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
17371 : * cdef Py_ssize_t src_stride = src_strides[0]
17372 : * cdef Py_ssize_t dst_stride = dst_strides[0]
17373 : */
17374 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17375 :
17376 : /* "View.MemoryView":1146
17377 : * cdef Py_ssize_t src_extent = src_shape[0]
17378 : * cdef Py_ssize_t dst_extent = dst_shape[0]
17379 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
17380 : * cdef Py_ssize_t dst_stride = dst_strides[0]
17381 : *
17382 : */
17383 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17384 :
17385 : /* "View.MemoryView":1147
17386 : * cdef Py_ssize_t dst_extent = dst_shape[0]
17387 : * cdef Py_ssize_t src_stride = src_strides[0]
17388 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
17389 : *
17390 : * if ndim == 1:
17391 : */
17392 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17393 :
17394 : /* "View.MemoryView":1149
17395 : * cdef Py_ssize_t dst_stride = dst_strides[0]
17396 : *
17397 : * if ndim == 1: # <<<<<<<<<<<<<<
17398 : * if (src_stride > 0 and dst_stride > 0 and
17399 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17400 : */
17401 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
17402 0 : if (__pyx_t_1) {
17403 :
17404 : /* "View.MemoryView":1150
17405 : *
17406 : * if ndim == 1:
17407 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17408 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17409 : * memcpy(dst_data, src_data, itemsize * dst_extent)
17410 : */
17411 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
17412 0 : if (__pyx_t_2) {
17413 0 : } else {
17414 0 : __pyx_t_1 = __pyx_t_2;
17415 0 : goto __pyx_L5_bool_binop_done;
17416 : }
17417 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
17418 0 : if (__pyx_t_2) {
17419 0 : } else {
17420 0 : __pyx_t_1 = __pyx_t_2;
17421 0 : goto __pyx_L5_bool_binop_done;
17422 : }
17423 :
17424 : /* "View.MemoryView":1151
17425 : * if ndim == 1:
17426 : * if (src_stride > 0 and dst_stride > 0 and
17427 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
17428 : * memcpy(dst_data, src_data, itemsize * dst_extent)
17429 : * else:
17430 : */
17431 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17432 0 : if (__pyx_t_2) {
17433 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17434 : }
17435 : __pyx_t_1 = __pyx_t_2;
17436 0 : __pyx_L5_bool_binop_done:;
17437 :
17438 : /* "View.MemoryView":1150
17439 : *
17440 : * if ndim == 1:
17441 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17442 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17443 : * memcpy(dst_data, src_data, itemsize * dst_extent)
17444 : */
17445 0 : if (__pyx_t_1) {
17446 :
17447 : /* "View.MemoryView":1152
17448 : * if (src_stride > 0 and dst_stride > 0 and
17449 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17450 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
17451 : * else:
17452 : * for i in range(dst_extent):
17453 : */
17454 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17455 :
17456 : /* "View.MemoryView":1150
17457 : *
17458 : * if ndim == 1:
17459 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17460 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17461 : * memcpy(dst_data, src_data, itemsize * dst_extent)
17462 : */
17463 0 : goto __pyx_L4;
17464 : }
17465 :
17466 : /* "View.MemoryView":1154
17467 : * memcpy(dst_data, src_data, itemsize * dst_extent)
17468 : * else:
17469 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
17470 : * memcpy(dst_data, src_data, itemsize)
17471 : * src_data += src_stride
17472 : */
17473 : /*else*/ {
17474 : __pyx_t_3 = __pyx_v_dst_extent;
17475 : __pyx_t_4 = __pyx_t_3;
17476 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17477 0 : __pyx_v_i = __pyx_t_5;
17478 :
17479 : /* "View.MemoryView":1155
17480 : * else:
17481 : * for i in range(dst_extent):
17482 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
17483 : * src_data += src_stride
17484 : * dst_data += dst_stride
17485 : */
17486 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17487 :
17488 : /* "View.MemoryView":1156
17489 : * for i in range(dst_extent):
17490 : * memcpy(dst_data, src_data, itemsize)
17491 : * src_data += src_stride # <<<<<<<<<<<<<<
17492 : * dst_data += dst_stride
17493 : * else:
17494 : */
17495 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17496 :
17497 : /* "View.MemoryView":1157
17498 : * memcpy(dst_data, src_data, itemsize)
17499 : * src_data += src_stride
17500 : * dst_data += dst_stride # <<<<<<<<<<<<<<
17501 : * else:
17502 : * for i in range(dst_extent):
17503 : */
17504 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17505 : }
17506 : }
17507 0 : __pyx_L4:;
17508 :
17509 : /* "View.MemoryView":1149
17510 : * cdef Py_ssize_t dst_stride = dst_strides[0]
17511 : *
17512 : * if ndim == 1: # <<<<<<<<<<<<<<
17513 : * if (src_stride > 0 and dst_stride > 0 and
17514 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
17515 : */
17516 0 : goto __pyx_L3;
17517 : }
17518 :
17519 : /* "View.MemoryView":1159
17520 : * dst_data += dst_stride
17521 : * else:
17522 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
17523 : * _copy_strided_to_strided(src_data, src_strides + 1,
17524 : * dst_data, dst_strides + 1,
17525 : */
17526 : /*else*/ {
17527 : __pyx_t_3 = __pyx_v_dst_extent;
17528 : __pyx_t_4 = __pyx_t_3;
17529 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17530 0 : __pyx_v_i = __pyx_t_5;
17531 :
17532 : /* "View.MemoryView":1160
17533 : * else:
17534 : * for i in range(dst_extent):
17535 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
17536 : * dst_data, dst_strides + 1,
17537 : * src_shape + 1, dst_shape + 1,
17538 : */
17539 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17540 :
17541 : /* "View.MemoryView":1164
17542 : * src_shape + 1, dst_shape + 1,
17543 : * ndim - 1, itemsize)
17544 : * src_data += src_stride # <<<<<<<<<<<<<<
17545 : * dst_data += dst_stride
17546 : *
17547 : */
17548 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17549 :
17550 : /* "View.MemoryView":1165
17551 : * ndim - 1, itemsize)
17552 : * src_data += src_stride
17553 : * dst_data += dst_stride # <<<<<<<<<<<<<<
17554 : *
17555 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17556 : */
17557 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17558 : }
17559 : }
17560 0 : __pyx_L3:;
17561 :
17562 : /* "View.MemoryView":1137
17563 : *
17564 : * @cython.cdivision(True)
17565 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17566 : * char *dst_data, Py_ssize_t *dst_strides,
17567 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17568 : */
17569 :
17570 : /* function exit code */
17571 0 : }
17572 :
17573 : /* "View.MemoryView":1167
17574 : * dst_data += dst_stride
17575 : *
17576 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17577 : * __Pyx_memviewslice *dst,
17578 : * int ndim, size_t itemsize) noexcept nogil:
17579 : */
17580 :
17581 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17582 :
17583 : /* "View.MemoryView":1170
17584 : * __Pyx_memviewslice *dst,
17585 : * int ndim, size_t itemsize) noexcept nogil:
17586 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17587 : * src.shape, dst.shape, ndim, itemsize)
17588 : *
17589 : */
17590 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17591 :
17592 : /* "View.MemoryView":1167
17593 : * dst_data += dst_stride
17594 : *
17595 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17596 : * __Pyx_memviewslice *dst,
17597 : * int ndim, size_t itemsize) noexcept nogil:
17598 : */
17599 :
17600 : /* function exit code */
17601 0 : }
17602 :
17603 : /* "View.MemoryView":1174
17604 : *
17605 : * @cname('__pyx_memoryview_slice_get_size')
17606 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17607 : * "Return the size of the memory occupied by the slice in number of bytes"
17608 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17609 : */
17610 :
17611 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17612 0 : Py_ssize_t __pyx_v_shape;
17613 0 : Py_ssize_t __pyx_v_size;
17614 0 : Py_ssize_t __pyx_r;
17615 0 : Py_ssize_t __pyx_t_1;
17616 0 : Py_ssize_t *__pyx_t_2;
17617 0 : Py_ssize_t *__pyx_t_3;
17618 0 : Py_ssize_t *__pyx_t_4;
17619 :
17620 : /* "View.MemoryView":1176
17621 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
17622 : * "Return the size of the memory occupied by the slice in number of bytes"
17623 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17624 : *
17625 : * for shape in src.shape[:ndim]:
17626 : */
17627 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17628 0 : __pyx_v_size = __pyx_t_1;
17629 :
17630 : /* "View.MemoryView":1178
17631 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17632 : *
17633 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17634 : * size *= shape
17635 : *
17636 : */
17637 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17638 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17639 0 : __pyx_t_2 = __pyx_t_4;
17640 0 : __pyx_v_shape = (__pyx_t_2[0]);
17641 :
17642 : /* "View.MemoryView":1179
17643 : *
17644 : * for shape in src.shape[:ndim]:
17645 : * size *= shape # <<<<<<<<<<<<<<
17646 : *
17647 : * return size
17648 : */
17649 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17650 : }
17651 :
17652 : /* "View.MemoryView":1181
17653 : * size *= shape
17654 : *
17655 : * return size # <<<<<<<<<<<<<<
17656 : *
17657 : * @cname('__pyx_fill_contig_strides_array')
17658 : */
17659 0 : __pyx_r = __pyx_v_size;
17660 0 : goto __pyx_L0;
17661 :
17662 : /* "View.MemoryView":1174
17663 : *
17664 : * @cname('__pyx_memoryview_slice_get_size')
17665 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17666 : * "Return the size of the memory occupied by the slice in number of bytes"
17667 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17668 : */
17669 :
17670 : /* function exit code */
17671 0 : __pyx_L0:;
17672 0 : return __pyx_r;
17673 : }
17674 :
17675 : /* "View.MemoryView":1184
17676 : *
17677 : * @cname('__pyx_fill_contig_strides_array')
17678 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17679 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17680 : * int ndim, char order) noexcept nogil:
17681 : */
17682 :
17683 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
17684 0 : int __pyx_v_idx;
17685 0 : Py_ssize_t __pyx_r;
17686 0 : int __pyx_t_1;
17687 0 : int __pyx_t_2;
17688 0 : int __pyx_t_3;
17689 0 : int __pyx_t_4;
17690 :
17691 : /* "View.MemoryView":1193
17692 : * cdef int idx
17693 : *
17694 : * if order == 'F': # <<<<<<<<<<<<<<
17695 : * for idx in range(ndim):
17696 : * strides[idx] = stride
17697 : */
17698 0 : __pyx_t_1 = (__pyx_v_order == 'F');
17699 0 : if (__pyx_t_1) {
17700 :
17701 : /* "View.MemoryView":1194
17702 : *
17703 : * if order == 'F':
17704 : * for idx in range(ndim): # <<<<<<<<<<<<<<
17705 : * strides[idx] = stride
17706 : * stride *= shape[idx]
17707 : */
17708 0 : __pyx_t_2 = __pyx_v_ndim;
17709 : __pyx_t_3 = __pyx_t_2;
17710 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17711 0 : __pyx_v_idx = __pyx_t_4;
17712 :
17713 : /* "View.MemoryView":1195
17714 : * if order == 'F':
17715 : * for idx in range(ndim):
17716 : * strides[idx] = stride # <<<<<<<<<<<<<<
17717 : * stride *= shape[idx]
17718 : * else:
17719 : */
17720 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17721 :
17722 : /* "View.MemoryView":1196
17723 : * for idx in range(ndim):
17724 : * strides[idx] = stride
17725 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17726 : * else:
17727 : * for idx in range(ndim - 1, -1, -1):
17728 : */
17729 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17730 : }
17731 :
17732 : /* "View.MemoryView":1193
17733 : * cdef int idx
17734 : *
17735 : * if order == 'F': # <<<<<<<<<<<<<<
17736 : * for idx in range(ndim):
17737 : * strides[idx] = stride
17738 : */
17739 0 : goto __pyx_L3;
17740 : }
17741 :
17742 : /* "View.MemoryView":1198
17743 : * stride *= shape[idx]
17744 : * else:
17745 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17746 : * strides[idx] = stride
17747 : * stride *= shape[idx]
17748 : */
17749 : /*else*/ {
17750 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17751 0 : __pyx_v_idx = __pyx_t_2;
17752 :
17753 : /* "View.MemoryView":1199
17754 : * else:
17755 : * for idx in range(ndim - 1, -1, -1):
17756 : * strides[idx] = stride # <<<<<<<<<<<<<<
17757 : * stride *= shape[idx]
17758 : *
17759 : */
17760 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17761 :
17762 : /* "View.MemoryView":1200
17763 : * for idx in range(ndim - 1, -1, -1):
17764 : * strides[idx] = stride
17765 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17766 : *
17767 : * return stride
17768 : */
17769 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17770 : }
17771 : }
17772 0 : __pyx_L3:;
17773 :
17774 : /* "View.MemoryView":1202
17775 : * stride *= shape[idx]
17776 : *
17777 : * return stride # <<<<<<<<<<<<<<
17778 : *
17779 : * @cname('__pyx_memoryview_copy_data_to_temp')
17780 : */
17781 0 : __pyx_r = __pyx_v_stride;
17782 0 : goto __pyx_L0;
17783 :
17784 : /* "View.MemoryView":1184
17785 : *
17786 : * @cname('__pyx_fill_contig_strides_array')
17787 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17788 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17789 : * int ndim, char order) noexcept nogil:
17790 : */
17791 :
17792 : /* function exit code */
17793 0 : __pyx_L0:;
17794 0 : return __pyx_r;
17795 : }
17796 :
17797 : /* "View.MemoryView":1205
17798 : *
17799 : * @cname('__pyx_memoryview_copy_data_to_temp')
17800 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17801 : * __Pyx_memviewslice *tmpslice,
17802 : * char order,
17803 : */
17804 :
17805 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17806 0 : int __pyx_v_i;
17807 0 : void *__pyx_v_result;
17808 0 : size_t __pyx_v_itemsize;
17809 0 : size_t __pyx_v_size;
17810 0 : void *__pyx_r;
17811 0 : Py_ssize_t __pyx_t_1;
17812 0 : int __pyx_t_2;
17813 0 : int __pyx_t_3;
17814 0 : struct __pyx_memoryview_obj *__pyx_t_4;
17815 0 : int __pyx_t_5;
17816 0 : int __pyx_t_6;
17817 0 : int __pyx_lineno = 0;
17818 0 : const char *__pyx_filename = NULL;
17819 0 : int __pyx_clineno = 0;
17820 : #ifdef WITH_THREAD
17821 0 : PyGILState_STATE __pyx_gilstate_save;
17822 : #endif
17823 :
17824 : /* "View.MemoryView":1216
17825 : * cdef void *result
17826 : *
17827 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17828 : * cdef size_t size = slice_get_size(src, ndim)
17829 : *
17830 : */
17831 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17832 0 : __pyx_v_itemsize = __pyx_t_1;
17833 :
17834 : /* "View.MemoryView":1217
17835 : *
17836 : * cdef size_t itemsize = src.memview.view.itemsize
17837 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17838 : *
17839 : * result = malloc(size)
17840 : */
17841 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17842 :
17843 : /* "View.MemoryView":1219
17844 : * cdef size_t size = slice_get_size(src, ndim)
17845 : *
17846 : * result = malloc(size) # <<<<<<<<<<<<<<
17847 : * if not result:
17848 : * _err_no_memory()
17849 : */
17850 0 : __pyx_v_result = malloc(__pyx_v_size);
17851 :
17852 : /* "View.MemoryView":1220
17853 : *
17854 : * result = malloc(size)
17855 : * if not result: # <<<<<<<<<<<<<<
17856 : * _err_no_memory()
17857 : *
17858 : */
17859 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
17860 0 : if (__pyx_t_2) {
17861 :
17862 : /* "View.MemoryView":1221
17863 : * result = malloc(size)
17864 : * if not result:
17865 : * _err_no_memory() # <<<<<<<<<<<<<<
17866 : *
17867 : *
17868 : */
17869 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
17870 :
17871 : /* "View.MemoryView":1220
17872 : *
17873 : * result = malloc(size)
17874 : * if not result: # <<<<<<<<<<<<<<
17875 : * _err_no_memory()
17876 : *
17877 : */
17878 : }
17879 :
17880 : /* "View.MemoryView":1224
17881 : *
17882 : *
17883 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17884 : * tmpslice.memview = src.memview
17885 : * for i in range(ndim):
17886 : */
17887 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17888 :
17889 : /* "View.MemoryView":1225
17890 : *
17891 : * tmpslice.data = <char *> result
17892 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17893 : * for i in range(ndim):
17894 : * tmpslice.shape[i] = src.shape[i]
17895 : */
17896 0 : __pyx_t_4 = __pyx_v_src->memview;
17897 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
17898 :
17899 : /* "View.MemoryView":1226
17900 : * tmpslice.data = <char *> result
17901 : * tmpslice.memview = src.memview
17902 : * for i in range(ndim): # <<<<<<<<<<<<<<
17903 : * tmpslice.shape[i] = src.shape[i]
17904 : * tmpslice.suboffsets[i] = -1
17905 : */
17906 0 : __pyx_t_3 = __pyx_v_ndim;
17907 0 : __pyx_t_5 = __pyx_t_3;
17908 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17909 0 : __pyx_v_i = __pyx_t_6;
17910 :
17911 : /* "View.MemoryView":1227
17912 : * tmpslice.memview = src.memview
17913 : * for i in range(ndim):
17914 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
17915 : * tmpslice.suboffsets[i] = -1
17916 : *
17917 : */
17918 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17919 :
17920 : /* "View.MemoryView":1228
17921 : * for i in range(ndim):
17922 : * tmpslice.shape[i] = src.shape[i]
17923 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17924 : *
17925 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
17926 : */
17927 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17928 : }
17929 :
17930 : /* "View.MemoryView":1230
17931 : * tmpslice.suboffsets[i] = -1
17932 : *
17933 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
17934 : *
17935 : *
17936 : */
17937 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
17938 :
17939 : /* "View.MemoryView":1233
17940 : *
17941 : *
17942 : * for i in range(ndim): # <<<<<<<<<<<<<<
17943 : * if tmpslice.shape[i] == 1:
17944 : * tmpslice.strides[i] = 0
17945 : */
17946 0 : __pyx_t_3 = __pyx_v_ndim;
17947 0 : __pyx_t_5 = __pyx_t_3;
17948 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17949 0 : __pyx_v_i = __pyx_t_6;
17950 :
17951 : /* "View.MemoryView":1234
17952 : *
17953 : * for i in range(ndim):
17954 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17955 : * tmpslice.strides[i] = 0
17956 : *
17957 : */
17958 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
17959 0 : if (__pyx_t_2) {
17960 :
17961 : /* "View.MemoryView":1235
17962 : * for i in range(ndim):
17963 : * if tmpslice.shape[i] == 1:
17964 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
17965 : *
17966 : * if slice_is_contig(src[0], order, ndim):
17967 : */
17968 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17969 :
17970 : /* "View.MemoryView":1234
17971 : *
17972 : * for i in range(ndim):
17973 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17974 : * tmpslice.strides[i] = 0
17975 : *
17976 : */
17977 : }
17978 : }
17979 :
17980 : /* "View.MemoryView":1237
17981 : * tmpslice.strides[i] = 0
17982 : *
17983 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17984 : * memcpy(result, src.data, size)
17985 : * else:
17986 : */
17987 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
17988 0 : if (__pyx_t_2) {
17989 :
17990 : /* "View.MemoryView":1238
17991 : *
17992 : * if slice_is_contig(src[0], order, ndim):
17993 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
17994 : * else:
17995 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17996 : */
17997 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17998 :
17999 : /* "View.MemoryView":1237
18000 : * tmpslice.strides[i] = 0
18001 : *
18002 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18003 : * memcpy(result, src.data, size)
18004 : * else:
18005 : */
18006 0 : goto __pyx_L9;
18007 : }
18008 :
18009 : /* "View.MemoryView":1240
18010 : * memcpy(result, src.data, size)
18011 : * else:
18012 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18013 : *
18014 : * return result
18015 : */
18016 : /*else*/ {
18017 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18018 : }
18019 0 : __pyx_L9:;
18020 :
18021 : /* "View.MemoryView":1242
18022 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18023 : *
18024 : * return result # <<<<<<<<<<<<<<
18025 : *
18026 : *
18027 : */
18028 0 : __pyx_r = __pyx_v_result;
18029 0 : goto __pyx_L0;
18030 :
18031 : /* "View.MemoryView":1205
18032 : *
18033 : * @cname('__pyx_memoryview_copy_data_to_temp')
18034 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18035 : * __Pyx_memviewslice *tmpslice,
18036 : * char order,
18037 : */
18038 :
18039 : /* function exit code */
18040 0 : __pyx_L1_error:;
18041 : #ifdef WITH_THREAD
18042 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18043 : #endif
18044 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18045 0 : __pyx_r = NULL;
18046 : #ifdef WITH_THREAD
18047 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18048 : #endif
18049 0 : __pyx_L0:;
18050 0 : return __pyx_r;
18051 : }
18052 :
18053 : /* "View.MemoryView":1247
18054 : *
18055 : * @cname('__pyx_memoryview_err_extents')
18056 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18057 : * Py_ssize_t extent2) except -1 with gil:
18058 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
18059 : */
18060 :
18061 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18062 0 : int __pyx_r;
18063 : __Pyx_RefNannyDeclarations
18064 0 : PyObject *__pyx_t_1 = NULL;
18065 0 : Py_ssize_t __pyx_t_2;
18066 0 : Py_UCS4 __pyx_t_3;
18067 0 : PyObject *__pyx_t_4 = NULL;
18068 0 : int __pyx_lineno = 0;
18069 0 : const char *__pyx_filename = NULL;
18070 0 : int __pyx_clineno = 0;
18071 : #ifdef WITH_THREAD
18072 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18073 : #endif
18074 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
18075 :
18076 : /* "View.MemoryView":1249
18077 : * cdef int _err_extents(int i, Py_ssize_t extent1,
18078 : * Py_ssize_t extent2) except -1 with gil:
18079 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
18080 : *
18081 : * @cname('__pyx_memoryview_err_dim')
18082 : */
18083 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
18084 0 : __Pyx_GOTREF(__pyx_t_1);
18085 0 : __pyx_t_2 = 0;
18086 0 : __pyx_t_3 = 127;
18087 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
18088 0 : __pyx_t_2 += 35;
18089 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
18090 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
18091 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
18092 0 : __Pyx_GOTREF(__pyx_t_4);
18093 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
18094 0 : __Pyx_GIVEREF(__pyx_t_4);
18095 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
18096 0 : __pyx_t_4 = 0;
18097 0 : __Pyx_INCREF(__pyx_kp_u_got);
18098 0 : __pyx_t_2 += 6;
18099 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
18100 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
18101 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
18102 0 : __Pyx_GOTREF(__pyx_t_4);
18103 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
18104 0 : __Pyx_GIVEREF(__pyx_t_4);
18105 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
18106 0 : __pyx_t_4 = 0;
18107 0 : __Pyx_INCREF(__pyx_kp_u_and);
18108 0 : __pyx_t_2 += 5;
18109 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
18110 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
18111 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
18112 0 : __Pyx_GOTREF(__pyx_t_4);
18113 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
18114 0 : __Pyx_GIVEREF(__pyx_t_4);
18115 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
18116 0 : __pyx_t_4 = 0;
18117 0 : __Pyx_INCREF(__pyx_kp_u__7);
18118 0 : __pyx_t_2 += 1;
18119 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
18120 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
18121 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
18122 0 : __Pyx_GOTREF(__pyx_t_4);
18123 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18124 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
18125 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18126 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
18127 :
18128 : /* "View.MemoryView":1247
18129 : *
18130 : * @cname('__pyx_memoryview_err_extents')
18131 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18132 : * Py_ssize_t extent2) except -1 with gil:
18133 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
18134 : */
18135 :
18136 : /* function exit code */
18137 0 : __pyx_L1_error:;
18138 0 : __Pyx_XDECREF(__pyx_t_1);
18139 0 : __Pyx_XDECREF(__pyx_t_4);
18140 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18141 0 : __pyx_r = -1;
18142 0 : __Pyx_RefNannyFinishContext();
18143 : #ifdef WITH_THREAD
18144 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18145 : #endif
18146 0 : return __pyx_r;
18147 : }
18148 :
18149 : /* "View.MemoryView":1252
18150 : *
18151 : * @cname('__pyx_memoryview_err_dim')
18152 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18153 : * raise <object>error, msg % dim
18154 : *
18155 : */
18156 :
18157 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
18158 0 : int __pyx_r;
18159 : __Pyx_RefNannyDeclarations
18160 0 : PyObject *__pyx_t_1 = NULL;
18161 0 : PyObject *__pyx_t_2 = NULL;
18162 0 : int __pyx_lineno = 0;
18163 0 : const char *__pyx_filename = NULL;
18164 0 : int __pyx_clineno = 0;
18165 : #ifdef WITH_THREAD
18166 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18167 : #endif
18168 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
18169 0 : __Pyx_INCREF(__pyx_v_msg);
18170 :
18171 : /* "View.MemoryView":1253
18172 : * @cname('__pyx_memoryview_err_dim')
18173 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
18174 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
18175 : *
18176 : * @cname('__pyx_memoryview_err')
18177 : */
18178 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
18179 0 : __Pyx_GOTREF(__pyx_t_1);
18180 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
18181 0 : __Pyx_GOTREF(__pyx_t_2);
18182 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18183 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
18184 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18185 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
18186 :
18187 : /* "View.MemoryView":1252
18188 : *
18189 : * @cname('__pyx_memoryview_err_dim')
18190 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18191 : * raise <object>error, msg % dim
18192 : *
18193 : */
18194 :
18195 : /* function exit code */
18196 0 : __pyx_L1_error:;
18197 0 : __Pyx_XDECREF(__pyx_t_1);
18198 0 : __Pyx_XDECREF(__pyx_t_2);
18199 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18200 0 : __pyx_r = -1;
18201 0 : __Pyx_XDECREF(__pyx_v_msg);
18202 0 : __Pyx_RefNannyFinishContext();
18203 : #ifdef WITH_THREAD
18204 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18205 : #endif
18206 0 : return __pyx_r;
18207 : }
18208 :
18209 : /* "View.MemoryView":1256
18210 : *
18211 : * @cname('__pyx_memoryview_err')
18212 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
18213 : * raise <object>error, msg
18214 : *
18215 : */
18216 :
18217 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
18218 0 : int __pyx_r;
18219 : __Pyx_RefNannyDeclarations
18220 0 : int __pyx_lineno = 0;
18221 0 : const char *__pyx_filename = NULL;
18222 0 : int __pyx_clineno = 0;
18223 : #ifdef WITH_THREAD
18224 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18225 : #endif
18226 0 : __Pyx_RefNannySetupContext("_err", 0);
18227 0 : __Pyx_INCREF(__pyx_v_msg);
18228 :
18229 : /* "View.MemoryView":1257
18230 : * @cname('__pyx_memoryview_err')
18231 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
18232 : * raise <object>error, msg # <<<<<<<<<<<<<<
18233 : *
18234 : * @cname('__pyx_memoryview_err_no_memory')
18235 : */
18236 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
18237 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
18238 :
18239 : /* "View.MemoryView":1256
18240 : *
18241 : * @cname('__pyx_memoryview_err')
18242 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
18243 : * raise <object>error, msg
18244 : *
18245 : */
18246 :
18247 : /* function exit code */
18248 0 : __pyx_L1_error:;
18249 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18250 0 : __pyx_r = -1;
18251 0 : __Pyx_XDECREF(__pyx_v_msg);
18252 0 : __Pyx_RefNannyFinishContext();
18253 : #ifdef WITH_THREAD
18254 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18255 : #endif
18256 0 : return __pyx_r;
18257 : }
18258 :
18259 : /* "View.MemoryView":1260
18260 : *
18261 : * @cname('__pyx_memoryview_err_no_memory')
18262 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
18263 : * raise MemoryError
18264 : *
18265 : */
18266 :
18267 0 : static int __pyx_memoryview_err_no_memory(void) {
18268 0 : int __pyx_r;
18269 0 : int __pyx_lineno = 0;
18270 0 : const char *__pyx_filename = NULL;
18271 0 : int __pyx_clineno = 0;
18272 : #ifdef WITH_THREAD
18273 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18274 : #endif
18275 :
18276 : /* "View.MemoryView":1261
18277 : * @cname('__pyx_memoryview_err_no_memory')
18278 : * cdef int _err_no_memory() except -1 with gil:
18279 : * raise MemoryError # <<<<<<<<<<<<<<
18280 : *
18281 : *
18282 : */
18283 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
18284 :
18285 : /* "View.MemoryView":1260
18286 : *
18287 : * @cname('__pyx_memoryview_err_no_memory')
18288 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
18289 : * raise MemoryError
18290 : *
18291 : */
18292 :
18293 : /* function exit code */
18294 0 : __pyx_L1_error:;
18295 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
18296 0 : __pyx_r = -1;
18297 : #ifdef WITH_THREAD
18298 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18299 : #endif
18300 0 : return __pyx_r;
18301 : }
18302 :
18303 : /* "View.MemoryView":1265
18304 : *
18305 : * @cname('__pyx_memoryview_copy_contents')
18306 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18307 : * __Pyx_memviewslice dst,
18308 : * int src_ndim, int dst_ndim,
18309 : */
18310 :
18311 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
18312 0 : void *__pyx_v_tmpdata;
18313 0 : size_t __pyx_v_itemsize;
18314 0 : int __pyx_v_i;
18315 0 : char __pyx_v_order;
18316 0 : int __pyx_v_broadcasting;
18317 0 : int __pyx_v_direct_copy;
18318 0 : __Pyx_memviewslice __pyx_v_tmp;
18319 0 : int __pyx_v_ndim;
18320 0 : int __pyx_r;
18321 0 : Py_ssize_t __pyx_t_1;
18322 0 : int __pyx_t_2;
18323 0 : int __pyx_t_3;
18324 0 : int __pyx_t_4;
18325 0 : int __pyx_t_5;
18326 0 : int __pyx_t_6;
18327 0 : void *__pyx_t_7;
18328 0 : int __pyx_lineno = 0;
18329 0 : const char *__pyx_filename = NULL;
18330 0 : int __pyx_clineno = 0;
18331 : #ifdef WITH_THREAD
18332 0 : PyGILState_STATE __pyx_gilstate_save;
18333 : #endif
18334 :
18335 : /* "View.MemoryView":1273
18336 : * Check for overlapping memory and verify the shapes.
18337 : * """
18338 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
18339 : * cdef size_t itemsize = src.memview.view.itemsize
18340 : * cdef int i
18341 : */
18342 0 : __pyx_v_tmpdata = NULL;
18343 :
18344 : /* "View.MemoryView":1274
18345 : * """
18346 : * cdef void *tmpdata = NULL
18347 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18348 : * cdef int i
18349 : * cdef char order = get_best_order(&src, src_ndim)
18350 : */
18351 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18352 0 : __pyx_v_itemsize = __pyx_t_1;
18353 :
18354 : /* "View.MemoryView":1276
18355 : * cdef size_t itemsize = src.memview.view.itemsize
18356 : * cdef int i
18357 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
18358 : * cdef bint broadcasting = False
18359 : * cdef bint direct_copy = False
18360 : */
18361 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18362 :
18363 : /* "View.MemoryView":1277
18364 : * cdef int i
18365 : * cdef char order = get_best_order(&src, src_ndim)
18366 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
18367 : * cdef bint direct_copy = False
18368 : * cdef __Pyx_memviewslice tmp
18369 : */
18370 0 : __pyx_v_broadcasting = 0;
18371 :
18372 : /* "View.MemoryView":1278
18373 : * cdef char order = get_best_order(&src, src_ndim)
18374 : * cdef bint broadcasting = False
18375 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
18376 : * cdef __Pyx_memviewslice tmp
18377 : *
18378 : */
18379 0 : __pyx_v_direct_copy = 0;
18380 :
18381 : /* "View.MemoryView":1281
18382 : * cdef __Pyx_memviewslice tmp
18383 : *
18384 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18385 : * broadcast_leading(&src, src_ndim, dst_ndim)
18386 : * elif dst_ndim < src_ndim:
18387 : */
18388 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
18389 0 : if (__pyx_t_2) {
18390 :
18391 : /* "View.MemoryView":1282
18392 : *
18393 : * if src_ndim < dst_ndim:
18394 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18395 : * elif dst_ndim < src_ndim:
18396 : * broadcast_leading(&dst, dst_ndim, src_ndim)
18397 : */
18398 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18399 :
18400 : /* "View.MemoryView":1281
18401 : * cdef __Pyx_memviewslice tmp
18402 : *
18403 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18404 : * broadcast_leading(&src, src_ndim, dst_ndim)
18405 : * elif dst_ndim < src_ndim:
18406 : */
18407 0 : goto __pyx_L3;
18408 : }
18409 :
18410 : /* "View.MemoryView":1283
18411 : * if src_ndim < dst_ndim:
18412 : * broadcast_leading(&src, src_ndim, dst_ndim)
18413 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18414 : * broadcast_leading(&dst, dst_ndim, src_ndim)
18415 : *
18416 : */
18417 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
18418 0 : if (__pyx_t_2) {
18419 :
18420 : /* "View.MemoryView":1284
18421 : * broadcast_leading(&src, src_ndim, dst_ndim)
18422 : * elif dst_ndim < src_ndim:
18423 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
18424 : *
18425 : * cdef int ndim = max(src_ndim, dst_ndim)
18426 : */
18427 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18428 :
18429 : /* "View.MemoryView":1283
18430 : * if src_ndim < dst_ndim:
18431 : * broadcast_leading(&src, src_ndim, dst_ndim)
18432 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18433 : * broadcast_leading(&dst, dst_ndim, src_ndim)
18434 : *
18435 : */
18436 : }
18437 0 : __pyx_L3:;
18438 :
18439 : /* "View.MemoryView":1286
18440 : * broadcast_leading(&dst, dst_ndim, src_ndim)
18441 : *
18442 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18443 : *
18444 : * for i in range(ndim):
18445 : */
18446 0 : __pyx_t_3 = __pyx_v_dst_ndim;
18447 0 : __pyx_t_4 = __pyx_v_src_ndim;
18448 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
18449 0 : if (__pyx_t_2) {
18450 : __pyx_t_5 = __pyx_t_3;
18451 : } else {
18452 : __pyx_t_5 = __pyx_t_4;
18453 : }
18454 0 : __pyx_v_ndim = __pyx_t_5;
18455 :
18456 : /* "View.MemoryView":1288
18457 : * cdef int ndim = max(src_ndim, dst_ndim)
18458 : *
18459 : * for i in range(ndim): # <<<<<<<<<<<<<<
18460 : * if src.shape[i] != dst.shape[i]:
18461 : * if src.shape[i] == 1:
18462 : */
18463 0 : __pyx_t_5 = __pyx_v_ndim;
18464 0 : __pyx_t_3 = __pyx_t_5;
18465 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18466 0 : __pyx_v_i = __pyx_t_4;
18467 :
18468 : /* "View.MemoryView":1289
18469 : *
18470 : * for i in range(ndim):
18471 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18472 : * if src.shape[i] == 1:
18473 : * broadcasting = True
18474 : */
18475 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
18476 0 : if (__pyx_t_2) {
18477 :
18478 : /* "View.MemoryView":1290
18479 : * for i in range(ndim):
18480 : * if src.shape[i] != dst.shape[i]:
18481 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18482 : * broadcasting = True
18483 : * src.strides[i] = 0
18484 : */
18485 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
18486 0 : if (__pyx_t_2) {
18487 :
18488 : /* "View.MemoryView":1291
18489 : * if src.shape[i] != dst.shape[i]:
18490 : * if src.shape[i] == 1:
18491 : * broadcasting = True # <<<<<<<<<<<<<<
18492 : * src.strides[i] = 0
18493 : * else:
18494 : */
18495 0 : __pyx_v_broadcasting = 1;
18496 :
18497 : /* "View.MemoryView":1292
18498 : * if src.shape[i] == 1:
18499 : * broadcasting = True
18500 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
18501 : * else:
18502 : * _err_extents(i, dst.shape[i], src.shape[i])
18503 : */
18504 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
18505 :
18506 : /* "View.MemoryView":1290
18507 : * for i in range(ndim):
18508 : * if src.shape[i] != dst.shape[i]:
18509 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18510 : * broadcasting = True
18511 : * src.strides[i] = 0
18512 : */
18513 0 : goto __pyx_L7;
18514 : }
18515 :
18516 : /* "View.MemoryView":1294
18517 : * src.strides[i] = 0
18518 : * else:
18519 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18520 : *
18521 : * if src.suboffsets[i] >= 0:
18522 : */
18523 : /*else*/ {
18524 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
18525 : }
18526 0 : __pyx_L7:;
18527 :
18528 : /* "View.MemoryView":1289
18529 : *
18530 : * for i in range(ndim):
18531 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18532 : * if src.shape[i] == 1:
18533 : * broadcasting = True
18534 : */
18535 : }
18536 :
18537 : /* "View.MemoryView":1296
18538 : * _err_extents(i, dst.shape[i], src.shape[i])
18539 : *
18540 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18541 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18542 : *
18543 : */
18544 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
18545 0 : if (__pyx_t_2) {
18546 :
18547 : /* "View.MemoryView":1297
18548 : *
18549 : * if src.suboffsets[i] >= 0:
18550 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18551 : *
18552 : * if slices_overlap(&src, &dst, ndim, itemsize):
18553 : */
18554 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
18555 :
18556 : /* "View.MemoryView":1296
18557 : * _err_extents(i, dst.shape[i], src.shape[i])
18558 : *
18559 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18560 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18561 : *
18562 : */
18563 : }
18564 : }
18565 :
18566 : /* "View.MemoryView":1299
18567 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18568 : *
18569 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18570 : *
18571 : * if not slice_is_contig(src, order, ndim):
18572 : */
18573 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18574 0 : if (__pyx_t_2) {
18575 :
18576 : /* "View.MemoryView":1301
18577 : * if slices_overlap(&src, &dst, ndim, itemsize):
18578 : *
18579 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18580 : * order = get_best_order(&dst, ndim)
18581 : *
18582 : */
18583 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
18584 0 : if (__pyx_t_2) {
18585 :
18586 : /* "View.MemoryView":1302
18587 : *
18588 : * if not slice_is_contig(src, order, ndim):
18589 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18590 : *
18591 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18592 : */
18593 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18594 :
18595 : /* "View.MemoryView":1301
18596 : * if slices_overlap(&src, &dst, ndim, itemsize):
18597 : *
18598 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18599 : * order = get_best_order(&dst, ndim)
18600 : *
18601 : */
18602 : }
18603 :
18604 : /* "View.MemoryView":1304
18605 : * order = get_best_order(&dst, ndim)
18606 : *
18607 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18608 : * src = tmp
18609 : *
18610 : */
18611 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
18612 0 : __pyx_v_tmpdata = __pyx_t_7;
18613 :
18614 : /* "View.MemoryView":1305
18615 : *
18616 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18617 : * src = tmp # <<<<<<<<<<<<<<
18618 : *
18619 : * if not broadcasting:
18620 : */
18621 0 : __pyx_v_src = __pyx_v_tmp;
18622 :
18623 : /* "View.MemoryView":1299
18624 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18625 : *
18626 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18627 : *
18628 : * if not slice_is_contig(src, order, ndim):
18629 : */
18630 : }
18631 :
18632 : /* "View.MemoryView":1307
18633 : * src = tmp
18634 : *
18635 : * if not broadcasting: # <<<<<<<<<<<<<<
18636 : *
18637 : *
18638 : */
18639 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
18640 0 : if (__pyx_t_2) {
18641 :
18642 : /* "View.MemoryView":1310
18643 : *
18644 : *
18645 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18646 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18647 : * elif slice_is_contig(src, 'F', ndim):
18648 : */
18649 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
18650 0 : if (__pyx_t_2) {
18651 :
18652 : /* "View.MemoryView":1311
18653 : *
18654 : * if slice_is_contig(src, 'C', ndim):
18655 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18656 : * elif slice_is_contig(src, 'F', ndim):
18657 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18658 : */
18659 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18660 :
18661 : /* "View.MemoryView":1310
18662 : *
18663 : *
18664 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18665 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18666 : * elif slice_is_contig(src, 'F', ndim):
18667 : */
18668 0 : goto __pyx_L12;
18669 : }
18670 :
18671 : /* "View.MemoryView":1312
18672 : * if slice_is_contig(src, 'C', ndim):
18673 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18674 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18675 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18676 : *
18677 : */
18678 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
18679 0 : if (__pyx_t_2) {
18680 :
18681 : /* "View.MemoryView":1313
18682 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18683 : * elif slice_is_contig(src, 'F', ndim):
18684 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18685 : *
18686 : * if direct_copy:
18687 : */
18688 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18689 :
18690 : /* "View.MemoryView":1312
18691 : * if slice_is_contig(src, 'C', ndim):
18692 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18693 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18694 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18695 : *
18696 : */
18697 : }
18698 0 : __pyx_L12:;
18699 :
18700 : /* "View.MemoryView":1315
18701 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18702 : *
18703 : * if direct_copy: # <<<<<<<<<<<<<<
18704 : *
18705 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18706 : */
18707 0 : if (__pyx_v_direct_copy) {
18708 :
18709 : /* "View.MemoryView":1317
18710 : * if direct_copy:
18711 : *
18712 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18713 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18714 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18715 : */
18716 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18717 :
18718 : /* "View.MemoryView":1318
18719 : *
18720 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18721 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18722 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18723 : * free(tmpdata)
18724 : */
18725 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18726 :
18727 : /* "View.MemoryView":1319
18728 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18729 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18730 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18731 : * free(tmpdata)
18732 : * return 0
18733 : */
18734 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18735 :
18736 : /* "View.MemoryView":1320
18737 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18738 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18739 : * free(tmpdata) # <<<<<<<<<<<<<<
18740 : * return 0
18741 : *
18742 : */
18743 0 : free(__pyx_v_tmpdata);
18744 :
18745 : /* "View.MemoryView":1321
18746 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18747 : * free(tmpdata)
18748 : * return 0 # <<<<<<<<<<<<<<
18749 : *
18750 : * if order == 'F' == get_best_order(&dst, ndim):
18751 : */
18752 0 : __pyx_r = 0;
18753 0 : goto __pyx_L0;
18754 :
18755 : /* "View.MemoryView":1315
18756 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18757 : *
18758 : * if direct_copy: # <<<<<<<<<<<<<<
18759 : *
18760 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18761 : */
18762 : }
18763 :
18764 : /* "View.MemoryView":1307
18765 : * src = tmp
18766 : *
18767 : * if not broadcasting: # <<<<<<<<<<<<<<
18768 : *
18769 : *
18770 : */
18771 : }
18772 :
18773 : /* "View.MemoryView":1323
18774 : * return 0
18775 : *
18776 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18777 : *
18778 : *
18779 : */
18780 0 : __pyx_t_2 = (__pyx_v_order == 'F');
18781 0 : if (__pyx_t_2) {
18782 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18783 : }
18784 0 : if (__pyx_t_2) {
18785 :
18786 : /* "View.MemoryView":1326
18787 : *
18788 : *
18789 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
18790 : * transpose_memslice(&dst)
18791 : *
18792 : */
18793 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
18794 :
18795 : /* "View.MemoryView":1327
18796 : *
18797 : * transpose_memslice(&src)
18798 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18799 : *
18800 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18801 : */
18802 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
18803 :
18804 : /* "View.MemoryView":1323
18805 : * return 0
18806 : *
18807 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18808 : *
18809 : *
18810 : */
18811 : }
18812 :
18813 : /* "View.MemoryView":1329
18814 : * transpose_memslice(&dst)
18815 : *
18816 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18817 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18818 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18819 : */
18820 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18821 :
18822 : /* "View.MemoryView":1330
18823 : *
18824 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18825 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
18826 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18827 : *
18828 : */
18829 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18830 :
18831 : /* "View.MemoryView":1331
18832 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18833 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18834 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18835 : *
18836 : * free(tmpdata)
18837 : */
18838 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18839 :
18840 : /* "View.MemoryView":1333
18841 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18842 : *
18843 : * free(tmpdata) # <<<<<<<<<<<<<<
18844 : * return 0
18845 : *
18846 : */
18847 0 : free(__pyx_v_tmpdata);
18848 :
18849 : /* "View.MemoryView":1334
18850 : *
18851 : * free(tmpdata)
18852 : * return 0 # <<<<<<<<<<<<<<
18853 : *
18854 : * @cname('__pyx_memoryview_broadcast_leading')
18855 : */
18856 0 : __pyx_r = 0;
18857 0 : goto __pyx_L0;
18858 :
18859 : /* "View.MemoryView":1265
18860 : *
18861 : * @cname('__pyx_memoryview_copy_contents')
18862 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18863 : * __Pyx_memviewslice dst,
18864 : * int src_ndim, int dst_ndim,
18865 : */
18866 :
18867 : /* function exit code */
18868 0 : __pyx_L1_error:;
18869 : #ifdef WITH_THREAD
18870 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18871 : #endif
18872 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18873 0 : __pyx_r = -1;
18874 : #ifdef WITH_THREAD
18875 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18876 : #endif
18877 0 : __pyx_L0:;
18878 0 : return __pyx_r;
18879 : }
18880 :
18881 : /* "View.MemoryView":1337
18882 : *
18883 : * @cname('__pyx_memoryview_broadcast_leading')
18884 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18885 : * int ndim,
18886 : * int ndim_other) noexcept nogil:
18887 : */
18888 :
18889 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18890 0 : int __pyx_v_i;
18891 0 : int __pyx_v_offset;
18892 0 : int __pyx_t_1;
18893 0 : int __pyx_t_2;
18894 0 : int __pyx_t_3;
18895 :
18896 : /* "View.MemoryView":1341
18897 : * int ndim_other) noexcept nogil:
18898 : * cdef int i
18899 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
18900 : *
18901 : * for i in range(ndim - 1, -1, -1):
18902 : */
18903 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18904 :
18905 : /* "View.MemoryView":1343
18906 : * cdef int offset = ndim_other - ndim
18907 : *
18908 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18909 : * mslice.shape[i + offset] = mslice.shape[i]
18910 : * mslice.strides[i + offset] = mslice.strides[i]
18911 : */
18912 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18913 0 : __pyx_v_i = __pyx_t_1;
18914 :
18915 : /* "View.MemoryView":1344
18916 : *
18917 : * for i in range(ndim - 1, -1, -1):
18918 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18919 : * mslice.strides[i + offset] = mslice.strides[i]
18920 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18921 : */
18922 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18923 :
18924 : /* "View.MemoryView":1345
18925 : * for i in range(ndim - 1, -1, -1):
18926 : * mslice.shape[i + offset] = mslice.shape[i]
18927 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18928 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18929 : *
18930 : */
18931 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18932 :
18933 : /* "View.MemoryView":1346
18934 : * mslice.shape[i + offset] = mslice.shape[i]
18935 : * mslice.strides[i + offset] = mslice.strides[i]
18936 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18937 : *
18938 : * for i in range(offset):
18939 : */
18940 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18941 : }
18942 :
18943 : /* "View.MemoryView":1348
18944 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18945 : *
18946 : * for i in range(offset): # <<<<<<<<<<<<<<
18947 : * mslice.shape[i] = 1
18948 : * mslice.strides[i] = mslice.strides[0]
18949 : */
18950 0 : __pyx_t_1 = __pyx_v_offset;
18951 : __pyx_t_2 = __pyx_t_1;
18952 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18953 0 : __pyx_v_i = __pyx_t_3;
18954 :
18955 : /* "View.MemoryView":1349
18956 : *
18957 : * for i in range(offset):
18958 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18959 : * mslice.strides[i] = mslice.strides[0]
18960 : * mslice.suboffsets[i] = -1
18961 : */
18962 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18963 :
18964 : /* "View.MemoryView":1350
18965 : * for i in range(offset):
18966 : * mslice.shape[i] = 1
18967 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18968 : * mslice.suboffsets[i] = -1
18969 : *
18970 : */
18971 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18972 :
18973 : /* "View.MemoryView":1351
18974 : * mslice.shape[i] = 1
18975 : * mslice.strides[i] = mslice.strides[0]
18976 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18977 : *
18978 : *
18979 : */
18980 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18981 : }
18982 :
18983 : /* "View.MemoryView":1337
18984 : *
18985 : * @cname('__pyx_memoryview_broadcast_leading')
18986 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18987 : * int ndim,
18988 : * int ndim_other) noexcept nogil:
18989 : */
18990 :
18991 : /* function exit code */
18992 0 : }
18993 :
18994 : /* "View.MemoryView":1359
18995 : *
18996 : * @cname('__pyx_memoryview_refcount_copying')
18997 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
18998 : *
18999 : * if dtype_is_object:
19000 : */
19001 :
19002 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19003 :
19004 : /* "View.MemoryView":1361
19005 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
19006 : *
19007 : * if dtype_is_object: # <<<<<<<<<<<<<<
19008 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
19009 : *
19010 : */
19011 0 : if (__pyx_v_dtype_is_object) {
19012 :
19013 : /* "View.MemoryView":1362
19014 : *
19015 : * if dtype_is_object:
19016 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
19017 : *
19018 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19019 : */
19020 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19021 :
19022 : /* "View.MemoryView":1361
19023 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
19024 : *
19025 : * if dtype_is_object: # <<<<<<<<<<<<<<
19026 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
19027 : *
19028 : */
19029 : }
19030 :
19031 : /* "View.MemoryView":1359
19032 : *
19033 : * @cname('__pyx_memoryview_refcount_copying')
19034 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
19035 : *
19036 : * if dtype_is_object:
19037 : */
19038 :
19039 : /* function exit code */
19040 0 : }
19041 :
19042 : /* "View.MemoryView":1365
19043 : *
19044 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19045 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19046 : * Py_ssize_t *strides, int ndim,
19047 : * bint inc) noexcept with gil:
19048 : */
19049 :
19050 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19051 : #ifdef WITH_THREAD
19052 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19053 : #endif
19054 :
19055 : /* "View.MemoryView":1368
19056 : * Py_ssize_t *strides, int ndim,
19057 : * bint inc) noexcept with gil:
19058 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19059 : *
19060 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
19061 : */
19062 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19063 :
19064 : /* "View.MemoryView":1365
19065 : *
19066 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19067 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19068 : * Py_ssize_t *strides, int ndim,
19069 : * bint inc) noexcept with gil:
19070 : */
19071 :
19072 : /* function exit code */
19073 : #ifdef WITH_THREAD
19074 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
19075 : #endif
19076 0 : }
19077 :
19078 : /* "View.MemoryView":1371
19079 : *
19080 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
19081 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19082 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
19083 : * cdef Py_ssize_t i
19084 : */
19085 :
19086 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19087 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19088 0 : Py_ssize_t __pyx_v_stride;
19089 0 : Py_ssize_t __pyx_t_1;
19090 0 : Py_ssize_t __pyx_t_2;
19091 0 : Py_ssize_t __pyx_t_3;
19092 0 : int __pyx_t_4;
19093 :
19094 : /* "View.MemoryView":1374
19095 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
19096 : * cdef Py_ssize_t i
19097 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19098 : *
19099 : * for i in range(shape[0]):
19100 : */
19101 0 : __pyx_v_stride = (__pyx_v_strides[0]);
19102 :
19103 : /* "View.MemoryView":1376
19104 : * cdef Py_ssize_t stride = strides[0]
19105 : *
19106 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
19107 : * if ndim == 1:
19108 : * if inc:
19109 : */
19110 0 : __pyx_t_1 = (__pyx_v_shape[0]);
19111 0 : __pyx_t_2 = __pyx_t_1;
19112 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19113 0 : __pyx_v_i = __pyx_t_3;
19114 :
19115 : /* "View.MemoryView":1377
19116 : *
19117 : * for i in range(shape[0]):
19118 : * if ndim == 1: # <<<<<<<<<<<<<<
19119 : * if inc:
19120 : * Py_INCREF((<PyObject **> data)[0])
19121 : */
19122 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
19123 0 : if (__pyx_t_4) {
19124 :
19125 : /* "View.MemoryView":1378
19126 : * for i in range(shape[0]):
19127 : * if ndim == 1:
19128 : * if inc: # <<<<<<<<<<<<<<
19129 : * Py_INCREF((<PyObject **> data)[0])
19130 : * else:
19131 : */
19132 0 : if (__pyx_v_inc) {
19133 :
19134 : /* "View.MemoryView":1379
19135 : * if ndim == 1:
19136 : * if inc:
19137 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19138 : * else:
19139 : * Py_DECREF((<PyObject **> data)[0])
19140 : */
19141 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19142 :
19143 : /* "View.MemoryView":1378
19144 : * for i in range(shape[0]):
19145 : * if ndim == 1:
19146 : * if inc: # <<<<<<<<<<<<<<
19147 : * Py_INCREF((<PyObject **> data)[0])
19148 : * else:
19149 : */
19150 0 : goto __pyx_L6;
19151 : }
19152 :
19153 : /* "View.MemoryView":1381
19154 : * Py_INCREF((<PyObject **> data)[0])
19155 : * else:
19156 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19157 : * else:
19158 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
19159 : */
19160 : /*else*/ {
19161 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19162 : }
19163 0 : __pyx_L6:;
19164 :
19165 : /* "View.MemoryView":1377
19166 : *
19167 : * for i in range(shape[0]):
19168 : * if ndim == 1: # <<<<<<<<<<<<<<
19169 : * if inc:
19170 : * Py_INCREF((<PyObject **> data)[0])
19171 : */
19172 0 : goto __pyx_L5;
19173 : }
19174 :
19175 : /* "View.MemoryView":1383
19176 : * Py_DECREF((<PyObject **> data)[0])
19177 : * else:
19178 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
19179 : *
19180 : * data += stride
19181 : */
19182 : /*else*/ {
19183 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19184 : }
19185 0 : __pyx_L5:;
19186 :
19187 : /* "View.MemoryView":1385
19188 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
19189 : *
19190 : * data += stride # <<<<<<<<<<<<<<
19191 : *
19192 : *
19193 : */
19194 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19195 : }
19196 :
19197 : /* "View.MemoryView":1371
19198 : *
19199 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
19200 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19201 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
19202 : * cdef Py_ssize_t i
19203 : */
19204 :
19205 : /* function exit code */
19206 0 : }
19207 :
19208 : /* "View.MemoryView":1391
19209 : *
19210 : * @cname('__pyx_memoryview_slice_assign_scalar')
19211 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19212 : * size_t itemsize, void *item,
19213 : * bint dtype_is_object) noexcept nogil:
19214 : */
19215 :
19216 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
19217 :
19218 : /* "View.MemoryView":1394
19219 : * size_t itemsize, void *item,
19220 : * bint dtype_is_object) noexcept nogil:
19221 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
19222 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
19223 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
19224 : */
19225 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19226 :
19227 : /* "View.MemoryView":1395
19228 : * bint dtype_is_object) noexcept nogil:
19229 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
19230 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
19231 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
19232 : *
19233 : */
19234 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19235 :
19236 : /* "View.MemoryView":1396
19237 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
19238 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
19239 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
19240 : *
19241 : *
19242 : */
19243 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19244 :
19245 : /* "View.MemoryView":1391
19246 : *
19247 : * @cname('__pyx_memoryview_slice_assign_scalar')
19248 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19249 : * size_t itemsize, void *item,
19250 : * bint dtype_is_object) noexcept nogil:
19251 : */
19252 :
19253 : /* function exit code */
19254 0 : }
19255 :
19256 : /* "View.MemoryView":1400
19257 : *
19258 : * @cname('__pyx_memoryview__slice_assign_scalar')
19259 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19260 : * Py_ssize_t *strides, int ndim,
19261 : * size_t itemsize, void *item) noexcept nogil:
19262 : */
19263 :
19264 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
19265 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19266 0 : Py_ssize_t __pyx_v_stride;
19267 0 : Py_ssize_t __pyx_v_extent;
19268 0 : int __pyx_t_1;
19269 0 : Py_ssize_t __pyx_t_2;
19270 0 : Py_ssize_t __pyx_t_3;
19271 0 : Py_ssize_t __pyx_t_4;
19272 :
19273 : /* "View.MemoryView":1404
19274 : * size_t itemsize, void *item) noexcept nogil:
19275 : * cdef Py_ssize_t i
19276 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19277 : * cdef Py_ssize_t extent = shape[0]
19278 : *
19279 : */
19280 0 : __pyx_v_stride = (__pyx_v_strides[0]);
19281 :
19282 : /* "View.MemoryView":1405
19283 : * cdef Py_ssize_t i
19284 : * cdef Py_ssize_t stride = strides[0]
19285 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
19286 : *
19287 : * if ndim == 1:
19288 : */
19289 0 : __pyx_v_extent = (__pyx_v_shape[0]);
19290 :
19291 : /* "View.MemoryView":1407
19292 : * cdef Py_ssize_t extent = shape[0]
19293 : *
19294 : * if ndim == 1: # <<<<<<<<<<<<<<
19295 : * for i in range(extent):
19296 : * memcpy(data, item, itemsize)
19297 : */
19298 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
19299 0 : if (__pyx_t_1) {
19300 :
19301 : /* "View.MemoryView":1408
19302 : *
19303 : * if ndim == 1:
19304 : * for i in range(extent): # <<<<<<<<<<<<<<
19305 : * memcpy(data, item, itemsize)
19306 : * data += stride
19307 : */
19308 : __pyx_t_2 = __pyx_v_extent;
19309 : __pyx_t_3 = __pyx_t_2;
19310 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19311 0 : __pyx_v_i = __pyx_t_4;
19312 :
19313 : /* "View.MemoryView":1409
19314 : * if ndim == 1:
19315 : * for i in range(extent):
19316 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
19317 : * data += stride
19318 : * else:
19319 : */
19320 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19321 :
19322 : /* "View.MemoryView":1410
19323 : * for i in range(extent):
19324 : * memcpy(data, item, itemsize)
19325 : * data += stride # <<<<<<<<<<<<<<
19326 : * else:
19327 : * for i in range(extent):
19328 : */
19329 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19330 : }
19331 :
19332 : /* "View.MemoryView":1407
19333 : * cdef Py_ssize_t extent = shape[0]
19334 : *
19335 : * if ndim == 1: # <<<<<<<<<<<<<<
19336 : * for i in range(extent):
19337 : * memcpy(data, item, itemsize)
19338 : */
19339 0 : goto __pyx_L3;
19340 : }
19341 :
19342 : /* "View.MemoryView":1412
19343 : * data += stride
19344 : * else:
19345 : * for i in range(extent): # <<<<<<<<<<<<<<
19346 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
19347 : * data += stride
19348 : */
19349 : /*else*/ {
19350 : __pyx_t_2 = __pyx_v_extent;
19351 : __pyx_t_3 = __pyx_t_2;
19352 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19353 0 : __pyx_v_i = __pyx_t_4;
19354 :
19355 : /* "View.MemoryView":1413
19356 : * else:
19357 : * for i in range(extent):
19358 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
19359 : * data += stride
19360 : *
19361 : */
19362 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19363 :
19364 : /* "View.MemoryView":1414
19365 : * for i in range(extent):
19366 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
19367 : * data += stride # <<<<<<<<<<<<<<
19368 : *
19369 : *
19370 : */
19371 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19372 : }
19373 : }
19374 0 : __pyx_L3:;
19375 :
19376 : /* "View.MemoryView":1400
19377 : *
19378 : * @cname('__pyx_memoryview__slice_assign_scalar')
19379 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19380 : * Py_ssize_t *strides, int ndim,
19381 : * size_t itemsize, void *item) noexcept nogil:
19382 : */
19383 :
19384 : /* function exit code */
19385 0 : }
19386 :
19387 : /* "(tree fragment)":1
19388 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19389 : * cdef object __pyx_PickleError
19390 : * cdef object __pyx_result
19391 : */
19392 :
19393 : /* Python wrapper */
19394 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
19395 : #if CYTHON_METH_FASTCALL
19396 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19397 : #else
19398 : PyObject *__pyx_args, PyObject *__pyx_kwds
19399 : #endif
19400 : ); /*proto*/
19401 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
19402 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
19403 : #if CYTHON_METH_FASTCALL
19404 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
19405 : #else
19406 : PyObject *__pyx_args, PyObject *__pyx_kwds
19407 : #endif
19408 : ) {
19409 0 : PyObject *__pyx_v___pyx_type = 0;
19410 0 : long __pyx_v___pyx_checksum;
19411 0 : PyObject *__pyx_v___pyx_state = 0;
19412 : #if !CYTHON_METH_FASTCALL
19413 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
19414 : #endif
19415 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
19416 0 : PyObject* values[3] = {0,0,0};
19417 0 : int __pyx_lineno = 0;
19418 0 : const char *__pyx_filename = NULL;
19419 0 : int __pyx_clineno = 0;
19420 0 : PyObject *__pyx_r = 0;
19421 : __Pyx_RefNannyDeclarations
19422 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
19423 : #if !CYTHON_METH_FASTCALL
19424 : #if CYTHON_ASSUME_SAFE_MACROS
19425 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
19426 : #else
19427 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
19428 : #endif
19429 : #endif
19430 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
19431 : {
19432 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19433 0 : if (__pyx_kwds) {
19434 0 : Py_ssize_t kw_args;
19435 0 : switch (__pyx_nargs) {
19436 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
19437 0 : CYTHON_FALLTHROUGH;
19438 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
19439 0 : CYTHON_FALLTHROUGH;
19440 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
19441 0 : CYTHON_FALLTHROUGH;
19442 0 : case 0: break;
19443 0 : default: goto __pyx_L5_argtuple_error;
19444 : }
19445 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
19446 0 : switch (__pyx_nargs) {
19447 0 : case 0:
19448 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
19449 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
19450 0 : kw_args--;
19451 : }
19452 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19453 0 : else goto __pyx_L5_argtuple_error;
19454 0 : CYTHON_FALLTHROUGH;
19455 : case 1:
19456 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
19457 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
19458 0 : kw_args--;
19459 : }
19460 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19461 : else {
19462 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
19463 : }
19464 0 : CYTHON_FALLTHROUGH;
19465 : case 2:
19466 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
19467 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
19468 0 : kw_args--;
19469 : }
19470 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19471 : else {
19472 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
19473 : }
19474 : }
19475 0 : if (unlikely(kw_args > 0)) {
19476 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
19477 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
19478 : }
19479 0 : } else if (unlikely(__pyx_nargs != 3)) {
19480 0 : goto __pyx_L5_argtuple_error;
19481 : } else {
19482 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
19483 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
19484 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
19485 : }
19486 0 : __pyx_v___pyx_type = values[0];
19487 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
19488 0 : __pyx_v___pyx_state = values[2];
19489 : }
19490 0 : goto __pyx_L6_skip;
19491 0 : __pyx_L5_argtuple_error:;
19492 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
19493 0 : __pyx_L6_skip:;
19494 0 : goto __pyx_L4_argument_unpacking_done;
19495 0 : __pyx_L3_error:;
19496 : {
19497 0 : Py_ssize_t __pyx_temp;
19498 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19499 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
19500 : }
19501 : }
19502 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19503 0 : __Pyx_RefNannyFinishContext();
19504 0 : return NULL;
19505 0 : __pyx_L4_argument_unpacking_done:;
19506 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
19507 :
19508 : /* function exit code */
19509 : {
19510 0 : Py_ssize_t __pyx_temp;
19511 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
19512 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
19513 : }
19514 : }
19515 : __Pyx_RefNannyFinishContext();
19516 : return __pyx_r;
19517 : }
19518 :
19519 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
19520 0 : PyObject *__pyx_v___pyx_PickleError = 0;
19521 0 : PyObject *__pyx_v___pyx_result = 0;
19522 0 : PyObject *__pyx_r = NULL;
19523 : __Pyx_RefNannyDeclarations
19524 0 : PyObject *__pyx_t_1 = NULL;
19525 0 : int __pyx_t_2;
19526 0 : PyObject *__pyx_t_3 = NULL;
19527 0 : PyObject *__pyx_t_4 = NULL;
19528 0 : unsigned int __pyx_t_5;
19529 0 : int __pyx_lineno = 0;
19530 0 : const char *__pyx_filename = NULL;
19531 0 : int __pyx_clineno = 0;
19532 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
19533 :
19534 : /* "(tree fragment)":4
19535 : * cdef object __pyx_PickleError
19536 : * cdef object __pyx_result
19537 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
19538 : * from pickle import PickleError as __pyx_PickleError
19539 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19540 : */
19541 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
19542 0 : __Pyx_GOTREF(__pyx_t_1);
19543 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
19544 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19545 0 : if (__pyx_t_2) {
19546 :
19547 : /* "(tree fragment)":5
19548 : * cdef object __pyx_result
19549 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
19550 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
19551 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19552 : * __pyx_result = Enum.__new__(__pyx_type)
19553 : */
19554 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19555 0 : __Pyx_GOTREF(__pyx_t_1);
19556 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
19557 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
19558 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
19559 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
19560 0 : __Pyx_GOTREF(__pyx_t_3);
19561 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19562 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19563 0 : __Pyx_GOTREF(__pyx_t_1);
19564 0 : __Pyx_INCREF(__pyx_t_1);
19565 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
19566 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19567 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19568 :
19569 : /* "(tree fragment)":6
19570 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
19571 : * from pickle import PickleError as __pyx_PickleError
19572 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
19573 : * __pyx_result = Enum.__new__(__pyx_type)
19574 : * if __pyx_state is not None:
19575 : */
19576 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
19577 0 : __Pyx_GOTREF(__pyx_t_3);
19578 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
19579 0 : __Pyx_GOTREF(__pyx_t_1);
19580 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19581 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
19582 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19583 0 : __PYX_ERR(1, 6, __pyx_L1_error)
19584 :
19585 : /* "(tree fragment)":4
19586 : * cdef object __pyx_PickleError
19587 : * cdef object __pyx_result
19588 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
19589 : * from pickle import PickleError as __pyx_PickleError
19590 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19591 : */
19592 : }
19593 :
19594 : /* "(tree fragment)":7
19595 : * from pickle import PickleError as __pyx_PickleError
19596 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19597 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19598 : * if __pyx_state is not None:
19599 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19600 : */
19601 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
19602 0 : __Pyx_GOTREF(__pyx_t_3);
19603 0 : __pyx_t_4 = NULL;
19604 0 : __pyx_t_5 = 0;
19605 : #if CYTHON_UNPACK_METHODS
19606 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
19607 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
19608 0 : if (likely(__pyx_t_4)) {
19609 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19610 0 : __Pyx_INCREF(__pyx_t_4);
19611 0 : __Pyx_INCREF(function);
19612 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
19613 : __pyx_t_5 = 1;
19614 : }
19615 : }
19616 : #endif
19617 : {
19618 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
19619 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
19620 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
19621 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
19622 0 : __Pyx_GOTREF(__pyx_t_1);
19623 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19624 : }
19625 0 : __pyx_v___pyx_result = __pyx_t_1;
19626 0 : __pyx_t_1 = 0;
19627 :
19628 : /* "(tree fragment)":8
19629 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19630 : * __pyx_result = Enum.__new__(__pyx_type)
19631 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
19632 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19633 : * return __pyx_result
19634 : */
19635 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
19636 0 : if (__pyx_t_2) {
19637 :
19638 : /* "(tree fragment)":9
19639 : * __pyx_result = Enum.__new__(__pyx_type)
19640 : * if __pyx_state is not None:
19641 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19642 : * return __pyx_result
19643 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19644 : */
19645 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
19646 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
19647 0 : __Pyx_GOTREF(__pyx_t_1);
19648 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19649 :
19650 : /* "(tree fragment)":8
19651 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19652 : * __pyx_result = Enum.__new__(__pyx_type)
19653 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
19654 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19655 : * return __pyx_result
19656 : */
19657 : }
19658 :
19659 : /* "(tree fragment)":10
19660 : * if __pyx_state is not None:
19661 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19662 : * return __pyx_result # <<<<<<<<<<<<<<
19663 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19664 : * __pyx_result.name = __pyx_state[0]
19665 : */
19666 0 : __Pyx_XDECREF(__pyx_r);
19667 0 : __Pyx_INCREF(__pyx_v___pyx_result);
19668 0 : __pyx_r = __pyx_v___pyx_result;
19669 0 : goto __pyx_L0;
19670 :
19671 : /* "(tree fragment)":1
19672 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19673 : * cdef object __pyx_PickleError
19674 : * cdef object __pyx_result
19675 : */
19676 :
19677 : /* function exit code */
19678 0 : __pyx_L1_error:;
19679 0 : __Pyx_XDECREF(__pyx_t_1);
19680 0 : __Pyx_XDECREF(__pyx_t_3);
19681 0 : __Pyx_XDECREF(__pyx_t_4);
19682 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19683 0 : __pyx_r = NULL;
19684 0 : __pyx_L0:;
19685 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19686 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
19687 0 : __Pyx_XGIVEREF(__pyx_r);
19688 0 : __Pyx_RefNannyFinishContext();
19689 0 : return __pyx_r;
19690 : }
19691 :
19692 : /* "(tree fragment)":11
19693 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19694 : * return __pyx_result
19695 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19696 : * __pyx_result.name = __pyx_state[0]
19697 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19698 : */
19699 :
19700 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19701 0 : PyObject *__pyx_r = NULL;
19702 : __Pyx_RefNannyDeclarations
19703 0 : PyObject *__pyx_t_1 = NULL;
19704 0 : int __pyx_t_2;
19705 0 : Py_ssize_t __pyx_t_3;
19706 0 : int __pyx_t_4;
19707 0 : PyObject *__pyx_t_5 = NULL;
19708 0 : PyObject *__pyx_t_6 = NULL;
19709 0 : PyObject *__pyx_t_7 = NULL;
19710 0 : unsigned int __pyx_t_8;
19711 0 : int __pyx_lineno = 0;
19712 0 : const char *__pyx_filename = NULL;
19713 0 : int __pyx_clineno = 0;
19714 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
19715 :
19716 : /* "(tree fragment)":12
19717 : * return __pyx_result
19718 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19719 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19720 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19721 : * __pyx_result.__dict__.update(__pyx_state[1])
19722 : */
19723 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19724 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19725 0 : __PYX_ERR(1, 12, __pyx_L1_error)
19726 : }
19727 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
19728 0 : __Pyx_GOTREF(__pyx_t_1);
19729 0 : __Pyx_GIVEREF(__pyx_t_1);
19730 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
19731 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
19732 0 : __pyx_v___pyx_result->name = __pyx_t_1;
19733 0 : __pyx_t_1 = 0;
19734 :
19735 : /* "(tree fragment)":13
19736 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19737 : * __pyx_result.name = __pyx_state[0]
19738 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19739 : * __pyx_result.__dict__.update(__pyx_state[1])
19740 : */
19741 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19742 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19743 : __PYX_ERR(1, 13, __pyx_L1_error)
19744 : }
19745 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19746 0 : __pyx_t_4 = (__pyx_t_3 > 1);
19747 0 : if (__pyx_t_4) {
19748 0 : } else {
19749 0 : __pyx_t_2 = __pyx_t_4;
19750 0 : goto __pyx_L4_bool_binop_done;
19751 : }
19752 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19753 : __pyx_t_2 = __pyx_t_4;
19754 0 : __pyx_L4_bool_binop_done:;
19755 0 : if (__pyx_t_2) {
19756 :
19757 : /* "(tree fragment)":14
19758 : * __pyx_result.name = __pyx_state[0]
19759 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19760 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
19761 : */
19762 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19763 0 : __Pyx_GOTREF(__pyx_t_5);
19764 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
19765 0 : __Pyx_GOTREF(__pyx_t_6);
19766 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19767 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19768 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19769 : __PYX_ERR(1, 14, __pyx_L1_error)
19770 : }
19771 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19772 0 : __Pyx_GOTREF(__pyx_t_5);
19773 0 : __pyx_t_7 = NULL;
19774 0 : __pyx_t_8 = 0;
19775 : #if CYTHON_UNPACK_METHODS
19776 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
19777 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
19778 0 : if (likely(__pyx_t_7)) {
19779 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19780 0 : __Pyx_INCREF(__pyx_t_7);
19781 0 : __Pyx_INCREF(function);
19782 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
19783 : __pyx_t_8 = 1;
19784 : }
19785 : }
19786 : #endif
19787 : {
19788 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
19789 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
19790 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19791 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19792 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
19793 0 : __Pyx_GOTREF(__pyx_t_1);
19794 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19795 : }
19796 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19797 :
19798 : /* "(tree fragment)":13
19799 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19800 : * __pyx_result.name = __pyx_state[0]
19801 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19802 : * __pyx_result.__dict__.update(__pyx_state[1])
19803 : */
19804 : }
19805 :
19806 : /* "(tree fragment)":11
19807 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19808 : * return __pyx_result
19809 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19810 : * __pyx_result.name = __pyx_state[0]
19811 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19812 : */
19813 :
19814 : /* function exit code */
19815 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19816 0 : goto __pyx_L0;
19817 0 : __pyx_L1_error:;
19818 0 : __Pyx_XDECREF(__pyx_t_1);
19819 0 : __Pyx_XDECREF(__pyx_t_5);
19820 0 : __Pyx_XDECREF(__pyx_t_6);
19821 0 : __Pyx_XDECREF(__pyx_t_7);
19822 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19823 0 : __pyx_r = 0;
19824 0 : __pyx_L0:;
19825 0 : __Pyx_XGIVEREF(__pyx_r);
19826 0 : __Pyx_RefNannyFinishContext();
19827 0 : return __pyx_r;
19828 : }
19829 :
19830 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19831 : *
19832 : * @property
19833 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19834 : * return PyDataType_ELSIZE(self)
19835 : *
19836 : */
19837 :
19838 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
19839 : npy_intp __pyx_r;
19840 :
19841 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
19842 : * @property
19843 : * cdef inline npy_intp itemsize(self) noexcept nogil:
19844 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19845 : *
19846 : * @property
19847 : */
19848 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19849 : goto __pyx_L0;
19850 :
19851 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19852 : *
19853 : * @property
19854 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19855 : * return PyDataType_ELSIZE(self)
19856 : *
19857 : */
19858 :
19859 : /* function exit code */
19860 : __pyx_L0:;
19861 : return __pyx_r;
19862 : }
19863 :
19864 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19865 : *
19866 : * @property
19867 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19868 : * return PyDataType_ALIGNMENT(self)
19869 : *
19870 : */
19871 :
19872 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
19873 : npy_intp __pyx_r;
19874 :
19875 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
19876 : * @property
19877 : * cdef inline npy_intp alignment(self) noexcept nogil:
19878 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19879 : *
19880 : * # Use fields/names with care as they may be NULL. You must check
19881 : */
19882 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19883 : goto __pyx_L0;
19884 :
19885 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19886 : *
19887 : * @property
19888 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19889 : * return PyDataType_ALIGNMENT(self)
19890 : *
19891 : */
19892 :
19893 : /* function exit code */
19894 : __pyx_L0:;
19895 : return __pyx_r;
19896 : }
19897 :
19898 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19899 : * # for this using PyDataType_HASFIELDS.
19900 : * @property
19901 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19902 : * return <object>PyDataType_FIELDS(self)
19903 : *
19904 : */
19905 :
19906 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
19907 : PyObject *__pyx_r = NULL;
19908 : __Pyx_RefNannyDeclarations
19909 : PyObject *__pyx_t_1;
19910 : __Pyx_RefNannySetupContext("fields", 1);
19911 :
19912 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
19913 : * @property
19914 : * cdef inline object fields(self):
19915 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19916 : *
19917 : * @property
19918 : */
19919 : __Pyx_XDECREF(__pyx_r);
19920 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19921 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
19922 : __pyx_r = ((PyObject *)__pyx_t_1);
19923 : goto __pyx_L0;
19924 :
19925 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19926 : * # for this using PyDataType_HASFIELDS.
19927 : * @property
19928 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19929 : * return <object>PyDataType_FIELDS(self)
19930 : *
19931 : */
19932 :
19933 : /* function exit code */
19934 : __pyx_L0:;
19935 : __Pyx_XGIVEREF(__pyx_r);
19936 : __Pyx_RefNannyFinishContext();
19937 : return __pyx_r;
19938 : }
19939 :
19940 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19941 : *
19942 : * @property
19943 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19944 : * return <tuple>PyDataType_NAMES(self)
19945 : *
19946 : */
19947 :
19948 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
19949 : PyObject *__pyx_r = NULL;
19950 : __Pyx_RefNannyDeclarations
19951 : PyObject *__pyx_t_1;
19952 : __Pyx_RefNannySetupContext("names", 1);
19953 :
19954 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
19955 : * @property
19956 : * cdef inline tuple names(self):
19957 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19958 : *
19959 : * # Use PyDataType_HASSUBARRAY to test whether this field is
19960 : */
19961 : __Pyx_XDECREF(__pyx_r);
19962 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19963 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
19964 : __pyx_r = ((PyObject*)__pyx_t_1);
19965 : goto __pyx_L0;
19966 :
19967 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19968 : *
19969 : * @property
19970 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19971 : * return <tuple>PyDataType_NAMES(self)
19972 : *
19973 : */
19974 :
19975 : /* function exit code */
19976 : __pyx_L0:;
19977 : __Pyx_XGIVEREF(__pyx_r);
19978 : __Pyx_RefNannyFinishContext();
19979 : return __pyx_r;
19980 : }
19981 :
19982 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
19983 : * # this field via the inline helper method PyDataType_SHAPE.
19984 : * @property
19985 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
19986 : * return PyDataType_SUBARRAY(self)
19987 : *
19988 : */
19989 :
19990 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
19991 : PyArray_ArrayDescr *__pyx_r;
19992 :
19993 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
19994 : * @property
19995 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19996 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19997 : *
19998 : * @property
19999 : */
20000 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
20001 : goto __pyx_L0;
20002 :
20003 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
20004 : * # this field via the inline helper method PyDataType_SHAPE.
20005 : * @property
20006 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
20007 : * return PyDataType_SUBARRAY(self)
20008 : *
20009 : */
20010 :
20011 : /* function exit code */
20012 : __pyx_L0:;
20013 : return __pyx_r;
20014 : }
20015 :
20016 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
20017 : *
20018 : * @property
20019 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
20020 : * """The data types flags."""
20021 : * return PyDataType_FLAGS(self)
20022 : */
20023 :
20024 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
20025 : npy_uint64 __pyx_r;
20026 :
20027 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
20028 : * cdef inline npy_uint64 flags(self) noexcept nogil:
20029 : * """The data types flags."""
20030 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
20031 : *
20032 : *
20033 : */
20034 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
20035 : goto __pyx_L0;
20036 :
20037 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
20038 : *
20039 : * @property
20040 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
20041 : * """The data types flags."""
20042 : * return PyDataType_FLAGS(self)
20043 : */
20044 :
20045 : /* function exit code */
20046 : __pyx_L0:;
20047 : return __pyx_r;
20048 : }
20049 :
20050 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
20051 : *
20052 : * @property
20053 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
20054 : * """The number of arrays that need to be broadcast to the same shape."""
20055 : * return PyArray_MultiIter_NUMITER(self)
20056 : */
20057 :
20058 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
20059 : int __pyx_r;
20060 :
20061 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
20062 : * cdef inline int numiter(self) noexcept nogil:
20063 : * """The number of arrays that need to be broadcast to the same shape."""
20064 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
20065 : *
20066 : * @property
20067 : */
20068 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
20069 : goto __pyx_L0;
20070 :
20071 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
20072 : *
20073 : * @property
20074 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
20075 : * """The number of arrays that need to be broadcast to the same shape."""
20076 : * return PyArray_MultiIter_NUMITER(self)
20077 : */
20078 :
20079 : /* function exit code */
20080 : __pyx_L0:;
20081 : return __pyx_r;
20082 : }
20083 :
20084 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
20085 : *
20086 : * @property
20087 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
20088 : * """The total broadcasted size."""
20089 : * return PyArray_MultiIter_SIZE(self)
20090 : */
20091 :
20092 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
20093 : npy_intp __pyx_r;
20094 :
20095 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
20096 : * cdef inline npy_intp size(self) noexcept nogil:
20097 : * """The total broadcasted size."""
20098 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
20099 : *
20100 : * @property
20101 : */
20102 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
20103 : goto __pyx_L0;
20104 :
20105 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
20106 : *
20107 : * @property
20108 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
20109 : * """The total broadcasted size."""
20110 : * return PyArray_MultiIter_SIZE(self)
20111 : */
20112 :
20113 : /* function exit code */
20114 : __pyx_L0:;
20115 : return __pyx_r;
20116 : }
20117 :
20118 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
20119 : *
20120 : * @property
20121 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
20122 : * """The current (1-d) index into the broadcasted result."""
20123 : * return PyArray_MultiIter_INDEX(self)
20124 : */
20125 :
20126 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
20127 : npy_intp __pyx_r;
20128 :
20129 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
20130 : * cdef inline npy_intp index(self) noexcept nogil:
20131 : * """The current (1-d) index into the broadcasted result."""
20132 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
20133 : *
20134 : * @property
20135 : */
20136 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
20137 : goto __pyx_L0;
20138 :
20139 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
20140 : *
20141 : * @property
20142 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
20143 : * """The current (1-d) index into the broadcasted result."""
20144 : * return PyArray_MultiIter_INDEX(self)
20145 : */
20146 :
20147 : /* function exit code */
20148 : __pyx_L0:;
20149 : return __pyx_r;
20150 : }
20151 :
20152 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
20153 : *
20154 : * @property
20155 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
20156 : * """The number of dimensions in the broadcasted result."""
20157 : * return PyArray_MultiIter_NDIM(self)
20158 : */
20159 :
20160 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
20161 : int __pyx_r;
20162 :
20163 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
20164 : * cdef inline int nd(self) noexcept nogil:
20165 : * """The number of dimensions in the broadcasted result."""
20166 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
20167 : *
20168 : * @property
20169 : */
20170 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
20171 : goto __pyx_L0;
20172 :
20173 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
20174 : *
20175 : * @property
20176 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
20177 : * """The number of dimensions in the broadcasted result."""
20178 : * return PyArray_MultiIter_NDIM(self)
20179 : */
20180 :
20181 : /* function exit code */
20182 : __pyx_L0:;
20183 : return __pyx_r;
20184 : }
20185 :
20186 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
20187 : *
20188 : * @property
20189 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
20190 : * """The shape of the broadcasted result."""
20191 : * return PyArray_MultiIter_DIMS(self)
20192 : */
20193 :
20194 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
20195 : npy_intp *__pyx_r;
20196 :
20197 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
20198 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
20199 : * """The shape of the broadcasted result."""
20200 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
20201 : *
20202 : * @property
20203 : */
20204 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
20205 : goto __pyx_L0;
20206 :
20207 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
20208 : *
20209 : * @property
20210 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
20211 : * """The shape of the broadcasted result."""
20212 : * return PyArray_MultiIter_DIMS(self)
20213 : */
20214 :
20215 : /* function exit code */
20216 : __pyx_L0:;
20217 : return __pyx_r;
20218 : }
20219 :
20220 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
20221 : *
20222 : * @property
20223 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
20224 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20225 : * On return, the iterators are adjusted for broadcasting."""
20226 : */
20227 :
20228 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
20229 : void **__pyx_r;
20230 :
20231 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
20232 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20233 : * On return, the iterators are adjusted for broadcasting."""
20234 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
20235 : *
20236 : *
20237 : */
20238 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
20239 : goto __pyx_L0;
20240 :
20241 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
20242 : *
20243 : * @property
20244 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
20245 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20246 : * On return, the iterators are adjusted for broadcasting."""
20247 : */
20248 :
20249 : /* function exit code */
20250 : __pyx_L0:;
20251 : return __pyx_r;
20252 : }
20253 :
20254 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
20255 : *
20256 : * @property
20257 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
20258 : * """Returns a borrowed reference to the object owning the data/memory.
20259 : * """
20260 : */
20261 :
20262 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
20263 : PyObject *__pyx_r;
20264 :
20265 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
20266 : * """Returns a borrowed reference to the object owning the data/memory.
20267 : * """
20268 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
20269 : *
20270 : * @property
20271 : */
20272 : __pyx_r = PyArray_BASE(__pyx_v_self);
20273 : goto __pyx_L0;
20274 :
20275 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
20276 : *
20277 : * @property
20278 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
20279 : * """Returns a borrowed reference to the object owning the data/memory.
20280 : * """
20281 : */
20282 :
20283 : /* function exit code */
20284 : __pyx_L0:;
20285 : return __pyx_r;
20286 : }
20287 :
20288 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
20289 : *
20290 : * @property
20291 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
20292 : * """Returns an owned reference to the dtype of the array.
20293 : * """
20294 : */
20295 :
20296 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
20297 : PyArray_Descr *__pyx_r = NULL;
20298 : __Pyx_RefNannyDeclarations
20299 : PyArray_Descr *__pyx_t_1;
20300 : __Pyx_RefNannySetupContext("descr", 1);
20301 :
20302 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
20303 : * """Returns an owned reference to the dtype of the array.
20304 : * """
20305 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
20306 : *
20307 : * @property
20308 : */
20309 : __Pyx_XDECREF((PyObject *)__pyx_r);
20310 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
20311 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
20312 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
20313 : goto __pyx_L0;
20314 :
20315 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
20316 : *
20317 : * @property
20318 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
20319 : * """Returns an owned reference to the dtype of the array.
20320 : * """
20321 : */
20322 :
20323 : /* function exit code */
20324 : __pyx_L0:;
20325 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
20326 : __Pyx_RefNannyFinishContext();
20327 : return __pyx_r;
20328 : }
20329 :
20330 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
20331 : *
20332 : * @property
20333 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
20334 : * """Returns the number of dimensions in the array.
20335 : * """
20336 : */
20337 :
20338 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
20339 : int __pyx_r;
20340 :
20341 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
20342 : * """Returns the number of dimensions in the array.
20343 : * """
20344 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
20345 : *
20346 : * @property
20347 : */
20348 : __pyx_r = PyArray_NDIM(__pyx_v_self);
20349 : goto __pyx_L0;
20350 :
20351 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
20352 : *
20353 : * @property
20354 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
20355 : * """Returns the number of dimensions in the array.
20356 : * """
20357 : */
20358 :
20359 : /* function exit code */
20360 : __pyx_L0:;
20361 : return __pyx_r;
20362 : }
20363 :
20364 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
20365 : *
20366 : * @property
20367 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
20368 : * """Returns a pointer to the dimensions/shape of the array.
20369 : * The number of elements matches the number of dimensions of the array (ndim).
20370 : */
20371 :
20372 198 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
20373 198 : npy_intp *__pyx_r;
20374 :
20375 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
20376 : * Can return NULL for 0-dimensional arrays.
20377 : * """
20378 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
20379 : *
20380 : * @property
20381 : */
20382 198 : __pyx_r = PyArray_DIMS(__pyx_v_self);
20383 198 : goto __pyx_L0;
20384 :
20385 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
20386 : *
20387 : * @property
20388 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
20389 : * """Returns a pointer to the dimensions/shape of the array.
20390 : * The number of elements matches the number of dimensions of the array (ndim).
20391 : */
20392 :
20393 : /* function exit code */
20394 198 : __pyx_L0:;
20395 198 : return __pyx_r;
20396 : }
20397 :
20398 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
20399 : *
20400 : * @property
20401 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
20402 : * """Returns a pointer to the strides of the array.
20403 : * The number of elements matches the number of dimensions of the array (ndim).
20404 : */
20405 :
20406 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
20407 : npy_intp *__pyx_r;
20408 :
20409 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
20410 : * The number of elements matches the number of dimensions of the array (ndim).
20411 : * """
20412 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
20413 : *
20414 : * @property
20415 : */
20416 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
20417 : goto __pyx_L0;
20418 :
20419 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
20420 : *
20421 : * @property
20422 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
20423 : * """Returns a pointer to the strides of the array.
20424 : * The number of elements matches the number of dimensions of the array (ndim).
20425 : */
20426 :
20427 : /* function exit code */
20428 : __pyx_L0:;
20429 : return __pyx_r;
20430 : }
20431 :
20432 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
20433 : *
20434 : * @property
20435 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
20436 : * """Returns the total size (in number of elements) of the array.
20437 : * """
20438 : */
20439 :
20440 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
20441 : npy_intp __pyx_r;
20442 :
20443 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
20444 : * """Returns the total size (in number of elements) of the array.
20445 : * """
20446 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
20447 : *
20448 : * @property
20449 : */
20450 : __pyx_r = PyArray_SIZE(__pyx_v_self);
20451 : goto __pyx_L0;
20452 :
20453 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
20454 : *
20455 : * @property
20456 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
20457 : * """Returns the total size (in number of elements) of the array.
20458 : * """
20459 : */
20460 :
20461 : /* function exit code */
20462 : __pyx_L0:;
20463 : return __pyx_r;
20464 : }
20465 :
20466 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
20467 : *
20468 : * @property
20469 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
20470 : * """The pointer to the data buffer as a char*.
20471 : * This is provided for legacy reasons to avoid direct struct field access.
20472 : */
20473 :
20474 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
20475 : char *__pyx_r;
20476 :
20477 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
20478 : * of `PyArray_DATA()` instead, which returns a 'void*'.
20479 : * """
20480 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
20481 : *
20482 : *
20483 : */
20484 : __pyx_r = PyArray_BYTES(__pyx_v_self);
20485 : goto __pyx_L0;
20486 :
20487 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
20488 : *
20489 : * @property
20490 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
20491 : * """The pointer to the data buffer as a char*.
20492 : * This is provided for legacy reasons to avoid direct struct field access.
20493 : */
20494 :
20495 : /* function exit code */
20496 : __pyx_L0:;
20497 : return __pyx_r;
20498 : }
20499 :
20500 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
20501 : * ctypedef long double complex clongdouble_t
20502 : *
20503 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
20504 : * return PyArray_MultiIterNew(1, <void*>a)
20505 : *
20506 : */
20507 :
20508 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
20509 : PyObject *__pyx_r = NULL;
20510 : __Pyx_RefNannyDeclarations
20511 : PyObject *__pyx_t_1 = NULL;
20512 : int __pyx_lineno = 0;
20513 : const char *__pyx_filename = NULL;
20514 : int __pyx_clineno = 0;
20515 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
20516 :
20517 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
20518 : *
20519 : * cdef inline object PyArray_MultiIterNew1(a):
20520 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
20521 : *
20522 : * cdef inline object PyArray_MultiIterNew2(a, b):
20523 : */
20524 : __Pyx_XDECREF(__pyx_r);
20525 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
20526 : __Pyx_GOTREF(__pyx_t_1);
20527 : __pyx_r = __pyx_t_1;
20528 : __pyx_t_1 = 0;
20529 : goto __pyx_L0;
20530 :
20531 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
20532 : * ctypedef long double complex clongdouble_t
20533 : *
20534 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
20535 : * return PyArray_MultiIterNew(1, <void*>a)
20536 : *
20537 : */
20538 :
20539 : /* function exit code */
20540 : __pyx_L1_error:;
20541 : __Pyx_XDECREF(__pyx_t_1);
20542 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
20543 : __pyx_r = 0;
20544 : __pyx_L0:;
20545 : __Pyx_XGIVEREF(__pyx_r);
20546 : __Pyx_RefNannyFinishContext();
20547 : return __pyx_r;
20548 : }
20549 :
20550 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
20551 : * return PyArray_MultiIterNew(1, <void*>a)
20552 : *
20553 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20554 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20555 : *
20556 : */
20557 :
20558 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
20559 : PyObject *__pyx_r = NULL;
20560 : __Pyx_RefNannyDeclarations
20561 : PyObject *__pyx_t_1 = NULL;
20562 : int __pyx_lineno = 0;
20563 : const char *__pyx_filename = NULL;
20564 : int __pyx_clineno = 0;
20565 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
20566 :
20567 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
20568 : *
20569 : * cdef inline object PyArray_MultiIterNew2(a, b):
20570 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
20571 : *
20572 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
20573 : */
20574 : __Pyx_XDECREF(__pyx_r);
20575 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
20576 : __Pyx_GOTREF(__pyx_t_1);
20577 : __pyx_r = __pyx_t_1;
20578 : __pyx_t_1 = 0;
20579 : goto __pyx_L0;
20580 :
20581 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
20582 : * return PyArray_MultiIterNew(1, <void*>a)
20583 : *
20584 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20585 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20586 : *
20587 : */
20588 :
20589 : /* function exit code */
20590 : __pyx_L1_error:;
20591 : __Pyx_XDECREF(__pyx_t_1);
20592 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
20593 : __pyx_r = 0;
20594 : __pyx_L0:;
20595 : __Pyx_XGIVEREF(__pyx_r);
20596 : __Pyx_RefNannyFinishContext();
20597 : return __pyx_r;
20598 : }
20599 :
20600 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
20601 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20602 : *
20603 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20604 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20605 : *
20606 : */
20607 :
20608 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
20609 : PyObject *__pyx_r = NULL;
20610 : __Pyx_RefNannyDeclarations
20611 : PyObject *__pyx_t_1 = NULL;
20612 : int __pyx_lineno = 0;
20613 : const char *__pyx_filename = NULL;
20614 : int __pyx_clineno = 0;
20615 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
20616 :
20617 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
20618 : *
20619 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
20620 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
20621 : *
20622 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20623 : */
20624 : __Pyx_XDECREF(__pyx_r);
20625 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
20626 : __Pyx_GOTREF(__pyx_t_1);
20627 : __pyx_r = __pyx_t_1;
20628 : __pyx_t_1 = 0;
20629 : goto __pyx_L0;
20630 :
20631 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
20632 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20633 : *
20634 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20635 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20636 : *
20637 : */
20638 :
20639 : /* function exit code */
20640 : __pyx_L1_error:;
20641 : __Pyx_XDECREF(__pyx_t_1);
20642 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20643 : __pyx_r = 0;
20644 : __pyx_L0:;
20645 : __Pyx_XGIVEREF(__pyx_r);
20646 : __Pyx_RefNannyFinishContext();
20647 : return __pyx_r;
20648 : }
20649 :
20650 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
20651 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20652 : *
20653 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20654 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20655 : *
20656 : */
20657 :
20658 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20659 : PyObject *__pyx_r = NULL;
20660 : __Pyx_RefNannyDeclarations
20661 : PyObject *__pyx_t_1 = NULL;
20662 : int __pyx_lineno = 0;
20663 : const char *__pyx_filename = NULL;
20664 : int __pyx_clineno = 0;
20665 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
20666 :
20667 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
20668 : *
20669 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20670 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
20671 : *
20672 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20673 : */
20674 : __Pyx_XDECREF(__pyx_r);
20675 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
20676 : __Pyx_GOTREF(__pyx_t_1);
20677 : __pyx_r = __pyx_t_1;
20678 : __pyx_t_1 = 0;
20679 : goto __pyx_L0;
20680 :
20681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
20682 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20683 : *
20684 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20685 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20686 : *
20687 : */
20688 :
20689 : /* function exit code */
20690 : __pyx_L1_error:;
20691 : __Pyx_XDECREF(__pyx_t_1);
20692 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20693 : __pyx_r = 0;
20694 : __pyx_L0:;
20695 : __Pyx_XGIVEREF(__pyx_r);
20696 : __Pyx_RefNannyFinishContext();
20697 : return __pyx_r;
20698 : }
20699 :
20700 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
20701 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20702 : *
20703 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20704 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20705 : *
20706 : */
20707 :
20708 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
20709 : PyObject *__pyx_r = NULL;
20710 : __Pyx_RefNannyDeclarations
20711 : PyObject *__pyx_t_1 = NULL;
20712 : int __pyx_lineno = 0;
20713 : const char *__pyx_filename = NULL;
20714 : int __pyx_clineno = 0;
20715 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
20716 :
20717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
20718 : *
20719 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20720 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
20721 : *
20722 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20723 : */
20724 : __Pyx_XDECREF(__pyx_r);
20725 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
20726 : __Pyx_GOTREF(__pyx_t_1);
20727 : __pyx_r = __pyx_t_1;
20728 : __pyx_t_1 = 0;
20729 : goto __pyx_L0;
20730 :
20731 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
20732 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20733 : *
20734 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20735 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20736 : *
20737 : */
20738 :
20739 : /* function exit code */
20740 : __pyx_L1_error:;
20741 : __Pyx_XDECREF(__pyx_t_1);
20742 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20743 : __pyx_r = 0;
20744 : __pyx_L0:;
20745 : __Pyx_XGIVEREF(__pyx_r);
20746 : __Pyx_RefNannyFinishContext();
20747 : return __pyx_r;
20748 : }
20749 :
20750 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20751 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20752 : *
20753 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20754 : * if PyDataType_HASSUBARRAY(d):
20755 : * return <tuple>d.subarray.shape
20756 : */
20757 :
20758 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20759 : PyObject *__pyx_r = NULL;
20760 : __Pyx_RefNannyDeclarations
20761 : int __pyx_t_1;
20762 : PyObject *__pyx_t_2;
20763 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
20764 :
20765 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20766 : *
20767 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20768 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20769 : * return <tuple>d.subarray.shape
20770 : * else:
20771 : */
20772 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20773 : if (__pyx_t_1) {
20774 :
20775 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
20776 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20777 : * if PyDataType_HASSUBARRAY(d):
20778 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20779 : * else:
20780 : * return ()
20781 : */
20782 : __Pyx_XDECREF(__pyx_r);
20783 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
20784 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
20785 : __pyx_r = ((PyObject*)__pyx_t_2);
20786 : goto __pyx_L0;
20787 :
20788 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20789 : *
20790 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20791 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20792 : * return <tuple>d.subarray.shape
20793 : * else:
20794 : */
20795 : }
20796 :
20797 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
20798 : * return <tuple>d.subarray.shape
20799 : * else:
20800 : * return () # <<<<<<<<<<<<<<
20801 : *
20802 : *
20803 : */
20804 : /*else*/ {
20805 : __Pyx_XDECREF(__pyx_r);
20806 : __Pyx_INCREF(__pyx_empty_tuple);
20807 : __pyx_r = __pyx_empty_tuple;
20808 : goto __pyx_L0;
20809 : }
20810 :
20811 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20812 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20813 : *
20814 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20815 : * if PyDataType_HASSUBARRAY(d):
20816 : * return <tuple>d.subarray.shape
20817 : */
20818 :
20819 : /* function exit code */
20820 : __pyx_L0:;
20821 : __Pyx_XGIVEREF(__pyx_r);
20822 : __Pyx_RefNannyFinishContext();
20823 : return __pyx_r;
20824 : }
20825 :
20826 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20827 : * int _import_umath() except -1
20828 : *
20829 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20830 : * Py_INCREF(base) # important to do this before stealing the reference below!
20831 : * PyArray_SetBaseObject(arr, base)
20832 : */
20833 :
20834 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20835 : int __pyx_t_1;
20836 : int __pyx_lineno = 0;
20837 : const char *__pyx_filename = NULL;
20838 : int __pyx_clineno = 0;
20839 :
20840 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
20841 : *
20842 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20843 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20844 : * PyArray_SetBaseObject(arr, base)
20845 : *
20846 : */
20847 : Py_INCREF(__pyx_v_base);
20848 :
20849 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
20850 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20851 : * Py_INCREF(base) # important to do this before stealing the reference below!
20852 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20853 : *
20854 : * cdef inline object get_array_base(ndarray arr):
20855 : */
20856 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
20857 :
20858 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20859 : * int _import_umath() except -1
20860 : *
20861 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20862 : * Py_INCREF(base) # important to do this before stealing the reference below!
20863 : * PyArray_SetBaseObject(arr, base)
20864 : */
20865 :
20866 : /* function exit code */
20867 : goto __pyx_L0;
20868 : __pyx_L1_error:;
20869 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20870 : __pyx_L0:;
20871 : }
20872 :
20873 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20874 : * PyArray_SetBaseObject(arr, base)
20875 : *
20876 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20877 : * base = PyArray_BASE(arr)
20878 : * if base is NULL:
20879 : */
20880 :
20881 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20882 : PyObject *__pyx_v_base;
20883 : PyObject *__pyx_r = NULL;
20884 : __Pyx_RefNannyDeclarations
20885 : int __pyx_t_1;
20886 : __Pyx_RefNannySetupContext("get_array_base", 1);
20887 :
20888 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
20889 : *
20890 : * cdef inline object get_array_base(ndarray arr):
20891 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20892 : * if base is NULL:
20893 : * return None
20894 : */
20895 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20896 :
20897 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20898 : * cdef inline object get_array_base(ndarray arr):
20899 : * base = PyArray_BASE(arr)
20900 : * if base is NULL: # <<<<<<<<<<<<<<
20901 : * return None
20902 : * return <object>base
20903 : */
20904 : __pyx_t_1 = (__pyx_v_base == NULL);
20905 : if (__pyx_t_1) {
20906 :
20907 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
20908 : * base = PyArray_BASE(arr)
20909 : * if base is NULL:
20910 : * return None # <<<<<<<<<<<<<<
20911 : * return <object>base
20912 : *
20913 : */
20914 : __Pyx_XDECREF(__pyx_r);
20915 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20916 : goto __pyx_L0;
20917 :
20918 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20919 : * cdef inline object get_array_base(ndarray arr):
20920 : * base = PyArray_BASE(arr)
20921 : * if base is NULL: # <<<<<<<<<<<<<<
20922 : * return None
20923 : * return <object>base
20924 : */
20925 : }
20926 :
20927 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
20928 : * if base is NULL:
20929 : * return None
20930 : * return <object>base # <<<<<<<<<<<<<<
20931 : *
20932 : * # Versions of the import_* functions which are more suitable for
20933 : */
20934 : __Pyx_XDECREF(__pyx_r);
20935 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
20936 : __pyx_r = ((PyObject *)__pyx_v_base);
20937 : goto __pyx_L0;
20938 :
20939 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20940 : * PyArray_SetBaseObject(arr, base)
20941 : *
20942 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20943 : * base = PyArray_BASE(arr)
20944 : * if base is NULL:
20945 : */
20946 :
20947 : /* function exit code */
20948 : __pyx_L0:;
20949 : __Pyx_XGIVEREF(__pyx_r);
20950 : __Pyx_RefNannyFinishContext();
20951 : return __pyx_r;
20952 : }
20953 :
20954 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
20955 : * # Versions of the import_* functions which are more suitable for
20956 : * # Cython code.
20957 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20958 : * try:
20959 : * __pyx_import_array()
20960 : */
20961 :
20962 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20963 3 : int __pyx_r;
20964 : __Pyx_RefNannyDeclarations
20965 3 : PyObject *__pyx_t_1 = NULL;
20966 3 : PyObject *__pyx_t_2 = NULL;
20967 3 : PyObject *__pyx_t_3 = NULL;
20968 3 : int __pyx_t_4;
20969 3 : PyObject *__pyx_t_5 = NULL;
20970 3 : PyObject *__pyx_t_6 = NULL;
20971 3 : PyObject *__pyx_t_7 = NULL;
20972 3 : PyObject *__pyx_t_8 = NULL;
20973 3 : int __pyx_lineno = 0;
20974 3 : const char *__pyx_filename = NULL;
20975 3 : int __pyx_clineno = 0;
20976 3 : __Pyx_RefNannySetupContext("import_array", 1);
20977 :
20978 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20979 : * # Cython code.
20980 : * cdef inline int import_array() except -1:
20981 : * try: # <<<<<<<<<<<<<<
20982 : * __pyx_import_array()
20983 : * except Exception:
20984 : */
20985 : {
20986 3 : __Pyx_PyThreadState_declare
20987 3 : __Pyx_PyThreadState_assign
20988 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20989 3 : __Pyx_XGOTREF(__pyx_t_1);
20990 3 : __Pyx_XGOTREF(__pyx_t_2);
20991 3 : __Pyx_XGOTREF(__pyx_t_3);
20992 : /*try:*/ {
20993 :
20994 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
20995 : * cdef inline int import_array() except -1:
20996 : * try:
20997 : * __pyx_import_array() # <<<<<<<<<<<<<<
20998 : * except Exception:
20999 : * raise ImportError("numpy._core.multiarray failed to import")
21000 : */
21001 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
21002 :
21003 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
21004 : * # Cython code.
21005 : * cdef inline int import_array() except -1:
21006 : * try: # <<<<<<<<<<<<<<
21007 : * __pyx_import_array()
21008 : * except Exception:
21009 : */
21010 : }
21011 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21012 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21013 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21014 3 : goto __pyx_L8_try_end;
21015 0 : __pyx_L3_error:;
21016 :
21017 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
21018 : * try:
21019 : * __pyx_import_array()
21020 : * except Exception: # <<<<<<<<<<<<<<
21021 : * raise ImportError("numpy._core.multiarray failed to import")
21022 : *
21023 : */
21024 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21025 0 : if (__pyx_t_4) {
21026 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21027 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
21028 0 : __Pyx_XGOTREF(__pyx_t_5);
21029 0 : __Pyx_XGOTREF(__pyx_t_6);
21030 0 : __Pyx_XGOTREF(__pyx_t_7);
21031 :
21032 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
21033 : * __pyx_import_array()
21034 : * except Exception:
21035 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
21036 : *
21037 : * cdef inline int import_umath() except -1:
21038 : */
21039 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
21040 0 : __Pyx_GOTREF(__pyx_t_8);
21041 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21042 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21043 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
21044 : }
21045 0 : goto __pyx_L5_except_error;
21046 :
21047 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
21048 : * # Cython code.
21049 : * cdef inline int import_array() except -1:
21050 : * try: # <<<<<<<<<<<<<<
21051 : * __pyx_import_array()
21052 : * except Exception:
21053 : */
21054 0 : __pyx_L5_except_error:;
21055 0 : __Pyx_XGIVEREF(__pyx_t_1);
21056 0 : __Pyx_XGIVEREF(__pyx_t_2);
21057 0 : __Pyx_XGIVEREF(__pyx_t_3);
21058 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21059 0 : goto __pyx_L1_error;
21060 3 : __pyx_L8_try_end:;
21061 : }
21062 :
21063 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
21064 : * # Versions of the import_* functions which are more suitable for
21065 : * # Cython code.
21066 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
21067 : * try:
21068 : * __pyx_import_array()
21069 : */
21070 :
21071 : /* function exit code */
21072 3 : __pyx_r = 0;
21073 3 : goto __pyx_L0;
21074 0 : __pyx_L1_error:;
21075 0 : __Pyx_XDECREF(__pyx_t_5);
21076 0 : __Pyx_XDECREF(__pyx_t_6);
21077 0 : __Pyx_XDECREF(__pyx_t_7);
21078 0 : __Pyx_XDECREF(__pyx_t_8);
21079 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21080 0 : __pyx_r = -1;
21081 3 : __pyx_L0:;
21082 3 : __Pyx_RefNannyFinishContext();
21083 3 : return __pyx_r;
21084 : }
21085 :
21086 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
21087 : * raise ImportError("numpy._core.multiarray failed to import")
21088 : *
21089 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21090 : * try:
21091 : * _import_umath()
21092 : */
21093 :
21094 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
21095 : int __pyx_r;
21096 : __Pyx_RefNannyDeclarations
21097 : PyObject *__pyx_t_1 = NULL;
21098 : PyObject *__pyx_t_2 = NULL;
21099 : PyObject *__pyx_t_3 = NULL;
21100 : int __pyx_t_4;
21101 : PyObject *__pyx_t_5 = NULL;
21102 : PyObject *__pyx_t_6 = NULL;
21103 : PyObject *__pyx_t_7 = NULL;
21104 : PyObject *__pyx_t_8 = NULL;
21105 : int __pyx_lineno = 0;
21106 : const char *__pyx_filename = NULL;
21107 : int __pyx_clineno = 0;
21108 : __Pyx_RefNannySetupContext("import_umath", 1);
21109 :
21110 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
21111 : *
21112 : * cdef inline int import_umath() except -1:
21113 : * try: # <<<<<<<<<<<<<<
21114 : * _import_umath()
21115 : * except Exception:
21116 : */
21117 : {
21118 : __Pyx_PyThreadState_declare
21119 : __Pyx_PyThreadState_assign
21120 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21121 : __Pyx_XGOTREF(__pyx_t_1);
21122 : __Pyx_XGOTREF(__pyx_t_2);
21123 : __Pyx_XGOTREF(__pyx_t_3);
21124 : /*try:*/ {
21125 :
21126 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
21127 : * cdef inline int import_umath() except -1:
21128 : * try:
21129 : * _import_umath() # <<<<<<<<<<<<<<
21130 : * except Exception:
21131 : * raise ImportError("numpy._core.umath failed to import")
21132 : */
21133 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
21134 :
21135 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
21136 : *
21137 : * cdef inline int import_umath() except -1:
21138 : * try: # <<<<<<<<<<<<<<
21139 : * _import_umath()
21140 : * except Exception:
21141 : */
21142 : }
21143 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21144 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21145 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21146 : goto __pyx_L8_try_end;
21147 : __pyx_L3_error:;
21148 :
21149 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
21150 : * try:
21151 : * _import_umath()
21152 : * except Exception: # <<<<<<<<<<<<<<
21153 : * raise ImportError("numpy._core.umath failed to import")
21154 : *
21155 : */
21156 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21157 : if (__pyx_t_4) {
21158 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21159 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
21160 : __Pyx_XGOTREF(__pyx_t_5);
21161 : __Pyx_XGOTREF(__pyx_t_6);
21162 : __Pyx_XGOTREF(__pyx_t_7);
21163 :
21164 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
21165 : * _import_umath()
21166 : * except Exception:
21167 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21168 : *
21169 : * cdef inline int import_ufunc() except -1:
21170 : */
21171 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
21172 : __Pyx_GOTREF(__pyx_t_8);
21173 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21174 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21175 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
21176 : }
21177 : goto __pyx_L5_except_error;
21178 :
21179 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
21180 : *
21181 : * cdef inline int import_umath() except -1:
21182 : * try: # <<<<<<<<<<<<<<
21183 : * _import_umath()
21184 : * except Exception:
21185 : */
21186 : __pyx_L5_except_error:;
21187 : __Pyx_XGIVEREF(__pyx_t_1);
21188 : __Pyx_XGIVEREF(__pyx_t_2);
21189 : __Pyx_XGIVEREF(__pyx_t_3);
21190 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21191 : goto __pyx_L1_error;
21192 : __pyx_L8_try_end:;
21193 : }
21194 :
21195 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
21196 : * raise ImportError("numpy._core.multiarray failed to import")
21197 : *
21198 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21199 : * try:
21200 : * _import_umath()
21201 : */
21202 :
21203 : /* function exit code */
21204 : __pyx_r = 0;
21205 : goto __pyx_L0;
21206 : __pyx_L1_error:;
21207 : __Pyx_XDECREF(__pyx_t_5);
21208 : __Pyx_XDECREF(__pyx_t_6);
21209 : __Pyx_XDECREF(__pyx_t_7);
21210 : __Pyx_XDECREF(__pyx_t_8);
21211 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21212 : __pyx_r = -1;
21213 : __pyx_L0:;
21214 : __Pyx_RefNannyFinishContext();
21215 : return __pyx_r;
21216 : }
21217 :
21218 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
21219 : * raise ImportError("numpy._core.umath failed to import")
21220 : *
21221 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21222 : * try:
21223 : * _import_umath()
21224 : */
21225 :
21226 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
21227 : int __pyx_r;
21228 : __Pyx_RefNannyDeclarations
21229 : PyObject *__pyx_t_1 = NULL;
21230 : PyObject *__pyx_t_2 = NULL;
21231 : PyObject *__pyx_t_3 = NULL;
21232 : int __pyx_t_4;
21233 : PyObject *__pyx_t_5 = NULL;
21234 : PyObject *__pyx_t_6 = NULL;
21235 : PyObject *__pyx_t_7 = NULL;
21236 : PyObject *__pyx_t_8 = NULL;
21237 : int __pyx_lineno = 0;
21238 : const char *__pyx_filename = NULL;
21239 : int __pyx_clineno = 0;
21240 : __Pyx_RefNannySetupContext("import_ufunc", 1);
21241 :
21242 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
21243 : *
21244 : * cdef inline int import_ufunc() except -1:
21245 : * try: # <<<<<<<<<<<<<<
21246 : * _import_umath()
21247 : * except Exception:
21248 : */
21249 : {
21250 : __Pyx_PyThreadState_declare
21251 : __Pyx_PyThreadState_assign
21252 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21253 : __Pyx_XGOTREF(__pyx_t_1);
21254 : __Pyx_XGOTREF(__pyx_t_2);
21255 : __Pyx_XGOTREF(__pyx_t_3);
21256 : /*try:*/ {
21257 :
21258 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
21259 : * cdef inline int import_ufunc() except -1:
21260 : * try:
21261 : * _import_umath() # <<<<<<<<<<<<<<
21262 : * except Exception:
21263 : * raise ImportError("numpy._core.umath failed to import")
21264 : */
21265 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
21266 :
21267 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
21268 : *
21269 : * cdef inline int import_ufunc() except -1:
21270 : * try: # <<<<<<<<<<<<<<
21271 : * _import_umath()
21272 : * except Exception:
21273 : */
21274 : }
21275 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21276 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21277 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21278 : goto __pyx_L8_try_end;
21279 : __pyx_L3_error:;
21280 :
21281 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
21282 : * try:
21283 : * _import_umath()
21284 : * except Exception: # <<<<<<<<<<<<<<
21285 : * raise ImportError("numpy._core.umath failed to import")
21286 : *
21287 : */
21288 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
21289 : if (__pyx_t_4) {
21290 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21291 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
21292 : __Pyx_XGOTREF(__pyx_t_5);
21293 : __Pyx_XGOTREF(__pyx_t_6);
21294 : __Pyx_XGOTREF(__pyx_t_7);
21295 :
21296 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
21297 : * _import_umath()
21298 : * except Exception:
21299 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21300 : *
21301 : *
21302 : */
21303 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
21304 : __Pyx_GOTREF(__pyx_t_8);
21305 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21306 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21307 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
21308 : }
21309 : goto __pyx_L5_except_error;
21310 :
21311 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
21312 : *
21313 : * cdef inline int import_ufunc() except -1:
21314 : * try: # <<<<<<<<<<<<<<
21315 : * _import_umath()
21316 : * except Exception:
21317 : */
21318 : __pyx_L5_except_error:;
21319 : __Pyx_XGIVEREF(__pyx_t_1);
21320 : __Pyx_XGIVEREF(__pyx_t_2);
21321 : __Pyx_XGIVEREF(__pyx_t_3);
21322 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21323 : goto __pyx_L1_error;
21324 : __pyx_L8_try_end:;
21325 : }
21326 :
21327 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
21328 : * raise ImportError("numpy._core.umath failed to import")
21329 : *
21330 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21331 : * try:
21332 : * _import_umath()
21333 : */
21334 :
21335 : /* function exit code */
21336 : __pyx_r = 0;
21337 : goto __pyx_L0;
21338 : __pyx_L1_error:;
21339 : __Pyx_XDECREF(__pyx_t_5);
21340 : __Pyx_XDECREF(__pyx_t_6);
21341 : __Pyx_XDECREF(__pyx_t_7);
21342 : __Pyx_XDECREF(__pyx_t_8);
21343 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21344 : __pyx_r = -1;
21345 : __pyx_L0:;
21346 : __Pyx_RefNannyFinishContext();
21347 : return __pyx_r;
21348 : }
21349 :
21350 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
21351 : *
21352 : *
21353 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21354 : * """
21355 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
21356 : */
21357 :
21358 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21359 : int __pyx_r;
21360 :
21361 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
21362 : * bool
21363 : * """
21364 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21365 : *
21366 : *
21367 : */
21368 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21369 : goto __pyx_L0;
21370 :
21371 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
21372 : *
21373 : *
21374 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21375 : * """
21376 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
21377 : */
21378 :
21379 : /* function exit code */
21380 : __pyx_L0:;
21381 : return __pyx_r;
21382 : }
21383 :
21384 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
21385 : *
21386 : *
21387 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21388 : * """
21389 : * Cython equivalent of `isinstance(obj, np.datetime64)`
21390 : */
21391 :
21392 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21393 : int __pyx_r;
21394 :
21395 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
21396 : * bool
21397 : * """
21398 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21399 : *
21400 : *
21401 : */
21402 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21403 : goto __pyx_L0;
21404 :
21405 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
21406 : *
21407 : *
21408 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21409 : * """
21410 : * Cython equivalent of `isinstance(obj, np.datetime64)`
21411 : */
21412 :
21413 : /* function exit code */
21414 : __pyx_L0:;
21415 : return __pyx_r;
21416 : }
21417 :
21418 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
21419 : *
21420 : *
21421 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21422 : * """
21423 : * returns the int64 value underlying scalar numpy datetime64 object
21424 : */
21425 :
21426 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21427 : npy_datetime __pyx_r;
21428 :
21429 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
21430 : * also needed. That can be found using `get_datetime64_unit`.
21431 : * """
21432 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
21433 : *
21434 : *
21435 : */
21436 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
21437 : goto __pyx_L0;
21438 :
21439 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
21440 : *
21441 : *
21442 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21443 : * """
21444 : * returns the int64 value underlying scalar numpy datetime64 object
21445 : */
21446 :
21447 : /* function exit code */
21448 : __pyx_L0:;
21449 : return __pyx_r;
21450 : }
21451 :
21452 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
21453 : *
21454 : *
21455 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21456 : * """
21457 : * returns the int64 value underlying scalar numpy timedelta64 object
21458 : */
21459 :
21460 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21461 : npy_timedelta __pyx_r;
21462 :
21463 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
21464 : * returns the int64 value underlying scalar numpy timedelta64 object
21465 : * """
21466 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
21467 : *
21468 : *
21469 : */
21470 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
21471 : goto __pyx_L0;
21472 :
21473 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
21474 : *
21475 : *
21476 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21477 : * """
21478 : * returns the int64 value underlying scalar numpy timedelta64 object
21479 : */
21480 :
21481 : /* function exit code */
21482 : __pyx_L0:;
21483 : return __pyx_r;
21484 : }
21485 :
21486 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
21487 : *
21488 : *
21489 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21490 : * """
21491 : * returns the unit part of the dtype for a numpy datetime64 object.
21492 : */
21493 :
21494 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21495 : NPY_DATETIMEUNIT __pyx_r;
21496 :
21497 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
21498 : * returns the unit part of the dtype for a numpy datetime64 object.
21499 : * """
21500 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
21501 : *
21502 : *
21503 : */
21504 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
21505 : goto __pyx_L0;
21506 :
21507 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
21508 : *
21509 : *
21510 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21511 : * """
21512 : * returns the unit part of the dtype for a numpy datetime64 object.
21513 : */
21514 :
21515 : /* function exit code */
21516 : __pyx_L0:;
21517 : return __pyx_r;
21518 : }
21519 :
21520 : /* "scipy/linalg/_decomp_interpolative.pyx":135
21521 : *
21522 : *
21523 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
21524 : * cdef int n = A.shape[1], j = 0, intone = 1
21525 : * cdef cnp.float64_t snorm = 0.0
21526 : */
21527 :
21528 : /* Python wrapper */
21529 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_1idd_diffsnorm(PyObject *__pyx_self,
21530 : #if CYTHON_METH_FASTCALL
21531 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21532 : #else
21533 : PyObject *__pyx_args, PyObject *__pyx_kwds
21534 : #endif
21535 : ); /*proto*/
21536 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_1idd_diffsnorm = {"idd_diffsnorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_1idd_diffsnorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21537 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_1idd_diffsnorm(PyObject *__pyx_self,
21538 : #if CYTHON_METH_FASTCALL
21539 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21540 : #else
21541 : PyObject *__pyx_args, PyObject *__pyx_kwds
21542 : #endif
21543 : ) {
21544 1 : PyObject *__pyx_v_A = 0;
21545 1 : PyObject *__pyx_v_B = 0;
21546 1 : PyObject *__pyx_v_rng = 0;
21547 1 : int __pyx_v_its;
21548 : #if !CYTHON_METH_FASTCALL
21549 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21550 : #endif
21551 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21552 1 : PyObject* values[4] = {0,0,0,0};
21553 1 : int __pyx_lineno = 0;
21554 1 : const char *__pyx_filename = NULL;
21555 1 : int __pyx_clineno = 0;
21556 1 : PyObject *__pyx_r = 0;
21557 : __Pyx_RefNannyDeclarations
21558 1 : __Pyx_RefNannySetupContext("idd_diffsnorm (wrapper)", 0);
21559 : #if !CYTHON_METH_FASTCALL
21560 : #if CYTHON_ASSUME_SAFE_MACROS
21561 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21562 : #else
21563 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21564 : #endif
21565 : #endif
21566 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21567 : {
21568 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_rng,&__pyx_n_s_its,0};
21569 1 : if (likely(__pyx_kwds)) {
21570 1 : Py_ssize_t kw_args;
21571 1 : switch (__pyx_nargs) {
21572 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21573 1 : CYTHON_FALLTHROUGH;
21574 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21575 1 : CYTHON_FALLTHROUGH;
21576 1 : case 0: break;
21577 0 : default: goto __pyx_L5_argtuple_error;
21578 : }
21579 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21580 1 : switch (__pyx_nargs) {
21581 : case 0:
21582 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
21583 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21584 0 : kw_args--;
21585 : }
21586 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error)
21587 0 : else goto __pyx_L5_argtuple_error;
21588 0 : CYTHON_FALLTHROUGH;
21589 : case 1:
21590 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) {
21591 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
21592 0 : kw_args--;
21593 : }
21594 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error)
21595 : else {
21596 0 : __Pyx_RaiseArgtupleInvalid("idd_diffsnorm", 1, 2, 2, 1); __PYX_ERR(0, 135, __pyx_L3_error)
21597 : }
21598 1 : CYTHON_FALLTHROUGH;
21599 : case 2:
21600 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
21601 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
21602 1 : kw_args--;
21603 : }
21604 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error)
21605 : else {
21606 0 : __Pyx_RaiseKeywordRequired("idd_diffsnorm", __pyx_n_s_rng); __PYX_ERR(0, 135, __pyx_L3_error)
21607 : }
21608 : }
21609 1 : if (kw_args == 1) {
21610 1 : const Py_ssize_t index = 3;
21611 1 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
21612 1 : if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
21613 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error)
21614 : }
21615 1 : if (unlikely(kw_args > 0)) {
21616 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21617 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_diffsnorm") < 0)) __PYX_ERR(0, 135, __pyx_L3_error)
21618 : }
21619 0 : } else if (unlikely(__pyx_nargs != 2)) {
21620 0 : goto __pyx_L5_argtuple_error;
21621 : } else {
21622 0 : __Pyx_RaiseKeywordRequired("idd_diffsnorm", __pyx_n_s_rng); __PYX_ERR(0, 135, __pyx_L3_error)
21623 : }
21624 1 : __pyx_v_A = values[0];
21625 1 : __pyx_v_B = values[1];
21626 1 : __pyx_v_rng = values[2];
21627 1 : if (values[3]) {
21628 1 : __pyx_v_its = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_its == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L3_error)
21629 : } else {
21630 : __pyx_v_its = ((int)((int)20));
21631 : }
21632 : }
21633 1 : goto __pyx_L6_skip;
21634 0 : __pyx_L5_argtuple_error:;
21635 0 : __Pyx_RaiseArgtupleInvalid("idd_diffsnorm", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 135, __pyx_L3_error)
21636 1 : __pyx_L6_skip:;
21637 1 : goto __pyx_L4_argument_unpacking_done;
21638 0 : __pyx_L3_error:;
21639 : {
21640 0 : Py_ssize_t __pyx_temp;
21641 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21642 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21643 : }
21644 : }
21645 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_diffsnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
21646 0 : __Pyx_RefNannyFinishContext();
21647 0 : return NULL;
21648 1 : __pyx_L4_argument_unpacking_done:;
21649 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_idd_diffsnorm(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_rng, __pyx_v_its);
21650 :
21651 : /* function exit code */
21652 : {
21653 1 : Py_ssize_t __pyx_temp;
21654 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21655 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21656 : }
21657 : }
21658 : __Pyx_RefNannyFinishContext();
21659 : return __pyx_r;
21660 : }
21661 :
21662 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_idd_diffsnorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_rng, int __pyx_v_its) {
21663 1 : int __pyx_v_n;
21664 1 : CYTHON_UNUSED int __pyx_v_j;
21665 1 : int __pyx_v_intone;
21666 1 : __pyx_t_5numpy_float64_t __pyx_v_snorm;
21667 1 : PyArrayObject *__pyx_v_v1 = 0;
21668 1 : PyArrayObject *__pyx_v_v2 = 0;
21669 1 : PyArrayObject *__pyx_v_u1 = 0;
21670 1 : PyArrayObject *__pyx_v_u2 = 0;
21671 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u1;
21672 1 : __Pyx_Buffer __pyx_pybuffer_u1;
21673 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u2;
21674 1 : __Pyx_Buffer __pyx_pybuffer_u2;
21675 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
21676 1 : __Pyx_Buffer __pyx_pybuffer_v1;
21677 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
21678 1 : __Pyx_Buffer __pyx_pybuffer_v2;
21679 1 : PyObject *__pyx_r = NULL;
21680 : __Pyx_RefNannyDeclarations
21681 1 : PyObject *__pyx_t_1 = NULL;
21682 1 : PyObject *__pyx_t_2 = NULL;
21683 1 : int __pyx_t_3;
21684 1 : PyObject *__pyx_t_4 = NULL;
21685 1 : PyArrayObject *__pyx_t_5 = NULL;
21686 1 : PyObject *__pyx_t_6 = NULL;
21687 1 : PyObject *__pyx_t_7 = NULL;
21688 1 : PyObject *__pyx_t_8 = NULL;
21689 1 : Py_ssize_t __pyx_t_9;
21690 1 : int __pyx_t_10;
21691 1 : int __pyx_t_11;
21692 1 : unsigned int __pyx_t_12;
21693 1 : PyArrayObject *__pyx_t_13 = NULL;
21694 1 : int __pyx_t_14;
21695 1 : PyArrayObject *__pyx_t_15 = NULL;
21696 1 : PyArrayObject *__pyx_t_16 = NULL;
21697 1 : int __pyx_t_17;
21698 1 : PyObject *__pyx_t_18 = NULL;
21699 1 : __pyx_t_5numpy_float64_t __pyx_t_19;
21700 1 : int __pyx_lineno = 0;
21701 1 : const char *__pyx_filename = NULL;
21702 1 : int __pyx_clineno = 0;
21703 1 : __Pyx_RefNannySetupContext("idd_diffsnorm", 1);
21704 1 : __pyx_pybuffer_v1.pybuffer.buf = NULL;
21705 1 : __pyx_pybuffer_v1.refcount = 0;
21706 1 : __pyx_pybuffernd_v1.data = NULL;
21707 1 : __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
21708 1 : __pyx_pybuffer_v2.pybuffer.buf = NULL;
21709 1 : __pyx_pybuffer_v2.refcount = 0;
21710 1 : __pyx_pybuffernd_v2.data = NULL;
21711 1 : __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
21712 1 : __pyx_pybuffer_u1.pybuffer.buf = NULL;
21713 1 : __pyx_pybuffer_u1.refcount = 0;
21714 1 : __pyx_pybuffernd_u1.data = NULL;
21715 1 : __pyx_pybuffernd_u1.rcbuffer = &__pyx_pybuffer_u1;
21716 1 : __pyx_pybuffer_u2.pybuffer.buf = NULL;
21717 1 : __pyx_pybuffer_u2.refcount = 0;
21718 1 : __pyx_pybuffernd_u2.data = NULL;
21719 1 : __pyx_pybuffernd_u2.rcbuffer = &__pyx_pybuffer_u2;
21720 :
21721 : /* "scipy/linalg/_decomp_interpolative.pyx":136
21722 : *
21723 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20):
21724 : * cdef int n = A.shape[1], j = 0, intone = 1 # <<<<<<<<<<<<<<
21725 : * cdef cnp.float64_t snorm = 0.0
21726 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] v1
21727 : */
21728 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
21729 1 : __Pyx_GOTREF(__pyx_t_1);
21730 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
21731 1 : __Pyx_GOTREF(__pyx_t_2);
21732 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21733 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
21734 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21735 1 : __pyx_v_n = __pyx_t_3;
21736 1 : __pyx_v_j = 0;
21737 1 : __pyx_v_intone = 1;
21738 :
21739 : /* "scipy/linalg/_decomp_interpolative.pyx":137
21740 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20):
21741 : * cdef int n = A.shape[1], j = 0, intone = 1
21742 : * cdef cnp.float64_t snorm = 0.0 # <<<<<<<<<<<<<<
21743 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] v1
21744 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] v2
21745 : */
21746 1 : __pyx_v_snorm = 0.0;
21747 :
21748 : /* "scipy/linalg/_decomp_interpolative.pyx":143
21749 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] u2
21750 : *
21751 : * v1 = rng.uniform(low=-1., high=1., size=n) # <<<<<<<<<<<<<<
21752 : * v1 /= dnrm2(&n, &v1[0], &intone)
21753 : *
21754 : */
21755 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
21756 1 : __Pyx_GOTREF(__pyx_t_2);
21757 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
21758 1 : __Pyx_GOTREF(__pyx_t_1);
21759 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_low, __pyx_float_neg_1_) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
21760 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_high, __pyx_float_1_) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
21761 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
21762 1 : __Pyx_GOTREF(__pyx_t_4);
21763 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
21764 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21765 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
21766 1 : __Pyx_GOTREF(__pyx_t_4);
21767 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21768 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21769 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 143, __pyx_L1_error)
21770 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
21771 : {
21772 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21773 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
21774 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
21775 1 : if (unlikely(__pyx_t_3 < 0)) {
21776 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
21777 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
21778 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
21779 : __Pyx_RaiseBufferFallbackError();
21780 : } else {
21781 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
21782 : }
21783 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
21784 : }
21785 1 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
21786 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 143, __pyx_L1_error)
21787 : }
21788 1 : __pyx_t_5 = 0;
21789 1 : __pyx_v_v1 = ((PyArrayObject *)__pyx_t_4);
21790 1 : __pyx_t_4 = 0;
21791 :
21792 : /* "scipy/linalg/_decomp_interpolative.pyx":144
21793 : *
21794 : * v1 = rng.uniform(low=-1., high=1., size=n)
21795 : * v1 /= dnrm2(&n, &v1[0], &intone) # <<<<<<<<<<<<<<
21796 : *
21797 : * for j in range(its):
21798 : */
21799 1 : __pyx_t_9 = 0;
21800 1 : __pyx_t_4 = PyFloat_FromDouble(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v1.diminfo[0].strides))), (&__pyx_v_intone))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
21801 1 : __Pyx_GOTREF(__pyx_t_4);
21802 1 : __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v1), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
21803 1 : __Pyx_GOTREF(__pyx_t_1);
21804 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21805 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 144, __pyx_L1_error)
21806 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
21807 : {
21808 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21809 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
21810 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
21811 1 : if (unlikely(__pyx_t_3 < 0)) {
21812 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
21813 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
21814 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
21815 0 : __Pyx_RaiseBufferFallbackError();
21816 : } else {
21817 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
21818 : }
21819 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
21820 : }
21821 1 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
21822 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 144, __pyx_L1_error)
21823 : }
21824 1 : __pyx_t_5 = 0;
21825 1 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_1));
21826 : __pyx_t_1 = 0;
21827 :
21828 : /* "scipy/linalg/_decomp_interpolative.pyx":146
21829 : * v1 /= dnrm2(&n, &v1[0], &intone)
21830 : *
21831 : * for j in range(its): # <<<<<<<<<<<<<<
21832 : * u1 = A.matvec(v1)
21833 : * u2 = B.matvec(v1)
21834 : */
21835 21 : __pyx_t_3 = __pyx_v_its;
21836 : __pyx_t_10 = __pyx_t_3;
21837 21 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
21838 20 : __pyx_v_j = __pyx_t_11;
21839 :
21840 : /* "scipy/linalg/_decomp_interpolative.pyx":147
21841 : *
21842 : * for j in range(its):
21843 : * u1 = A.matvec(v1) # <<<<<<<<<<<<<<
21844 : * u2 = B.matvec(v1)
21845 : * u1 -= u2
21846 : */
21847 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
21848 20 : __Pyx_GOTREF(__pyx_t_4);
21849 20 : __pyx_t_2 = NULL;
21850 20 : __pyx_t_12 = 0;
21851 : #if CYTHON_UNPACK_METHODS
21852 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
21853 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
21854 20 : if (likely(__pyx_t_2)) {
21855 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21856 20 : __Pyx_INCREF(__pyx_t_2);
21857 20 : __Pyx_INCREF(function);
21858 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
21859 : __pyx_t_12 = 1;
21860 : }
21861 : }
21862 : #endif
21863 : {
21864 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_v1)};
21865 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
21866 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21867 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
21868 20 : __Pyx_GOTREF(__pyx_t_1);
21869 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21870 : }
21871 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 147, __pyx_L1_error)
21872 20 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
21873 : {
21874 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21875 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
21876 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
21877 20 : if (unlikely(__pyx_t_14 < 0)) {
21878 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
21879 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_v_u1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
21880 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
21881 0 : __Pyx_RaiseBufferFallbackError();
21882 : } else {
21883 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
21884 : }
21885 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
21886 : }
21887 20 : __pyx_pybuffernd_u1.diminfo[0].strides = __pyx_pybuffernd_u1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u1.diminfo[0].shape = __pyx_pybuffernd_u1.rcbuffer->pybuffer.shape[0];
21888 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 147, __pyx_L1_error)
21889 : }
21890 20 : __pyx_t_13 = 0;
21891 20 : __Pyx_XDECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_1));
21892 20 : __pyx_t_1 = 0;
21893 :
21894 : /* "scipy/linalg/_decomp_interpolative.pyx":148
21895 : * for j in range(its):
21896 : * u1 = A.matvec(v1)
21897 : * u2 = B.matvec(v1) # <<<<<<<<<<<<<<
21898 : * u1 -= u2
21899 : * v1 = A.rmatvec(u1)
21900 : */
21901 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_matvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
21902 20 : __Pyx_GOTREF(__pyx_t_4);
21903 20 : __pyx_t_2 = NULL;
21904 20 : __pyx_t_12 = 0;
21905 : #if CYTHON_UNPACK_METHODS
21906 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
21907 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
21908 20 : if (likely(__pyx_t_2)) {
21909 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21910 20 : __Pyx_INCREF(__pyx_t_2);
21911 20 : __Pyx_INCREF(function);
21912 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
21913 : __pyx_t_12 = 1;
21914 : }
21915 : }
21916 : #endif
21917 : {
21918 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_v1)};
21919 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
21920 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21921 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
21922 20 : __Pyx_GOTREF(__pyx_t_1);
21923 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21924 : }
21925 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 148, __pyx_L1_error)
21926 20 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
21927 : {
21928 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21929 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
21930 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u2.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
21931 20 : if (unlikely(__pyx_t_14 < 0)) {
21932 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
21933 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u2.rcbuffer->pybuffer, (PyObject*)__pyx_v_u2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
21934 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
21935 0 : __Pyx_RaiseBufferFallbackError();
21936 : } else {
21937 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
21938 : }
21939 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
21940 : }
21941 20 : __pyx_pybuffernd_u2.diminfo[0].strides = __pyx_pybuffernd_u2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u2.diminfo[0].shape = __pyx_pybuffernd_u2.rcbuffer->pybuffer.shape[0];
21942 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 148, __pyx_L1_error)
21943 : }
21944 20 : __pyx_t_15 = 0;
21945 20 : __Pyx_XDECREF_SET(__pyx_v_u2, ((PyArrayObject *)__pyx_t_1));
21946 20 : __pyx_t_1 = 0;
21947 :
21948 : /* "scipy/linalg/_decomp_interpolative.pyx":149
21949 : * u1 = A.matvec(v1)
21950 : * u2 = B.matvec(v1)
21951 : * u1 -= u2 # <<<<<<<<<<<<<<
21952 : * v1 = A.rmatvec(u1)
21953 : * v2 = B.rmatvec(u1)
21954 : */
21955 20 : __pyx_t_1 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_u1), ((PyObject *)__pyx_v_u2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
21956 20 : __Pyx_GOTREF(__pyx_t_1);
21957 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error)
21958 20 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
21959 : {
21960 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
21961 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
21962 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
21963 20 : if (unlikely(__pyx_t_14 < 0)) {
21964 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
21965 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_v_u1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
21966 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
21967 0 : __Pyx_RaiseBufferFallbackError();
21968 : } else {
21969 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
21970 : }
21971 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
21972 : }
21973 20 : __pyx_pybuffernd_u1.diminfo[0].strides = __pyx_pybuffernd_u1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u1.diminfo[0].shape = __pyx_pybuffernd_u1.rcbuffer->pybuffer.shape[0];
21974 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 149, __pyx_L1_error)
21975 : }
21976 20 : __pyx_t_13 = 0;
21977 20 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_1));
21978 20 : __pyx_t_1 = 0;
21979 :
21980 : /* "scipy/linalg/_decomp_interpolative.pyx":150
21981 : * u2 = B.matvec(v1)
21982 : * u1 -= u2
21983 : * v1 = A.rmatvec(u1) # <<<<<<<<<<<<<<
21984 : * v2 = B.rmatvec(u1)
21985 : * v1 -= v2
21986 : */
21987 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
21988 20 : __Pyx_GOTREF(__pyx_t_4);
21989 20 : __pyx_t_2 = NULL;
21990 20 : __pyx_t_12 = 0;
21991 : #if CYTHON_UNPACK_METHODS
21992 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
21993 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
21994 20 : if (likely(__pyx_t_2)) {
21995 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21996 20 : __Pyx_INCREF(__pyx_t_2);
21997 20 : __Pyx_INCREF(function);
21998 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
21999 : __pyx_t_12 = 1;
22000 : }
22001 : }
22002 : #endif
22003 : {
22004 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_u1)};
22005 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
22006 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22007 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
22008 20 : __Pyx_GOTREF(__pyx_t_1);
22009 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22010 : }
22011 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 150, __pyx_L1_error)
22012 20 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
22013 : {
22014 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22015 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
22016 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
22017 20 : if (unlikely(__pyx_t_14 < 0)) {
22018 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
22019 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
22020 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
22021 0 : __Pyx_RaiseBufferFallbackError();
22022 : } else {
22023 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
22024 : }
22025 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
22026 : }
22027 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
22028 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 150, __pyx_L1_error)
22029 : }
22030 20 : __pyx_t_5 = 0;
22031 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_1));
22032 20 : __pyx_t_1 = 0;
22033 :
22034 : /* "scipy/linalg/_decomp_interpolative.pyx":151
22035 : * u1 -= u2
22036 : * v1 = A.rmatvec(u1)
22037 : * v2 = B.rmatvec(u1) # <<<<<<<<<<<<<<
22038 : * v1 -= v2
22039 : *
22040 : */
22041 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
22042 20 : __Pyx_GOTREF(__pyx_t_4);
22043 20 : __pyx_t_2 = NULL;
22044 20 : __pyx_t_12 = 0;
22045 : #if CYTHON_UNPACK_METHODS
22046 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
22047 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22048 20 : if (likely(__pyx_t_2)) {
22049 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22050 20 : __Pyx_INCREF(__pyx_t_2);
22051 20 : __Pyx_INCREF(function);
22052 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
22053 : __pyx_t_12 = 1;
22054 : }
22055 : }
22056 : #endif
22057 : {
22058 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_u1)};
22059 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
22060 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22061 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
22062 20 : __Pyx_GOTREF(__pyx_t_1);
22063 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22064 : }
22065 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 151, __pyx_L1_error)
22066 20 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
22067 : {
22068 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22069 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
22070 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
22071 20 : if (unlikely(__pyx_t_14 < 0)) {
22072 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
22073 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
22074 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
22075 0 : __Pyx_RaiseBufferFallbackError();
22076 : } else {
22077 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
22078 : }
22079 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
22080 : }
22081 20 : __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0];
22082 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 151, __pyx_L1_error)
22083 : }
22084 20 : __pyx_t_16 = 0;
22085 20 : __Pyx_XDECREF_SET(__pyx_v_v2, ((PyArrayObject *)__pyx_t_1));
22086 20 : __pyx_t_1 = 0;
22087 :
22088 : /* "scipy/linalg/_decomp_interpolative.pyx":152
22089 : * v1 = A.rmatvec(u1)
22090 : * v2 = B.rmatvec(u1)
22091 : * v1 -= v2 # <<<<<<<<<<<<<<
22092 : *
22093 : * snorm = dnrm2(&n, &v1[0], &intone)
22094 : */
22095 20 : __pyx_t_1 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_v1), ((PyObject *)__pyx_v_v2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
22096 20 : __Pyx_GOTREF(__pyx_t_1);
22097 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 152, __pyx_L1_error)
22098 20 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
22099 : {
22100 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22101 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
22102 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
22103 20 : if (unlikely(__pyx_t_14 < 0)) {
22104 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
22105 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
22106 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
22107 0 : __Pyx_RaiseBufferFallbackError();
22108 : } else {
22109 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
22110 : }
22111 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
22112 : }
22113 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
22114 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 152, __pyx_L1_error)
22115 : }
22116 20 : __pyx_t_5 = 0;
22117 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_1));
22118 20 : __pyx_t_1 = 0;
22119 :
22120 : /* "scipy/linalg/_decomp_interpolative.pyx":154
22121 : * v1 -= v2
22122 : *
22123 : * snorm = dnrm2(&n, &v1[0], &intone) # <<<<<<<<<<<<<<
22124 : * if snorm > 0.0:
22125 : * v1 /= snorm
22126 : */
22127 20 : __pyx_t_9 = 0;
22128 20 : __pyx_v_snorm = __pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v1.diminfo[0].strides))), (&__pyx_v_intone));
22129 :
22130 : /* "scipy/linalg/_decomp_interpolative.pyx":155
22131 : *
22132 : * snorm = dnrm2(&n, &v1[0], &intone)
22133 : * if snorm > 0.0: # <<<<<<<<<<<<<<
22134 : * v1 /= snorm
22135 : *
22136 : */
22137 20 : __pyx_t_17 = (__pyx_v_snorm > 0.0);
22138 20 : if (__pyx_t_17) {
22139 :
22140 : /* "scipy/linalg/_decomp_interpolative.pyx":156
22141 : * snorm = dnrm2(&n, &v1[0], &intone)
22142 : * if snorm > 0.0:
22143 : * v1 /= snorm # <<<<<<<<<<<<<<
22144 : *
22145 : * snorm = np.sqrt(snorm)
22146 : */
22147 20 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
22148 20 : __Pyx_GOTREF(__pyx_t_1);
22149 20 : __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v1), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
22150 20 : __Pyx_GOTREF(__pyx_t_4);
22151 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22152 20 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 156, __pyx_L1_error)
22153 20 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
22154 : {
22155 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22156 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
22157 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
22158 20 : if (unlikely(__pyx_t_14 < 0)) {
22159 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
22160 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
22161 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
22162 0 : __Pyx_RaiseBufferFallbackError();
22163 : } else {
22164 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
22165 : }
22166 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
22167 : }
22168 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
22169 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 156, __pyx_L1_error)
22170 : }
22171 20 : __pyx_t_5 = 0;
22172 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_4));
22173 : __pyx_t_4 = 0;
22174 :
22175 : /* "scipy/linalg/_decomp_interpolative.pyx":155
22176 : *
22177 : * snorm = dnrm2(&n, &v1[0], &intone)
22178 : * if snorm > 0.0: # <<<<<<<<<<<<<<
22179 : * v1 /= snorm
22180 : *
22181 : */
22182 : }
22183 :
22184 : /* "scipy/linalg/_decomp_interpolative.pyx":158
22185 : * v1 /= snorm
22186 : *
22187 : * snorm = np.sqrt(snorm) # <<<<<<<<<<<<<<
22188 : *
22189 : * return snorm
22190 : */
22191 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
22192 20 : __Pyx_GOTREF(__pyx_t_1);
22193 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
22194 20 : __Pyx_GOTREF(__pyx_t_2);
22195 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22196 20 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
22197 20 : __Pyx_GOTREF(__pyx_t_1);
22198 20 : __pyx_t_18 = NULL;
22199 20 : __pyx_t_12 = 0;
22200 : #if CYTHON_UNPACK_METHODS
22201 20 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
22202 0 : __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_2);
22203 0 : if (likely(__pyx_t_18)) {
22204 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22205 0 : __Pyx_INCREF(__pyx_t_18);
22206 0 : __Pyx_INCREF(function);
22207 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22208 : __pyx_t_12 = 1;
22209 : }
22210 : }
22211 : #endif
22212 : {
22213 20 : PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_1};
22214 20 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
22215 20 : __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
22216 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22217 20 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
22218 20 : __Pyx_GOTREF(__pyx_t_4);
22219 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22220 : }
22221 20 : __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
22222 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22223 20 : __pyx_v_snorm = __pyx_t_19;
22224 : }
22225 :
22226 : /* "scipy/linalg/_decomp_interpolative.pyx":160
22227 : * snorm = np.sqrt(snorm)
22228 : *
22229 : * return snorm # <<<<<<<<<<<<<<
22230 : *
22231 : *
22232 : */
22233 1 : __Pyx_XDECREF(__pyx_r);
22234 1 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
22235 1 : __Pyx_GOTREF(__pyx_t_4);
22236 1 : __pyx_r = __pyx_t_4;
22237 1 : __pyx_t_4 = 0;
22238 1 : goto __pyx_L0;
22239 :
22240 : /* "scipy/linalg/_decomp_interpolative.pyx":135
22241 : *
22242 : *
22243 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
22244 : * cdef int n = A.shape[1], j = 0, intone = 1
22245 : * cdef cnp.float64_t snorm = 0.0
22246 : */
22247 :
22248 : /* function exit code */
22249 0 : __pyx_L1_error:;
22250 0 : __Pyx_XDECREF(__pyx_t_1);
22251 0 : __Pyx_XDECREF(__pyx_t_2);
22252 0 : __Pyx_XDECREF(__pyx_t_4);
22253 0 : __Pyx_XDECREF(__pyx_t_18);
22254 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
22255 0 : __Pyx_PyThreadState_declare
22256 0 : __Pyx_PyThreadState_assign
22257 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
22258 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
22259 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
22260 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
22261 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
22262 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
22263 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_diffsnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
22264 0 : __pyx_r = NULL;
22265 0 : goto __pyx_L2;
22266 1 : __pyx_L0:;
22267 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
22268 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
22269 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
22270 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
22271 1 : __pyx_L2:;
22272 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v1);
22273 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v2);
22274 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u1);
22275 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u2);
22276 1 : __Pyx_XGIVEREF(__pyx_r);
22277 1 : __Pyx_RefNannyFinishContext();
22278 1 : return __pyx_r;
22279 : }
22280 :
22281 : /* "scipy/linalg/_decomp_interpolative.pyx":163
22282 : *
22283 : *
22284 : * def idd_estrank(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
22285 : * rng):
22286 : * cdef int m = a.shape[0], n = a.shape[1]
22287 : */
22288 :
22289 : /* Python wrapper */
22290 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_3idd_estrank(PyObject *__pyx_self,
22291 : #if CYTHON_METH_FASTCALL
22292 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22293 : #else
22294 : PyObject *__pyx_args, PyObject *__pyx_kwds
22295 : #endif
22296 : ); /*proto*/
22297 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_3idd_estrank = {"idd_estrank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_3idd_estrank, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22298 6 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_3idd_estrank(PyObject *__pyx_self,
22299 : #if CYTHON_METH_FASTCALL
22300 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22301 : #else
22302 : PyObject *__pyx_args, PyObject *__pyx_kwds
22303 : #endif
22304 : ) {
22305 6 : PyArrayObject *__pyx_v_a = 0;
22306 6 : double __pyx_v_eps;
22307 6 : PyObject *__pyx_v_rng = 0;
22308 : #if !CYTHON_METH_FASTCALL
22309 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22310 : #endif
22311 6 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22312 6 : PyObject* values[3] = {0,0,0};
22313 6 : int __pyx_lineno = 0;
22314 6 : const char *__pyx_filename = NULL;
22315 6 : int __pyx_clineno = 0;
22316 6 : PyObject *__pyx_r = 0;
22317 : __Pyx_RefNannyDeclarations
22318 6 : __Pyx_RefNannySetupContext("idd_estrank (wrapper)", 0);
22319 : #if !CYTHON_METH_FASTCALL
22320 : #if CYTHON_ASSUME_SAFE_MACROS
22321 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22322 : #else
22323 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22324 : #endif
22325 : #endif
22326 6 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22327 : {
22328 6 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
22329 6 : if (likely(__pyx_kwds)) {
22330 6 : Py_ssize_t kw_args;
22331 6 : switch (__pyx_nargs) {
22332 6 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22333 6 : CYTHON_FALLTHROUGH;
22334 6 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22335 6 : CYTHON_FALLTHROUGH;
22336 6 : case 0: break;
22337 0 : default: goto __pyx_L5_argtuple_error;
22338 : }
22339 6 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
22340 6 : switch (__pyx_nargs) {
22341 : case 0:
22342 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
22343 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
22344 0 : kw_args--;
22345 : }
22346 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
22347 0 : else goto __pyx_L5_argtuple_error;
22348 0 : CYTHON_FALLTHROUGH;
22349 : case 1:
22350 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
22351 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
22352 0 : kw_args--;
22353 : }
22354 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
22355 : else {
22356 0 : __Pyx_RaiseArgtupleInvalid("idd_estrank", 1, 2, 2, 1); __PYX_ERR(0, 163, __pyx_L3_error)
22357 : }
22358 6 : CYTHON_FALLTHROUGH;
22359 : case 2:
22360 6 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
22361 6 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
22362 6 : kw_args--;
22363 : }
22364 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
22365 : else {
22366 0 : __Pyx_RaiseKeywordRequired("idd_estrank", __pyx_n_s_rng); __PYX_ERR(0, 163, __pyx_L3_error)
22367 : }
22368 : }
22369 6 : if (unlikely(kw_args > 0)) {
22370 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22371 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_estrank") < 0)) __PYX_ERR(0, 163, __pyx_L3_error)
22372 : }
22373 0 : } else if (unlikely(__pyx_nargs != 2)) {
22374 0 : goto __pyx_L5_argtuple_error;
22375 : } else {
22376 0 : __Pyx_RaiseKeywordRequired("idd_estrank", __pyx_n_s_rng); __PYX_ERR(0, 163, __pyx_L3_error)
22377 : }
22378 6 : __pyx_v_a = ((PyArrayObject *)values[0]);
22379 6 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
22380 6 : __pyx_v_rng = values[2];
22381 : }
22382 6 : goto __pyx_L6_skip;
22383 0 : __pyx_L5_argtuple_error:;
22384 0 : __Pyx_RaiseArgtupleInvalid("idd_estrank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 163, __pyx_L3_error)
22385 6 : __pyx_L6_skip:;
22386 6 : goto __pyx_L4_argument_unpacking_done;
22387 0 : __pyx_L3_error:;
22388 : {
22389 0 : Py_ssize_t __pyx_temp;
22390 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22391 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22392 : }
22393 : }
22394 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_estrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
22395 0 : __Pyx_RefNannyFinishContext();
22396 0 : return NULL;
22397 6 : __pyx_L4_argument_unpacking_done:;
22398 6 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
22399 6 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_2idd_estrank(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
22400 :
22401 : /* function exit code */
22402 6 : goto __pyx_L0;
22403 0 : __pyx_L1_error:;
22404 0 : __pyx_r = NULL;
22405 6 : __pyx_L0:;
22406 : {
22407 6 : Py_ssize_t __pyx_temp;
22408 6 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22409 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22410 : }
22411 : }
22412 : __Pyx_RefNannyFinishContext();
22413 : return __pyx_r;
22414 : }
22415 :
22416 6 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_2idd_estrank(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng) {
22417 6 : int __pyx_v_m;
22418 6 : int __pyx_v_n;
22419 6 : int __pyx_v_intone;
22420 6 : int __pyx_v_n2;
22421 6 : int __pyx_v_nsteps;
22422 6 : int __pyx_v_row;
22423 6 : int __pyx_v_r;
22424 6 : int __pyx_v_nstep;
22425 6 : int __pyx_v_cols;
22426 6 : int __pyx_v_k;
22427 6 : int __pyx_v_nulls;
22428 6 : __pyx_t_5numpy_float64_t __pyx_v_h;
22429 6 : __pyx_t_5numpy_float64_t __pyx_v_alpha;
22430 6 : __pyx_t_5numpy_float64_t __pyx_v_beta;
22431 6 : PyArrayObject *__pyx_v_albetas = 0;
22432 6 : PyArrayObject *__pyx_v_tau_arr = 0;
22433 6 : PyArrayObject *__pyx_v_subselect = 0;
22434 6 : __pyx_t_5numpy_float64_t *__pyx_v_aa;
22435 6 : __pyx_t_5numpy_float64_t *__pyx_v_ff;
22436 6 : __Pyx_memviewslice __pyx_v_Fmemview = { 0, 0, { 0 }, { 0 }, { 0 } };
22437 6 : PyArrayObject *__pyx_v_giv2x2 = 0;
22438 6 : PyArrayObject *__pyx_v_rta = 0;
22439 6 : PyArrayObject *__pyx_v_Fc = 0;
22440 6 : PyArrayObject *__pyx_v_F = 0;
22441 6 : PyObject *__pyx_v_Fcopy = NULL;
22442 6 : PyObject *__pyx_v_sssmax = NULL;
22443 6 : int __pyx_v_kk;
22444 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_F;
22445 6 : __Pyx_Buffer __pyx_pybuffer_F;
22446 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_Fc;
22447 6 : __Pyx_Buffer __pyx_pybuffer_Fc;
22448 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
22449 6 : __Pyx_Buffer __pyx_pybuffer_a;
22450 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_albetas;
22451 6 : __Pyx_Buffer __pyx_pybuffer_albetas;
22452 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_giv2x2;
22453 6 : __Pyx_Buffer __pyx_pybuffer_giv2x2;
22454 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rta;
22455 6 : __Pyx_Buffer __pyx_pybuffer_rta;
22456 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_subselect;
22457 6 : __Pyx_Buffer __pyx_pybuffer_subselect;
22458 6 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau_arr;
22459 6 : __Pyx_Buffer __pyx_pybuffer_tau_arr;
22460 6 : PyObject *__pyx_r = NULL;
22461 : __Pyx_RefNannyDeclarations
22462 6 : PyObject *__pyx_t_1 = NULL;
22463 6 : PyObject *__pyx_t_2 = NULL;
22464 6 : PyObject *__pyx_t_3 = NULL;
22465 6 : PyObject *__pyx_t_4 = NULL;
22466 6 : PyObject *__pyx_t_5 = NULL;
22467 6 : PyArrayObject *__pyx_t_6 = NULL;
22468 6 : int __pyx_t_7;
22469 6 : PyObject *__pyx_t_8 = NULL;
22470 6 : PyObject *__pyx_t_9 = NULL;
22471 6 : PyObject *__pyx_t_10 = NULL;
22472 6 : long __pyx_t_11;
22473 6 : long __pyx_t_12;
22474 6 : int __pyx_t_13;
22475 6 : long __pyx_t_14;
22476 6 : unsigned int __pyx_t_15;
22477 6 : PyArrayObject *__pyx_t_16 = NULL;
22478 6 : npy_intp __pyx_t_17[2];
22479 6 : PyArrayObject *__pyx_t_18 = NULL;
22480 6 : int __pyx_t_19;
22481 6 : int __pyx_t_20;
22482 6 : Py_ssize_t __pyx_t_21;
22483 6 : Py_ssize_t __pyx_t_22;
22484 6 : Py_ssize_t __pyx_t_23;
22485 6 : __pyx_t_5numpy_float64_t __pyx_t_24;
22486 6 : __pyx_t_5numpy_float64_t __pyx_t_25;
22487 6 : PyObject *__pyx_t_26 = NULL;
22488 6 : PyArrayObject *__pyx_t_27 = NULL;
22489 6 : PyArrayObject *__pyx_t_28 = NULL;
22490 6 : PyObject *__pyx_t_29 = NULL;
22491 6 : PyArrayObject *__pyx_t_30 = NULL;
22492 6 : int __pyx_t_31;
22493 6 : npy_intp __pyx_t_32[1];
22494 6 : PyArrayObject *__pyx_t_33 = NULL;
22495 6 : __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } };
22496 6 : int __pyx_t_35;
22497 6 : PyObject *__pyx_t_36 = NULL;
22498 6 : Py_ssize_t __pyx_t_37;
22499 6 : Py_ssize_t __pyx_t_38;
22500 6 : int __pyx_lineno = 0;
22501 6 : const char *__pyx_filename = NULL;
22502 6 : int __pyx_clineno = 0;
22503 6 : __Pyx_RefNannySetupContext("idd_estrank", 1);
22504 6 : __pyx_pybuffer_albetas.pybuffer.buf = NULL;
22505 6 : __pyx_pybuffer_albetas.refcount = 0;
22506 6 : __pyx_pybuffernd_albetas.data = NULL;
22507 6 : __pyx_pybuffernd_albetas.rcbuffer = &__pyx_pybuffer_albetas;
22508 6 : __pyx_pybuffer_tau_arr.pybuffer.buf = NULL;
22509 6 : __pyx_pybuffer_tau_arr.refcount = 0;
22510 6 : __pyx_pybuffernd_tau_arr.data = NULL;
22511 6 : __pyx_pybuffernd_tau_arr.rcbuffer = &__pyx_pybuffer_tau_arr;
22512 6 : __pyx_pybuffer_subselect.pybuffer.buf = NULL;
22513 6 : __pyx_pybuffer_subselect.refcount = 0;
22514 6 : __pyx_pybuffernd_subselect.data = NULL;
22515 6 : __pyx_pybuffernd_subselect.rcbuffer = &__pyx_pybuffer_subselect;
22516 6 : __pyx_pybuffer_giv2x2.pybuffer.buf = NULL;
22517 6 : __pyx_pybuffer_giv2x2.refcount = 0;
22518 6 : __pyx_pybuffernd_giv2x2.data = NULL;
22519 6 : __pyx_pybuffernd_giv2x2.rcbuffer = &__pyx_pybuffer_giv2x2;
22520 6 : __pyx_pybuffer_rta.pybuffer.buf = NULL;
22521 6 : __pyx_pybuffer_rta.refcount = 0;
22522 6 : __pyx_pybuffernd_rta.data = NULL;
22523 6 : __pyx_pybuffernd_rta.rcbuffer = &__pyx_pybuffer_rta;
22524 6 : __pyx_pybuffer_Fc.pybuffer.buf = NULL;
22525 6 : __pyx_pybuffer_Fc.refcount = 0;
22526 6 : __pyx_pybuffernd_Fc.data = NULL;
22527 6 : __pyx_pybuffernd_Fc.rcbuffer = &__pyx_pybuffer_Fc;
22528 6 : __pyx_pybuffer_F.pybuffer.buf = NULL;
22529 6 : __pyx_pybuffer_F.refcount = 0;
22530 6 : __pyx_pybuffernd_F.data = NULL;
22531 6 : __pyx_pybuffernd_F.rcbuffer = &__pyx_pybuffer_F;
22532 6 : __pyx_pybuffer_a.pybuffer.buf = NULL;
22533 6 : __pyx_pybuffer_a.refcount = 0;
22534 6 : __pyx_pybuffernd_a.data = NULL;
22535 6 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
22536 : {
22537 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22538 6 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 163, __pyx_L1_error)
22539 : }
22540 6 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
22541 :
22542 : /* "scipy/linalg/_decomp_interpolative.pyx":165
22543 : * def idd_estrank(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, eps: float, *,
22544 : * rng):
22545 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
22546 : * cdef int intone = 1, n2, nsteps = 3, row, r, nstep, cols, k, nulls
22547 : * cdef cnp.float64_t h, alpha, beta
22548 : */
22549 6 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
22550 6 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
22551 :
22552 : /* "scipy/linalg/_decomp_interpolative.pyx":166
22553 : * rng):
22554 : * cdef int m = a.shape[0], n = a.shape[1]
22555 : * cdef int intone = 1, n2, nsteps = 3, row, r, nstep, cols, k, nulls # <<<<<<<<<<<<<<
22556 : * cdef cnp.float64_t h, alpha, beta
22557 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=3] albetas
22558 : */
22559 6 : __pyx_v_intone = 1;
22560 6 : __pyx_v_nsteps = 3;
22561 :
22562 : /* "scipy/linalg/_decomp_interpolative.pyx":179
22563 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] F
22564 : *
22565 : * n2 = idd_poweroftwo(m) # <<<<<<<<<<<<<<
22566 : *
22567 : * # This part is the initialization that is done via idd_frmi
22568 : */
22569 12 : __pyx_v_n2 = __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(__pyx_v_m);
22570 :
22571 : /* "scipy/linalg/_decomp_interpolative.pyx":186
22572 : * # Draw (nsteps x m x 2) arrays from [-1, 1) uniformly and scale
22573 : * # each 2-element row to unity norm
22574 : * albetas = rng.uniform(low=-1.0, high=1.0, size=[nsteps, m, 2]) # <<<<<<<<<<<<<<
22575 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas)
22576 : * # Walk over every 2D row and normalize
22577 : */
22578 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
22579 6 : __Pyx_GOTREF(__pyx_t_1);
22580 6 : __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
22581 6 : __Pyx_GOTREF(__pyx_t_2);
22582 6 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_low, __pyx_float_neg_1_0) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
22583 6 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_high, __pyx_float_1_0) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
22584 6 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
22585 6 : __Pyx_GOTREF(__pyx_t_3);
22586 6 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
22587 6 : __Pyx_GOTREF(__pyx_t_4);
22588 6 : __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
22589 6 : __Pyx_GOTREF(__pyx_t_5);
22590 6 : __Pyx_GIVEREF(__pyx_t_3);
22591 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error);
22592 6 : __Pyx_GIVEREF(__pyx_t_4);
22593 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error);
22594 6 : __Pyx_INCREF(__pyx_int_2);
22595 6 : __Pyx_GIVEREF(__pyx_int_2);
22596 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_2)) __PYX_ERR(0, 186, __pyx_L1_error);
22597 6 : __pyx_t_3 = 0;
22598 6 : __pyx_t_4 = 0;
22599 6 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_5) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
22600 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22601 6 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
22602 6 : __Pyx_GOTREF(__pyx_t_5);
22603 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22604 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22605 6 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 186, __pyx_L1_error)
22606 6 : __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
22607 : {
22608 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22609 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
22610 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
22611 6 : if (unlikely(__pyx_t_7 < 0)) {
22612 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
22613 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_v_albetas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
22614 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
22615 : __Pyx_RaiseBufferFallbackError();
22616 : } else {
22617 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
22618 : }
22619 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
22620 : }
22621 6 : __pyx_pybuffernd_albetas.diminfo[0].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_albetas.diminfo[0].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_albetas.diminfo[1].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_albetas.diminfo[1].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_albetas.diminfo[2].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_albetas.diminfo[2].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[2];
22622 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 186, __pyx_L1_error)
22623 : }
22624 6 : __pyx_t_6 = 0;
22625 6 : __pyx_v_albetas = ((PyArrayObject *)__pyx_t_5);
22626 6 : __pyx_t_5 = 0;
22627 :
22628 : /* "scipy/linalg/_decomp_interpolative.pyx":187
22629 : * # each 2-element row to unity norm
22630 : * albetas = rng.uniform(low=-1.0, high=1.0, size=[nsteps, m, 2])
22631 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas) # <<<<<<<<<<<<<<
22632 : * # Walk over every 2D row and normalize
22633 : * for r in range(0, 2*nsteps*m, 2):
22634 : */
22635 6 : __pyx_v_aa = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_v_albetas)));
22636 :
22637 : /* "scipy/linalg/_decomp_interpolative.pyx":189
22638 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas)
22639 : * # Walk over every 2D row and normalize
22640 : * for r in range(0, 2*nsteps*m, 2): # <<<<<<<<<<<<<<
22641 : * h = 1/hypot(aa[r], aa[r+1])
22642 : * aa[r] *= h
22643 : */
22644 6 : __pyx_t_11 = ((2 * __pyx_v_nsteps) * __pyx_v_m);
22645 6 : __pyx_t_12 = __pyx_t_11;
22646 2781 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=2) {
22647 2775 : __pyx_v_r = __pyx_t_7;
22648 :
22649 : /* "scipy/linalg/_decomp_interpolative.pyx":190
22650 : * # Walk over every 2D row and normalize
22651 : * for r in range(0, 2*nsteps*m, 2):
22652 : * h = 1/hypot(aa[r], aa[r+1]) # <<<<<<<<<<<<<<
22653 : * aa[r] *= h
22654 : * aa[r+1] *= h
22655 : */
22656 2775 : __pyx_v_h = (1.0 / hypot((__pyx_v_aa[__pyx_v_r]), (__pyx_v_aa[(__pyx_v_r + 1)])));
22657 :
22658 : /* "scipy/linalg/_decomp_interpolative.pyx":191
22659 : * for r in range(0, 2*nsteps*m, 2):
22660 : * h = 1/hypot(aa[r], aa[r+1])
22661 : * aa[r] *= h # <<<<<<<<<<<<<<
22662 : * aa[r+1] *= h
22663 : *
22664 : */
22665 2775 : __pyx_t_13 = __pyx_v_r;
22666 2775 : (__pyx_v_aa[__pyx_t_13]) = ((__pyx_v_aa[__pyx_t_13]) * __pyx_v_h);
22667 :
22668 : /* "scipy/linalg/_decomp_interpolative.pyx":192
22669 : * h = 1/hypot(aa[r], aa[r+1])
22670 : * aa[r] *= h
22671 : * aa[r+1] *= h # <<<<<<<<<<<<<<
22672 : *
22673 : * # idd_random_transf
22674 : */
22675 2775 : __pyx_t_14 = (__pyx_v_r + 1);
22676 2775 : (__pyx_v_aa[__pyx_t_14]) = ((__pyx_v_aa[__pyx_t_14]) * __pyx_v_h);
22677 : }
22678 :
22679 : /* "scipy/linalg/_decomp_interpolative.pyx":195
22680 : *
22681 : * # idd_random_transf
22682 : * rta = a.copy() # <<<<<<<<<<<<<<
22683 : *
22684 : * # Rotate and shuffle "a" nsteps-many times
22685 : */
22686 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
22687 6 : __Pyx_GOTREF(__pyx_t_2);
22688 6 : __pyx_t_1 = NULL;
22689 6 : __pyx_t_15 = 0;
22690 : #if CYTHON_UNPACK_METHODS
22691 6 : if (likely(PyMethod_Check(__pyx_t_2))) {
22692 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22693 0 : if (likely(__pyx_t_1)) {
22694 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22695 0 : __Pyx_INCREF(__pyx_t_1);
22696 0 : __Pyx_INCREF(function);
22697 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
22698 : __pyx_t_15 = 1;
22699 : }
22700 : }
22701 : #endif
22702 : {
22703 6 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
22704 6 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
22705 6 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22706 6 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L1_error)
22707 6 : __Pyx_GOTREF(__pyx_t_5);
22708 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22709 : }
22710 6 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 195, __pyx_L1_error)
22711 6 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
22712 : {
22713 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22714 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
22715 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
22716 6 : if (unlikely(__pyx_t_7 < 0)) {
22717 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
22718 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
22719 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
22720 : __Pyx_RaiseBufferFallbackError();
22721 : } else {
22722 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
22723 : }
22724 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
22725 : }
22726 6 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
22727 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 195, __pyx_L1_error)
22728 : }
22729 6 : __pyx_t_16 = 0;
22730 6 : __pyx_v_rta = ((PyArrayObject *)__pyx_t_5);
22731 6 : __pyx_t_5 = 0;
22732 :
22733 : /* "scipy/linalg/_decomp_interpolative.pyx":198
22734 : *
22735 : * # Rotate and shuffle "a" nsteps-many times
22736 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
22737 : * for nstep in range(nsteps):
22738 : * for row in range(m-1):
22739 : */
22740 6 : __pyx_t_17[0] = 2;
22741 6 : __pyx_t_17[1] = 2;
22742 6 : __pyx_t_5 = PyArray_ZEROS(2, __pyx_t_17, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error)
22743 6 : __Pyx_GOTREF(__pyx_t_5);
22744 6 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 198, __pyx_L1_error)
22745 6 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
22746 : {
22747 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22748 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
22749 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
22750 6 : if (unlikely(__pyx_t_7 < 0)) {
22751 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
22752 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_v_giv2x2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
22753 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
22754 : __Pyx_RaiseBufferFallbackError();
22755 : } else {
22756 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
22757 : }
22758 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
22759 : }
22760 6 : __pyx_pybuffernd_giv2x2.diminfo[0].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_giv2x2.diminfo[0].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_giv2x2.diminfo[1].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_giv2x2.diminfo[1].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[1];
22761 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
22762 : }
22763 6 : __pyx_t_18 = 0;
22764 6 : __pyx_v_giv2x2 = ((PyArrayObject *)__pyx_t_5);
22765 6 : __pyx_t_5 = 0;
22766 :
22767 : /* "scipy/linalg/_decomp_interpolative.pyx":199
22768 : * # Rotate and shuffle "a" nsteps-many times
22769 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0)
22770 : * for nstep in range(nsteps): # <<<<<<<<<<<<<<
22771 : * for row in range(m-1):
22772 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
22773 : */
22774 6 : __pyx_t_7 = __pyx_v_nsteps;
22775 6 : __pyx_t_13 = __pyx_t_7;
22776 24 : for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_13; __pyx_t_19+=1) {
22777 18 : __pyx_v_nstep = __pyx_t_19;
22778 :
22779 : /* "scipy/linalg/_decomp_interpolative.pyx":200
22780 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0)
22781 : * for nstep in range(nsteps):
22782 : * for row in range(m-1): # <<<<<<<<<<<<<<
22783 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
22784 : * giv2x2[0, 0] = alpha
22785 : */
22786 18 : __pyx_t_11 = (__pyx_v_m - 1);
22787 18 : __pyx_t_12 = __pyx_t_11;
22788 2775 : for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_12; __pyx_t_20+=1) {
22789 2757 : __pyx_v_row = __pyx_t_20;
22790 :
22791 : /* "scipy/linalg/_decomp_interpolative.pyx":201
22792 : * for nstep in range(nsteps):
22793 : * for row in range(m-1):
22794 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1] # <<<<<<<<<<<<<<
22795 : * giv2x2[0, 0] = alpha
22796 : * giv2x2[0, 1] = beta
22797 : */
22798 2757 : __pyx_t_21 = __pyx_v_nstep;
22799 2757 : __pyx_t_22 = __pyx_v_row;
22800 2757 : __pyx_t_23 = 0;
22801 2757 : __pyx_t_24 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_albetas.diminfo[2].strides));
22802 2757 : __pyx_t_23 = __pyx_v_nstep;
22803 2757 : __pyx_t_22 = __pyx_v_row;
22804 2757 : __pyx_t_21 = 1;
22805 2757 : __pyx_t_25 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_albetas.diminfo[2].strides));
22806 2757 : __pyx_v_alpha = __pyx_t_24;
22807 2757 : __pyx_v_beta = __pyx_t_25;
22808 :
22809 : /* "scipy/linalg/_decomp_interpolative.pyx":202
22810 : * for row in range(m-1):
22811 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
22812 : * giv2x2[0, 0] = alpha # <<<<<<<<<<<<<<
22813 : * giv2x2[0, 1] = beta
22814 : * giv2x2[1, 0] = -beta
22815 : */
22816 2757 : __pyx_t_21 = 0;
22817 2757 : __pyx_t_22 = 0;
22818 2757 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
22819 :
22820 : /* "scipy/linalg/_decomp_interpolative.pyx":203
22821 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
22822 : * giv2x2[0, 0] = alpha
22823 : * giv2x2[0, 1] = beta # <<<<<<<<<<<<<<
22824 : * giv2x2[1, 0] = -beta
22825 : * giv2x2[1, 1] = alpha
22826 : */
22827 2757 : __pyx_t_22 = 0;
22828 2757 : __pyx_t_21 = 1;
22829 2757 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_beta;
22830 :
22831 : /* "scipy/linalg/_decomp_interpolative.pyx":204
22832 : * giv2x2[0, 0] = alpha
22833 : * giv2x2[0, 1] = beta
22834 : * giv2x2[1, 0] = -beta # <<<<<<<<<<<<<<
22835 : * giv2x2[1, 1] = alpha
22836 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
22837 : */
22838 2757 : __pyx_t_21 = 1;
22839 2757 : __pyx_t_22 = 0;
22840 2757 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = (-__pyx_v_beta);
22841 :
22842 : /* "scipy/linalg/_decomp_interpolative.pyx":205
22843 : * giv2x2[0, 1] = beta
22844 : * giv2x2[1, 0] = -beta
22845 : * giv2x2[1, 1] = alpha # <<<<<<<<<<<<<<
22846 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
22847 : *
22848 : */
22849 2757 : __pyx_t_22 = 1;
22850 2757 : __pyx_t_21 = 1;
22851 2757 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
22852 :
22853 : /* "scipy/linalg/_decomp_interpolative.pyx":206
22854 : * giv2x2[1, 0] = -beta
22855 : * giv2x2[1, 1] = alpha
22856 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :]) # <<<<<<<<<<<<<<
22857 : *
22858 : * rta = rta[rng.permutation(m), :]
22859 : */
22860 2757 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
22861 2757 : __Pyx_GOTREF(__pyx_t_5);
22862 2757 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_matmul); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
22863 2757 : __Pyx_GOTREF(__pyx_t_2);
22864 2757 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22865 2757 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
22866 2757 : __Pyx_GOTREF(__pyx_t_5);
22867 2757 : __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
22868 2757 : __Pyx_GOTREF(__pyx_t_1);
22869 2757 : __pyx_t_4 = PySlice_New(__pyx_t_5, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
22870 2757 : __Pyx_GOTREF(__pyx_t_4);
22871 2757 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22872 2757 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22873 2757 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
22874 2757 : __Pyx_GOTREF(__pyx_t_1);
22875 2757 : __Pyx_GIVEREF(__pyx_t_4);
22876 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error);
22877 2757 : __Pyx_INCREF(__pyx_slice__5);
22878 2757 : __Pyx_GIVEREF(__pyx_slice__5);
22879 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__5)) __PYX_ERR(0, 206, __pyx_L1_error);
22880 2757 : __pyx_t_4 = 0;
22881 2757 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
22882 2757 : __Pyx_GOTREF(__pyx_t_4);
22883 2757 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22884 2757 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
22885 2757 : __Pyx_GOTREF(__pyx_t_1);
22886 2757 : __Pyx_INCREF((PyObject *)__pyx_v_giv2x2);
22887 2757 : __Pyx_GIVEREF((PyObject *)__pyx_v_giv2x2);
22888 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_giv2x2))) __PYX_ERR(0, 206, __pyx_L1_error);
22889 2757 : __Pyx_GIVEREF(__pyx_t_4);
22890 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error);
22891 2757 : __pyx_t_4 = 0;
22892 2757 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
22893 2757 : __Pyx_GOTREF(__pyx_t_4);
22894 2757 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
22895 2757 : __Pyx_GOTREF(__pyx_t_5);
22896 2757 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
22897 2757 : __Pyx_GOTREF(__pyx_t_3);
22898 2757 : __pyx_t_26 = PySlice_New(__pyx_t_5, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 206, __pyx_L1_error)
22899 2757 : __Pyx_GOTREF(__pyx_t_26);
22900 2757 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22901 2757 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22902 2757 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
22903 2757 : __Pyx_GOTREF(__pyx_t_3);
22904 2757 : __Pyx_GIVEREF(__pyx_t_26);
22905 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_26)) __PYX_ERR(0, 206, __pyx_L1_error);
22906 2757 : __Pyx_INCREF(__pyx_slice__5);
22907 2757 : __Pyx_GIVEREF(__pyx_slice__5);
22908 2757 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 206, __pyx_L1_error);
22909 2757 : __pyx_t_26 = 0;
22910 2757 : __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 206, __pyx_L1_error)
22911 2757 : __Pyx_GOTREF(__pyx_t_26);
22912 2757 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22913 2757 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_out, __pyx_t_26) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
22914 2757 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
22915 2757 : __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 206, __pyx_L1_error)
22916 2757 : __Pyx_GOTREF(__pyx_t_26);
22917 2757 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22918 2757 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22919 2757 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22920 5514 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
22921 : }
22922 :
22923 : /* "scipy/linalg/_decomp_interpolative.pyx":208
22924 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
22925 : *
22926 : * rta = rta[rng.permutation(m), :] # <<<<<<<<<<<<<<
22927 : *
22928 : * # idd_subselect pick randomly n2-many rows
22929 : */
22930 18 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
22931 18 : __Pyx_GOTREF(__pyx_t_4);
22932 18 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
22933 18 : __Pyx_GOTREF(__pyx_t_1);
22934 18 : __pyx_t_2 = NULL;
22935 18 : __pyx_t_15 = 0;
22936 : #if CYTHON_UNPACK_METHODS
22937 18 : if (likely(PyMethod_Check(__pyx_t_4))) {
22938 18 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22939 18 : if (likely(__pyx_t_2)) {
22940 18 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22941 18 : __Pyx_INCREF(__pyx_t_2);
22942 18 : __Pyx_INCREF(function);
22943 18 : __Pyx_DECREF_SET(__pyx_t_4, function);
22944 : __pyx_t_15 = 1;
22945 : }
22946 : }
22947 : #endif
22948 : {
22949 18 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
22950 18 : __pyx_t_26 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
22951 18 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22952 18 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22953 18 : if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 208, __pyx_L1_error)
22954 18 : __Pyx_GOTREF(__pyx_t_26);
22955 18 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22956 : }
22957 18 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
22958 18 : __Pyx_GOTREF(__pyx_t_4);
22959 18 : __Pyx_GIVEREF(__pyx_t_26);
22960 18 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_26)) __PYX_ERR(0, 208, __pyx_L1_error);
22961 18 : __Pyx_INCREF(__pyx_slice__5);
22962 18 : __Pyx_GIVEREF(__pyx_slice__5);
22963 18 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 208, __pyx_L1_error);
22964 18 : __pyx_t_26 = 0;
22965 18 : __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_4); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 208, __pyx_L1_error)
22966 18 : __Pyx_GOTREF(__pyx_t_26);
22967 18 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22968 18 : if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 208, __pyx_L1_error)
22969 18 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_26);
22970 : {
22971 18 : __Pyx_BufFmt_StackElem __pyx_stack[1];
22972 18 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
22973 18 : __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
22974 18 : if (unlikely(__pyx_t_20 < 0)) {
22975 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
22976 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
22977 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
22978 0 : __Pyx_RaiseBufferFallbackError();
22979 : } else {
22980 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
22981 : }
22982 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
22983 : }
22984 18 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
22985 18 : if (unlikely((__pyx_t_20 < 0))) __PYX_ERR(0, 208, __pyx_L1_error)
22986 : }
22987 18 : __pyx_t_16 = 0;
22988 18 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_26));
22989 18 : __pyx_t_26 = 0;
22990 : }
22991 :
22992 : /* "scipy/linalg/_decomp_interpolative.pyx":211
22993 : *
22994 : * # idd_subselect pick randomly n2-many rows
22995 : * subselect = rng.choice(m, n2, replace=False) # <<<<<<<<<<<<<<
22996 : * rta = rta[subselect, :]
22997 : *
22998 : */
22999 6 : __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 211, __pyx_L1_error)
23000 6 : __Pyx_GOTREF(__pyx_t_26);
23001 6 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
23002 6 : __Pyx_GOTREF(__pyx_t_4);
23003 6 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
23004 6 : __Pyx_GOTREF(__pyx_t_1);
23005 6 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
23006 6 : __Pyx_GOTREF(__pyx_t_2);
23007 6 : __Pyx_GIVEREF(__pyx_t_4);
23008 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error);
23009 6 : __Pyx_GIVEREF(__pyx_t_1);
23010 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error);
23011 6 : __pyx_t_4 = 0;
23012 6 : __pyx_t_1 = 0;
23013 6 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
23014 6 : __Pyx_GOTREF(__pyx_t_1);
23015 6 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
23016 6 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
23017 6 : __Pyx_GOTREF(__pyx_t_4);
23018 6 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23019 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23020 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23021 6 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 211, __pyx_L1_error)
23022 6 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_4);
23023 : {
23024 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23025 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
23026 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
23027 6 : if (unlikely(__pyx_t_7 < 0)) {
23028 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
23029 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_v_subselect, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
23030 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
23031 : __Pyx_RaiseBufferFallbackError();
23032 : } else {
23033 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23034 : }
23035 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
23036 : }
23037 6 : __pyx_pybuffernd_subselect.diminfo[0].strides = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_subselect.diminfo[0].shape = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.shape[0];
23038 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 211, __pyx_L1_error)
23039 : }
23040 6 : __pyx_t_27 = 0;
23041 6 : __pyx_v_subselect = ((PyArrayObject *)__pyx_t_4);
23042 6 : __pyx_t_4 = 0;
23043 :
23044 : /* "scipy/linalg/_decomp_interpolative.pyx":212
23045 : * # idd_subselect pick randomly n2-many rows
23046 : * subselect = rng.choice(m, n2, replace=False)
23047 : * rta = rta[subselect, :] # <<<<<<<<<<<<<<
23048 : *
23049 : * # Perform rfft on each column. Note that the first and the last
23050 : */
23051 6 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
23052 6 : __Pyx_GOTREF(__pyx_t_4);
23053 6 : __Pyx_INCREF((PyObject *)__pyx_v_subselect);
23054 6 : __Pyx_GIVEREF((PyObject *)__pyx_v_subselect);
23055 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_subselect))) __PYX_ERR(0, 212, __pyx_L1_error);
23056 6 : __Pyx_INCREF(__pyx_slice__5);
23057 6 : __Pyx_GIVEREF(__pyx_slice__5);
23058 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 212, __pyx_L1_error);
23059 6 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
23060 6 : __Pyx_GOTREF(__pyx_t_1);
23061 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23062 6 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 212, __pyx_L1_error)
23063 6 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
23064 : {
23065 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23066 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
23067 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
23068 6 : if (unlikely(__pyx_t_7 < 0)) {
23069 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
23070 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
23071 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
23072 0 : __Pyx_RaiseBufferFallbackError();
23073 : } else {
23074 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
23075 : }
23076 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
23077 : }
23078 6 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
23079 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 212, __pyx_L1_error)
23080 : }
23081 6 : __pyx_t_16 = 0;
23082 6 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_1));
23083 6 : __pyx_t_1 = 0;
23084 :
23085 : /* "scipy/linalg/_decomp_interpolative.pyx":220
23086 : * # (by also removing the 2nd and last all-0 rows -- see idd_frm).
23087 : * # Then after transpose we do a final row shuffle after transpose.
23088 : * Fc = rfft(rta.T, axis=1) # <<<<<<<<<<<<<<
23089 : * # Move the first col to second col
23090 : * Fc[:, 0] *= 1.j
23091 : */
23092 6 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_rfft); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
23093 6 : __Pyx_GOTREF(__pyx_t_1);
23094 6 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rta), __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
23095 6 : __Pyx_GOTREF(__pyx_t_4);
23096 6 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
23097 6 : __Pyx_GOTREF(__pyx_t_2);
23098 6 : __Pyx_GIVEREF(__pyx_t_4);
23099 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error);
23100 6 : __pyx_t_4 = 0;
23101 6 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
23102 6 : __Pyx_GOTREF(__pyx_t_4);
23103 6 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
23104 6 : __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 220, __pyx_L1_error)
23105 6 : __Pyx_GOTREF(__pyx_t_26);
23106 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23107 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23108 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23109 6 : if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 220, __pyx_L1_error)
23110 6 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_26);
23111 : {
23112 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23113 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Fc.rcbuffer->pybuffer);
23114 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Fc.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
23115 6 : if (unlikely(__pyx_t_7 < 0)) {
23116 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
23117 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Fc.rcbuffer->pybuffer, (PyObject*)__pyx_v_Fc, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
23118 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
23119 : __Pyx_RaiseBufferFallbackError();
23120 : } else {
23121 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23122 : }
23123 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
23124 : }
23125 6 : __pyx_pybuffernd_Fc.diminfo[0].strides = __pyx_pybuffernd_Fc.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Fc.diminfo[0].shape = __pyx_pybuffernd_Fc.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Fc.diminfo[1].strides = __pyx_pybuffernd_Fc.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Fc.diminfo[1].shape = __pyx_pybuffernd_Fc.rcbuffer->pybuffer.shape[1];
23126 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 220, __pyx_L1_error)
23127 : }
23128 6 : __pyx_t_28 = 0;
23129 6 : __pyx_v_Fc = ((PyArrayObject *)__pyx_t_26);
23130 6 : __pyx_t_26 = 0;
23131 :
23132 : /* "scipy/linalg/_decomp_interpolative.pyx":222
23133 : * Fc = rfft(rta.T, axis=1)
23134 : * # Move the first col to second col
23135 : * Fc[:, 0] *= 1.j # <<<<<<<<<<<<<<
23136 : * # Perform the final permutation
23137 : * F = Fc.view(np.float64)[:, 1:-1].T[rng.permutation(n2), :]
23138 : */
23139 6 : __Pyx_INCREF(__pyx_tuple__11);
23140 6 : __pyx_t_29 = __pyx_tuple__11;
23141 6 : __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_Fc), __pyx_t_29); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 222, __pyx_L1_error)
23142 6 : __Pyx_GOTREF(__pyx_t_26);
23143 6 : __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
23144 6 : __Pyx_GOTREF(__pyx_t_4);
23145 6 : __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_26, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
23146 6 : __Pyx_GOTREF(__pyx_t_2);
23147 6 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23148 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23149 6 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_Fc), __pyx_t_29, __pyx_t_2) < 0))) __PYX_ERR(0, 222, __pyx_L1_error)
23150 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23151 6 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
23152 :
23153 : /* "scipy/linalg/_decomp_interpolative.pyx":224
23154 : * Fc[:, 0] *= 1.j
23155 : * # Perform the final permutation
23156 : * F = Fc.view(np.float64)[:, 1:-1].T[rng.permutation(n2), :] # <<<<<<<<<<<<<<
23157 : *
23158 : * Fcopy = F.copy()
23159 : */
23160 6 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Fc), __pyx_n_s_view); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
23161 6 : __Pyx_GOTREF(__pyx_t_4);
23162 6 : __Pyx_GetModuleGlobalName(__pyx_t_26, __pyx_n_s_np); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 224, __pyx_L1_error)
23163 6 : __Pyx_GOTREF(__pyx_t_26);
23164 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_26, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
23165 6 : __Pyx_GOTREF(__pyx_t_1);
23166 6 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23167 6 : __pyx_t_26 = NULL;
23168 6 : __pyx_t_15 = 0;
23169 : #if CYTHON_UNPACK_METHODS
23170 6 : if (likely(PyMethod_Check(__pyx_t_4))) {
23171 0 : __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_4);
23172 0 : if (likely(__pyx_t_26)) {
23173 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23174 0 : __Pyx_INCREF(__pyx_t_26);
23175 0 : __Pyx_INCREF(function);
23176 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
23177 : __pyx_t_15 = 1;
23178 : }
23179 : }
23180 : #endif
23181 : {
23182 6 : PyObject *__pyx_callargs[2] = {__pyx_t_26, __pyx_t_1};
23183 6 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
23184 6 : __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
23185 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23186 6 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
23187 6 : __Pyx_GOTREF(__pyx_t_2);
23188 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23189 : }
23190 6 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_tuple__13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
23191 6 : __Pyx_GOTREF(__pyx_t_4);
23192 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23193 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
23194 6 : __Pyx_GOTREF(__pyx_t_2);
23195 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23196 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
23197 6 : __Pyx_GOTREF(__pyx_t_1);
23198 6 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 224, __pyx_L1_error)
23199 6 : __Pyx_GOTREF(__pyx_t_26);
23200 6 : __pyx_t_3 = NULL;
23201 6 : __pyx_t_15 = 0;
23202 : #if CYTHON_UNPACK_METHODS
23203 6 : if (likely(PyMethod_Check(__pyx_t_1))) {
23204 6 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
23205 6 : if (likely(__pyx_t_3)) {
23206 6 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23207 6 : __Pyx_INCREF(__pyx_t_3);
23208 6 : __Pyx_INCREF(function);
23209 6 : __Pyx_DECREF_SET(__pyx_t_1, function);
23210 : __pyx_t_15 = 1;
23211 : }
23212 : }
23213 : #endif
23214 : {
23215 6 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_26};
23216 6 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
23217 6 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23218 6 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23219 6 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
23220 6 : __Pyx_GOTREF(__pyx_t_4);
23221 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23222 : }
23223 6 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
23224 6 : __Pyx_GOTREF(__pyx_t_1);
23225 6 : __Pyx_GIVEREF(__pyx_t_4);
23226 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error);
23227 6 : __Pyx_INCREF(__pyx_slice__5);
23228 6 : __Pyx_GIVEREF(__pyx_slice__5);
23229 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__5)) __PYX_ERR(0, 224, __pyx_L1_error);
23230 6 : __pyx_t_4 = 0;
23231 6 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
23232 6 : __Pyx_GOTREF(__pyx_t_4);
23233 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23234 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23235 6 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 224, __pyx_L1_error)
23236 6 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_4);
23237 : {
23238 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23239 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
23240 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
23241 6 : if (unlikely(__pyx_t_7 < 0)) {
23242 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
23243 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_v_F, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
23244 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
23245 : __Pyx_RaiseBufferFallbackError();
23246 : } else {
23247 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
23248 : }
23249 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
23250 : }
23251 6 : __pyx_pybuffernd_F.diminfo[0].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_F.diminfo[0].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_F.diminfo[1].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_F.diminfo[1].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[1];
23252 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 224, __pyx_L1_error)
23253 : }
23254 6 : __pyx_t_30 = 0;
23255 6 : __pyx_v_F = ((PyArrayObject *)__pyx_t_4);
23256 6 : __pyx_t_4 = 0;
23257 :
23258 : /* "scipy/linalg/_decomp_interpolative.pyx":226
23259 : * F = Fc.view(np.float64)[:, 1:-1].T[rng.permutation(n2), :]
23260 : *
23261 : * Fcopy = F.copy() # <<<<<<<<<<<<<<
23262 : * cols = F.shape[1]
23263 : * row = F.shape[0]
23264 : */
23265 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_F), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
23266 6 : __Pyx_GOTREF(__pyx_t_1);
23267 6 : __pyx_t_2 = NULL;
23268 6 : __pyx_t_15 = 0;
23269 : #if CYTHON_UNPACK_METHODS
23270 6 : if (likely(PyMethod_Check(__pyx_t_1))) {
23271 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
23272 0 : if (likely(__pyx_t_2)) {
23273 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23274 0 : __Pyx_INCREF(__pyx_t_2);
23275 0 : __Pyx_INCREF(function);
23276 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
23277 : __pyx_t_15 = 1;
23278 : }
23279 : }
23280 : #endif
23281 : {
23282 6 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
23283 6 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
23284 6 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23285 6 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
23286 6 : __Pyx_GOTREF(__pyx_t_4);
23287 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23288 : }
23289 6 : __pyx_v_Fcopy = __pyx_t_4;
23290 6 : __pyx_t_4 = 0;
23291 :
23292 : /* "scipy/linalg/_decomp_interpolative.pyx":227
23293 : *
23294 : * Fcopy = F.copy()
23295 : * cols = F.shape[1] # <<<<<<<<<<<<<<
23296 : * row = F.shape[0]
23297 : * sssmax = 0.
23298 : */
23299 6 : __pyx_v_cols = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_F))[1]);
23300 :
23301 : /* "scipy/linalg/_decomp_interpolative.pyx":228
23302 : * Fcopy = F.copy()
23303 : * cols = F.shape[1]
23304 : * row = F.shape[0] # <<<<<<<<<<<<<<
23305 : * sssmax = 0.
23306 : * ff = <cnp.float64_t *>cnp.PyArray_DATA(F)
23307 : */
23308 6 : __pyx_v_row = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_F))[0]);
23309 :
23310 : /* "scipy/linalg/_decomp_interpolative.pyx":229
23311 : * cols = F.shape[1]
23312 : * row = F.shape[0]
23313 : * sssmax = 0. # <<<<<<<<<<<<<<
23314 : * ff = <cnp.float64_t *>cnp.PyArray_DATA(F)
23315 : * for r in range(cols):
23316 : */
23317 6 : __Pyx_INCREF(__pyx_float_0_);
23318 6 : __pyx_v_sssmax = __pyx_float_0_;
23319 :
23320 : /* "scipy/linalg/_decomp_interpolative.pyx":230
23321 : * row = F.shape[0]
23322 : * sssmax = 0.
23323 : * ff = <cnp.float64_t *>cnp.PyArray_DATA(F) # <<<<<<<<<<<<<<
23324 : * for r in range(cols):
23325 : * h = dnrm2(&row, &ff[r], &cols)
23326 : */
23327 6 : __pyx_v_ff = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_v_F)));
23328 :
23329 : /* "scipy/linalg/_decomp_interpolative.pyx":231
23330 : * sssmax = 0.
23331 : * ff = <cnp.float64_t *>cnp.PyArray_DATA(F)
23332 : * for r in range(cols): # <<<<<<<<<<<<<<
23333 : * h = dnrm2(&row, &ff[r], &cols)
23334 : * if h > sssmax:
23335 : */
23336 6 : __pyx_t_7 = __pyx_v_cols;
23337 6 : __pyx_t_13 = __pyx_t_7;
23338 922 : for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_13; __pyx_t_19+=1) {
23339 916 : __pyx_v_r = __pyx_t_19;
23340 :
23341 : /* "scipy/linalg/_decomp_interpolative.pyx":232
23342 : * ff = <cnp.float64_t *>cnp.PyArray_DATA(F)
23343 : * for r in range(cols):
23344 : * h = dnrm2(&row, &ff[r], &cols) # <<<<<<<<<<<<<<
23345 : * if h > sssmax:
23346 : * sssmax = h
23347 : */
23348 916 : __pyx_v_h = __pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_row), (&(__pyx_v_ff[__pyx_v_r])), (&__pyx_v_cols));
23349 :
23350 : /* "scipy/linalg/_decomp_interpolative.pyx":233
23351 : * for r in range(cols):
23352 : * h = dnrm2(&row, &ff[r], &cols)
23353 : * if h > sssmax: # <<<<<<<<<<<<<<
23354 : * sssmax = h
23355 : *
23356 : */
23357 916 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
23358 916 : __Pyx_GOTREF(__pyx_t_4);
23359 916 : __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_sssmax, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
23360 916 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23361 916 : __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_31 < 0))) __PYX_ERR(0, 233, __pyx_L1_error)
23362 916 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23363 916 : if (__pyx_t_31) {
23364 :
23365 : /* "scipy/linalg/_decomp_interpolative.pyx":234
23366 : * h = dnrm2(&row, &ff[r], &cols)
23367 : * if h > sssmax:
23368 : * sssmax = h # <<<<<<<<<<<<<<
23369 : *
23370 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_FLOAT64, 0)
23371 : */
23372 11 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
23373 11 : __Pyx_GOTREF(__pyx_t_1);
23374 927 : __Pyx_DECREF_SET(__pyx_v_sssmax, __pyx_t_1);
23375 : __pyx_t_1 = 0;
23376 :
23377 : /* "scipy/linalg/_decomp_interpolative.pyx":233
23378 : * for r in range(cols):
23379 : * h = dnrm2(&row, &ff[r], &cols)
23380 : * if h > sssmax: # <<<<<<<<<<<<<<
23381 : * sssmax = h
23382 : *
23383 : */
23384 : }
23385 : }
23386 :
23387 : /* "scipy/linalg/_decomp_interpolative.pyx":236
23388 : * sssmax = h
23389 : *
23390 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
23391 : * k, nulls = 0, 0
23392 : *
23393 : */
23394 6 : __pyx_t_32[0] = __pyx_v_cols;
23395 6 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_32, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
23396 6 : __Pyx_GOTREF(__pyx_t_1);
23397 6 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error)
23398 6 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_1);
23399 : {
23400 6 : __Pyx_BufFmt_StackElem __pyx_stack[1];
23401 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
23402 6 : __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
23403 6 : if (unlikely(__pyx_t_7 < 0)) {
23404 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
23405 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
23406 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
23407 : __Pyx_RaiseBufferFallbackError();
23408 : } else {
23409 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23410 : }
23411 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
23412 : }
23413 6 : __pyx_pybuffernd_tau_arr.diminfo[0].strides = __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau_arr.diminfo[0].shape = __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.shape[0];
23414 6 : if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 236, __pyx_L1_error)
23415 : }
23416 6 : __pyx_t_33 = 0;
23417 6 : __pyx_v_tau_arr = ((PyArrayObject *)__pyx_t_1);
23418 6 : __pyx_t_1 = 0;
23419 :
23420 : /* "scipy/linalg/_decomp_interpolative.pyx":237
23421 : *
23422 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_FLOAT64, 0)
23423 : * k, nulls = 0, 0 # <<<<<<<<<<<<<<
23424 : *
23425 : * # In Fortran id_dist, F is transposed and works on the columns
23426 : */
23427 6 : __pyx_t_7 = 0;
23428 6 : __pyx_t_13 = 0;
23429 6 : __pyx_v_k = __pyx_t_7;
23430 6 : __pyx_v_nulls = __pyx_t_13;
23431 :
23432 : /* "scipy/linalg/_decomp_interpolative.pyx":255
23433 : *
23434 : * # Loop until nulls = 7, or krank+nulls = n2, or krank+nulls = n.
23435 : * Fmemview = F # <<<<<<<<<<<<<<
23436 : * while (nulls < 7) and (k+nulls < min(n, n2)):
23437 : * # Apply previous Householder reflectors
23438 : */
23439 6 : __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_F), PyBUF_WRITABLE); if (unlikely(!__pyx_t_34.memview)) __PYX_ERR(0, 255, __pyx_L1_error)
23440 6 : __pyx_v_Fmemview = __pyx_t_34;
23441 6 : __pyx_t_34.memview = NULL;
23442 6 : __pyx_t_34.data = NULL;
23443 :
23444 : /* "scipy/linalg/_decomp_interpolative.pyx":256
23445 : * # Loop until nulls = 7, or krank+nulls = n2, or krank+nulls = n.
23446 : * Fmemview = F
23447 : * while (nulls < 7) and (k+nulls < min(n, n2)): # <<<<<<<<<<<<<<
23448 : * # Apply previous Householder reflectors
23449 : * if k > 0:
23450 : */
23451 91 : while (1) {
23452 91 : __pyx_t_35 = (__pyx_v_nulls < 7);
23453 91 : if (__pyx_t_35) {
23454 88 : } else {
23455 3 : __pyx_t_31 = __pyx_t_35;
23456 3 : goto __pyx_L14_bool_binop_done;
23457 : }
23458 88 : __pyx_t_13 = __pyx_v_n2;
23459 88 : __pyx_t_7 = __pyx_v_n;
23460 88 : __pyx_t_35 = (__pyx_t_13 < __pyx_t_7);
23461 88 : if (__pyx_t_35) {
23462 : __pyx_t_19 = __pyx_t_13;
23463 : } else {
23464 : __pyx_t_19 = __pyx_t_7;
23465 : }
23466 88 : __pyx_t_35 = ((__pyx_v_k + __pyx_v_nulls) < __pyx_t_19);
23467 88 : __pyx_t_31 = __pyx_t_35;
23468 91 : __pyx_L14_bool_binop_done:;
23469 91 : if (!__pyx_t_31) break;
23470 :
23471 : /* "scipy/linalg/_decomp_interpolative.pyx":258
23472 : * while (nulls < 7) and (k+nulls < min(n, n2)):
23473 : * # Apply previous Householder reflectors
23474 : * if k > 0: # <<<<<<<<<<<<<<
23475 : * for kk in range(k):
23476 : * F[k, kk:] -= tau_arr[kk]*(F[kk, kk:] @ F[k, kk:])*F[kk, kk:]
23477 : */
23478 85 : __pyx_t_31 = (__pyx_v_k > 0);
23479 85 : if (__pyx_t_31) {
23480 :
23481 : /* "scipy/linalg/_decomp_interpolative.pyx":259
23482 : * # Apply previous Householder reflectors
23483 : * if k > 0:
23484 : * for kk in range(k): # <<<<<<<<<<<<<<
23485 : * F[k, kk:] -= tau_arr[kk]*(F[kk, kk:] @ F[k, kk:])*F[kk, kk:]
23486 : *
23487 : */
23488 924 : __pyx_t_19 = __pyx_v_k;
23489 924 : __pyx_t_13 = __pyx_t_19;
23490 924 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_13; __pyx_t_7+=1) {
23491 845 : __pyx_v_kk = __pyx_t_7;
23492 :
23493 : /* "scipy/linalg/_decomp_interpolative.pyx":260
23494 : * if k > 0:
23495 : * for kk in range(k):
23496 : * F[k, kk:] -= tau_arr[kk]*(F[kk, kk:] @ F[k, kk:])*F[kk, kk:] # <<<<<<<<<<<<<<
23497 : *
23498 : * # Get the next Householder reflector and store in F
23499 : */
23500 845 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
23501 845 : __Pyx_GOTREF(__pyx_t_1);
23502 845 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
23503 845 : __Pyx_GOTREF(__pyx_t_4);
23504 845 : __pyx_t_2 = PySlice_New(__pyx_t_4, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
23505 845 : __Pyx_GOTREF(__pyx_t_2);
23506 845 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23507 845 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
23508 845 : __Pyx_GOTREF(__pyx_t_4);
23509 845 : __Pyx_GIVEREF(__pyx_t_1);
23510 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error);
23511 845 : __Pyx_GIVEREF(__pyx_t_2);
23512 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error);
23513 845 : __pyx_t_1 = 0;
23514 845 : __pyx_t_2 = 0;
23515 845 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
23516 845 : __Pyx_GOTREF(__pyx_t_2);
23517 845 : __pyx_t_21 = __pyx_v_kk;
23518 845 : __pyx_t_1 = PyFloat_FromDouble((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_tau_arr.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
23519 845 : __Pyx_GOTREF(__pyx_t_1);
23520 845 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error)
23521 845 : __Pyx_GOTREF(__pyx_t_26);
23522 845 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
23523 845 : __Pyx_GOTREF(__pyx_t_3);
23524 845 : __pyx_t_5 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
23525 845 : __Pyx_GOTREF(__pyx_t_5);
23526 845 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23527 845 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
23528 845 : __Pyx_GOTREF(__pyx_t_3);
23529 845 : __Pyx_GIVEREF(__pyx_t_26);
23530 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error);
23531 845 : __Pyx_GIVEREF(__pyx_t_5);
23532 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error);
23533 845 : __pyx_t_26 = 0;
23534 845 : __pyx_t_5 = 0;
23535 845 : __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
23536 845 : __Pyx_GOTREF(__pyx_t_5);
23537 845 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23538 845 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
23539 845 : __Pyx_GOTREF(__pyx_t_3);
23540 845 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error)
23541 845 : __Pyx_GOTREF(__pyx_t_26);
23542 845 : __pyx_t_36 = PySlice_New(__pyx_t_26, Py_None, Py_None); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 260, __pyx_L1_error)
23543 845 : __Pyx_GOTREF(__pyx_t_36);
23544 845 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23545 845 : __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error)
23546 845 : __Pyx_GOTREF(__pyx_t_26);
23547 845 : __Pyx_GIVEREF(__pyx_t_3);
23548 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error);
23549 845 : __Pyx_GIVEREF(__pyx_t_36);
23550 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_36)) __PYX_ERR(0, 260, __pyx_L1_error);
23551 845 : __pyx_t_3 = 0;
23552 845 : __pyx_t_36 = 0;
23553 845 : __pyx_t_36 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_26); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 260, __pyx_L1_error)
23554 845 : __Pyx_GOTREF(__pyx_t_36);
23555 845 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23556 845 : __pyx_t_26 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_5, __pyx_t_36); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error)
23557 845 : __Pyx_GOTREF(__pyx_t_26);
23558 845 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23559 845 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
23560 845 : __pyx_t_36 = PyNumber_Multiply(__pyx_t_1, __pyx_t_26); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 260, __pyx_L1_error)
23561 845 : __Pyx_GOTREF(__pyx_t_36);
23562 845 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23563 845 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
23564 845 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error)
23565 845 : __Pyx_GOTREF(__pyx_t_26);
23566 845 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
23567 845 : __Pyx_GOTREF(__pyx_t_1);
23568 845 : __pyx_t_5 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
23569 845 : __Pyx_GOTREF(__pyx_t_5);
23570 845 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23571 845 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
23572 845 : __Pyx_GOTREF(__pyx_t_1);
23573 845 : __Pyx_GIVEREF(__pyx_t_26);
23574 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_26)) __PYX_ERR(0, 260, __pyx_L1_error);
23575 845 : __Pyx_GIVEREF(__pyx_t_5);
23576 845 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error);
23577 845 : __pyx_t_26 = 0;
23578 845 : __pyx_t_5 = 0;
23579 845 : __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
23580 845 : __Pyx_GOTREF(__pyx_t_5);
23581 845 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23582 845 : __pyx_t_1 = PyNumber_Multiply(__pyx_t_36, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
23583 845 : __Pyx_GOTREF(__pyx_t_1);
23584 845 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
23585 845 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23586 845 : __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
23587 845 : __Pyx_GOTREF(__pyx_t_5);
23588 845 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23589 845 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23590 845 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_F), __pyx_t_4, __pyx_t_5) < 0))) __PYX_ERR(0, 260, __pyx_L1_error)
23591 845 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23592 1690 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23593 : }
23594 :
23595 : /* "scipy/linalg/_decomp_interpolative.pyx":258
23596 : * while (nulls < 7) and (k+nulls < min(n, n2)):
23597 : * # Apply previous Householder reflectors
23598 : * if k > 0: # <<<<<<<<<<<<<<
23599 : * for kk in range(k):
23600 : * F[k, kk:] -= tau_arr[kk]*(F[kk, kk:] @ F[k, kk:])*F[kk, kk:]
23601 : */
23602 : }
23603 :
23604 : /* "scipy/linalg/_decomp_interpolative.pyx":263
23605 : *
23606 : * # Get the next Householder reflector and store in F
23607 : * r = cols-k # <<<<<<<<<<<<<<
23608 : * # n, alpha, x, incx, tau
23609 : * dlarfgp(&r, &Fmemview[k, k], &Fmemview[k, k+1], &intone, &tau_arr[k])
23610 : */
23611 85 : __pyx_v_r = (__pyx_v_cols - __pyx_v_k);
23612 :
23613 : /* "scipy/linalg/_decomp_interpolative.pyx":265
23614 : * r = cols-k
23615 : * # n, alpha, x, incx, tau
23616 : * dlarfgp(&r, &Fmemview[k, k], &Fmemview[k, k+1], &intone, &tau_arr[k]) # <<<<<<<<<<<<<<
23617 : * beta = F[k, k]
23618 : * F[k, k] = 1
23619 : */
23620 85 : __pyx_t_21 = __pyx_v_k;
23621 85 : __pyx_t_22 = __pyx_v_k;
23622 85 : __pyx_t_23 = __pyx_v_k;
23623 85 : __pyx_t_37 = (__pyx_v_k + 1);
23624 85 : __pyx_t_38 = __pyx_v_k;
23625 85 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp((&__pyx_v_r), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_Fmemview.data + __pyx_t_21 * __pyx_v_Fmemview.strides[0]) )) + __pyx_t_22)) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_Fmemview.data + __pyx_t_23 * __pyx_v_Fmemview.strides[0]) )) + __pyx_t_37)) )))), (&__pyx_v_intone), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_tau_arr.diminfo[0].strides))));
23626 :
23627 : /* "scipy/linalg/_decomp_interpolative.pyx":266
23628 : * # n, alpha, x, incx, tau
23629 : * dlarfgp(&r, &Fmemview[k, k], &Fmemview[k, k+1], &intone, &tau_arr[k])
23630 : * beta = F[k, k] # <<<<<<<<<<<<<<
23631 : * F[k, k] = 1
23632 : *
23633 : */
23634 85 : __pyx_t_38 = __pyx_v_k;
23635 85 : __pyx_t_37 = __pyx_v_k;
23636 85 : __pyx_v_beta = (*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_F.diminfo[1].strides));
23637 :
23638 : /* "scipy/linalg/_decomp_interpolative.pyx":267
23639 : * dlarfgp(&r, &Fmemview[k, k], &Fmemview[k, k+1], &intone, &tau_arr[k])
23640 : * beta = F[k, k]
23641 : * F[k, k] = 1 # <<<<<<<<<<<<<<
23642 : *
23643 : * if (beta <= eps*sssmax):
23644 : */
23645 85 : __pyx_t_37 = __pyx_v_k;
23646 85 : __pyx_t_38 = __pyx_v_k;
23647 85 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_F.diminfo[1].strides) = 1.0;
23648 :
23649 : /* "scipy/linalg/_decomp_interpolative.pyx":269
23650 : * F[k, k] = 1
23651 : *
23652 : * if (beta <= eps*sssmax): # <<<<<<<<<<<<<<
23653 : * nulls += 1
23654 : * k += 1
23655 : */
23656 85 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
23657 85 : __Pyx_GOTREF(__pyx_t_4);
23658 85 : __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
23659 85 : __Pyx_GOTREF(__pyx_t_5);
23660 85 : __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_v_sssmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
23661 85 : __Pyx_GOTREF(__pyx_t_1);
23662 85 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23663 85 : __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
23664 85 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23665 85 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23666 85 : __pyx_t_31 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_31 < 0))) __PYX_ERR(0, 269, __pyx_L1_error)
23667 85 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23668 85 : if (__pyx_t_31) {
23669 :
23670 : /* "scipy/linalg/_decomp_interpolative.pyx":270
23671 : *
23672 : * if (beta <= eps*sssmax):
23673 : * nulls += 1 # <<<<<<<<<<<<<<
23674 : * k += 1
23675 : *
23676 : */
23677 21 : __pyx_v_nulls = (__pyx_v_nulls + 1);
23678 :
23679 : /* "scipy/linalg/_decomp_interpolative.pyx":269
23680 : * F[k, k] = 1
23681 : *
23682 : * if (beta <= eps*sssmax): # <<<<<<<<<<<<<<
23683 : * nulls += 1
23684 : * k += 1
23685 : */
23686 : }
23687 :
23688 : /* "scipy/linalg/_decomp_interpolative.pyx":271
23689 : * if (beta <= eps*sssmax):
23690 : * nulls += 1
23691 : * k += 1 # <<<<<<<<<<<<<<
23692 : *
23693 : * if nulls < 7:
23694 : */
23695 : __pyx_v_k = (__pyx_v_k + 1);
23696 : }
23697 :
23698 : /* "scipy/linalg/_decomp_interpolative.pyx":273
23699 : * k += 1
23700 : *
23701 : * if nulls < 7: # <<<<<<<<<<<<<<
23702 : * k = 0
23703 : *
23704 : */
23705 6 : __pyx_t_31 = (__pyx_v_nulls < 7);
23706 6 : if (__pyx_t_31) {
23707 :
23708 : /* "scipy/linalg/_decomp_interpolative.pyx":274
23709 : *
23710 : * if nulls < 7:
23711 : * k = 0 # <<<<<<<<<<<<<<
23712 : *
23713 : * return k, Fcopy
23714 : */
23715 3 : __pyx_v_k = 0;
23716 :
23717 : /* "scipy/linalg/_decomp_interpolative.pyx":273
23718 : * k += 1
23719 : *
23720 : * if nulls < 7: # <<<<<<<<<<<<<<
23721 : * k = 0
23722 : *
23723 : */
23724 : }
23725 :
23726 : /* "scipy/linalg/_decomp_interpolative.pyx":276
23727 : * k = 0
23728 : *
23729 : * return k, Fcopy # <<<<<<<<<<<<<<
23730 : *
23731 : *
23732 : */
23733 6 : __Pyx_XDECREF(__pyx_r);
23734 6 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
23735 6 : __Pyx_GOTREF(__pyx_t_5);
23736 6 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
23737 6 : __Pyx_GOTREF(__pyx_t_1);
23738 6 : __Pyx_GIVEREF(__pyx_t_5);
23739 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error);
23740 6 : __Pyx_INCREF(__pyx_v_Fcopy);
23741 6 : __Pyx_GIVEREF(__pyx_v_Fcopy);
23742 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_Fcopy)) __PYX_ERR(0, 276, __pyx_L1_error);
23743 6 : __pyx_t_5 = 0;
23744 6 : __pyx_r = __pyx_t_1;
23745 6 : __pyx_t_1 = 0;
23746 6 : goto __pyx_L0;
23747 :
23748 : /* "scipy/linalg/_decomp_interpolative.pyx":163
23749 : *
23750 : *
23751 : * def idd_estrank(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
23752 : * rng):
23753 : * cdef int m = a.shape[0], n = a.shape[1]
23754 : */
23755 :
23756 : /* function exit code */
23757 0 : __pyx_L1_error:;
23758 0 : __Pyx_XDECREF(__pyx_t_1);
23759 0 : __Pyx_XDECREF(__pyx_t_2);
23760 0 : __Pyx_XDECREF(__pyx_t_3);
23761 0 : __Pyx_XDECREF(__pyx_t_4);
23762 0 : __Pyx_XDECREF(__pyx_t_5);
23763 0 : __Pyx_XDECREF(__pyx_t_26);
23764 0 : __Pyx_XDECREF(__pyx_t_29);
23765 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_34, 1);
23766 0 : __Pyx_XDECREF(__pyx_t_36);
23767 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
23768 0 : __Pyx_PyThreadState_declare
23769 0 : __Pyx_PyThreadState_assign
23770 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
23771 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
23772 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Fc.rcbuffer->pybuffer);
23773 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
23774 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
23775 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
23776 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
23777 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
23778 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
23779 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
23780 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_estrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
23781 0 : __pyx_r = NULL;
23782 0 : goto __pyx_L2;
23783 6 : __pyx_L0:;
23784 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
23785 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Fc.rcbuffer->pybuffer);
23786 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
23787 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
23788 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
23789 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
23790 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
23791 6 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
23792 6 : __pyx_L2:;
23793 6 : __Pyx_XDECREF((PyObject *)__pyx_v_albetas);
23794 6 : __Pyx_XDECREF((PyObject *)__pyx_v_tau_arr);
23795 6 : __Pyx_XDECREF((PyObject *)__pyx_v_subselect);
23796 6 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_Fmemview, 1);
23797 6 : __Pyx_XDECREF((PyObject *)__pyx_v_giv2x2);
23798 6 : __Pyx_XDECREF((PyObject *)__pyx_v_rta);
23799 6 : __Pyx_XDECREF((PyObject *)__pyx_v_Fc);
23800 6 : __Pyx_XDECREF((PyObject *)__pyx_v_F);
23801 6 : __Pyx_XDECREF(__pyx_v_Fcopy);
23802 6 : __Pyx_XDECREF(__pyx_v_sssmax);
23803 6 : __Pyx_XGIVEREF(__pyx_r);
23804 6 : __Pyx_RefNannyFinishContext();
23805 6 : return __pyx_r;
23806 : }
23807 :
23808 : /* "scipy/linalg/_decomp_interpolative.pyx":279
23809 : *
23810 : *
23811 : * def idd_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
23812 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
23813 : *
23814 : */
23815 :
23816 : /* Python wrapper */
23817 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_5idd_findrank(PyObject *__pyx_self,
23818 : #if CYTHON_METH_FASTCALL
23819 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23820 : #else
23821 : PyObject *__pyx_args, PyObject *__pyx_kwds
23822 : #endif
23823 : ); /*proto*/
23824 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_5idd_findrank = {"idd_findrank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_5idd_findrank, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23825 4 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_5idd_findrank(PyObject *__pyx_self,
23826 : #if CYTHON_METH_FASTCALL
23827 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23828 : #else
23829 : PyObject *__pyx_args, PyObject *__pyx_kwds
23830 : #endif
23831 : ) {
23832 4 : PyObject *__pyx_v_A = 0;
23833 4 : __pyx_t_5numpy_float64_t __pyx_v_eps;
23834 4 : PyObject *__pyx_v_rng = 0;
23835 : #if !CYTHON_METH_FASTCALL
23836 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23837 : #endif
23838 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23839 4 : PyObject* values[3] = {0,0,0};
23840 4 : int __pyx_lineno = 0;
23841 4 : const char *__pyx_filename = NULL;
23842 4 : int __pyx_clineno = 0;
23843 4 : PyObject *__pyx_r = 0;
23844 : __Pyx_RefNannyDeclarations
23845 4 : __Pyx_RefNannySetupContext("idd_findrank (wrapper)", 0);
23846 : #if !CYTHON_METH_FASTCALL
23847 : #if CYTHON_ASSUME_SAFE_MACROS
23848 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23849 : #else
23850 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23851 : #endif
23852 : #endif
23853 4 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23854 : {
23855 4 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
23856 4 : if (likely(__pyx_kwds)) {
23857 4 : Py_ssize_t kw_args;
23858 4 : switch (__pyx_nargs) {
23859 4 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
23860 4 : CYTHON_FALLTHROUGH;
23861 4 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
23862 4 : CYTHON_FALLTHROUGH;
23863 4 : case 0: break;
23864 0 : default: goto __pyx_L5_argtuple_error;
23865 : }
23866 4 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
23867 4 : switch (__pyx_nargs) {
23868 : case 0:
23869 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
23870 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
23871 0 : kw_args--;
23872 : }
23873 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
23874 0 : else goto __pyx_L5_argtuple_error;
23875 0 : CYTHON_FALLTHROUGH;
23876 : case 1:
23877 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
23878 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
23879 0 : kw_args--;
23880 : }
23881 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
23882 : else {
23883 0 : __Pyx_RaiseArgtupleInvalid("idd_findrank", 1, 2, 2, 1); __PYX_ERR(0, 279, __pyx_L3_error)
23884 : }
23885 4 : CYTHON_FALLTHROUGH;
23886 : case 2:
23887 4 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
23888 4 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
23889 4 : kw_args--;
23890 : }
23891 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
23892 : else {
23893 0 : __Pyx_RaiseKeywordRequired("idd_findrank", __pyx_n_s_rng); __PYX_ERR(0, 279, __pyx_L3_error)
23894 : }
23895 : }
23896 4 : if (unlikely(kw_args > 0)) {
23897 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23898 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_findrank") < 0)) __PYX_ERR(0, 279, __pyx_L3_error)
23899 : }
23900 0 : } else if (unlikely(__pyx_nargs != 2)) {
23901 0 : goto __pyx_L5_argtuple_error;
23902 : } else {
23903 0 : __Pyx_RaiseKeywordRequired("idd_findrank", __pyx_n_s_rng); __PYX_ERR(0, 279, __pyx_L3_error)
23904 : }
23905 4 : __pyx_v_A = values[0];
23906 4 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L3_error)
23907 4 : __pyx_v_rng = values[2];
23908 : }
23909 4 : goto __pyx_L6_skip;
23910 0 : __pyx_L5_argtuple_error:;
23911 0 : __Pyx_RaiseArgtupleInvalid("idd_findrank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 279, __pyx_L3_error)
23912 4 : __pyx_L6_skip:;
23913 4 : goto __pyx_L4_argument_unpacking_done;
23914 0 : __pyx_L3_error:;
23915 : {
23916 0 : Py_ssize_t __pyx_temp;
23917 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23918 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23919 : }
23920 : }
23921 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_findrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
23922 0 : __Pyx_RefNannyFinishContext();
23923 0 : return NULL;
23924 4 : __pyx_L4_argument_unpacking_done:;
23925 4 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_4idd_findrank(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
23926 :
23927 : /* function exit code */
23928 : {
23929 4 : Py_ssize_t __pyx_temp;
23930 4 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23931 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
23932 : }
23933 : }
23934 : __Pyx_RefNannyFinishContext();
23935 : return __pyx_r;
23936 : }
23937 :
23938 4 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_4idd_findrank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
23939 4 : int __pyx_v_m;
23940 4 : int __pyx_v_n;
23941 4 : int __pyx_v_k;
23942 4 : int __pyx_v_kk;
23943 4 : int __pyx_v_r;
23944 4 : int __pyx_v_krank;
23945 4 : int __pyx_v_no_of_cols;
23946 4 : int __pyx_v_intone;
23947 4 : int __pyx_v_info;
23948 4 : __Pyx_memviewslice __pyx_v_tau = { 0, 0, { 0 }, { 0 }, { 0 } };
23949 4 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
23950 4 : PyArrayObject *__pyx_v_retarr = 0;
23951 4 : __pyx_t_5numpy_float64_t *__pyx_v_ra;
23952 4 : __pyx_t_5numpy_float64_t *__pyx_v_reallocated_ra;
23953 4 : __pyx_t_5numpy_float64_t *__pyx_v_ret;
23954 4 : __pyx_t_5numpy_float64_t *__pyx_v_reallocated_ret;
23955 4 : __pyx_t_5numpy_float64_t __pyx_v_enorm;
23956 4 : PyObject *__pyx_v_x = NULL;
23957 4 : __Pyx_LocalBuf_ND __pyx_pybuffernd_retarr;
23958 4 : __Pyx_Buffer __pyx_pybuffer_retarr;
23959 4 : PyObject *__pyx_r = NULL;
23960 : __Pyx_RefNannyDeclarations
23961 4 : PyObject *__pyx_t_1 = NULL;
23962 4 : PyObject *__pyx_t_2 = NULL;
23963 4 : int __pyx_t_3;
23964 4 : int __pyx_t_4;
23965 4 : int __pyx_t_5;
23966 4 : int __pyx_t_6;
23967 4 : npy_intp __pyx_t_7[1];
23968 4 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
23969 4 : npy_intp __pyx_t_9[1];
23970 4 : int __pyx_t_10;
23971 4 : Py_ssize_t __pyx_t_11;
23972 4 : Py_UCS4 __pyx_t_12;
23973 4 : PyObject *__pyx_t_13 = NULL;
23974 4 : unsigned int __pyx_t_14;
23975 4 : Py_ssize_t __pyx_t_15;
23976 4 : Py_ssize_t __pyx_t_16;
23977 4 : Py_ssize_t __pyx_t_17;
23978 4 : npy_intp __pyx_t_18[2];
23979 4 : PyArrayObject *__pyx_t_19 = NULL;
23980 4 : PyObject *__pyx_t_20 = NULL;
23981 4 : PyObject *__pyx_t_21 = NULL;
23982 4 : PyObject *__pyx_t_22 = NULL;
23983 4 : int __pyx_t_23;
23984 4 : int __pyx_t_24;
23985 4 : int __pyx_t_25;
23986 4 : char const *__pyx_t_26;
23987 4 : PyObject *__pyx_t_27 = NULL;
23988 4 : PyObject *__pyx_t_28 = NULL;
23989 4 : PyObject *__pyx_t_29 = NULL;
23990 4 : npy_intp __pyx_t_30[2];
23991 4 : PyObject *__pyx_t_31 = NULL;
23992 4 : PyObject *__pyx_t_32 = NULL;
23993 4 : PyObject *__pyx_t_33 = NULL;
23994 4 : int __pyx_t_34;
23995 4 : int __pyx_t_35;
23996 4 : int __pyx_lineno = 0;
23997 4 : const char *__pyx_filename = NULL;
23998 4 : int __pyx_clineno = 0;
23999 4 : __Pyx_RefNannySetupContext("idd_findrank", 1);
24000 4 : __pyx_pybuffer_retarr.pybuffer.buf = NULL;
24001 4 : __pyx_pybuffer_retarr.refcount = 0;
24002 4 : __pyx_pybuffernd_retarr.data = NULL;
24003 4 : __pyx_pybuffernd_retarr.rcbuffer = &__pyx_pybuffer_retarr;
24004 :
24005 : /* "scipy/linalg/_decomp_interpolative.pyx":282
24006 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
24007 : *
24008 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank # <<<<<<<<<<<<<<
24009 : * cdef int no_of_cols = 4, intone = 1, info = 0
24010 : * cdef cnp.float64_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], cnp.NPY_FLOAT64, 0)
24011 : */
24012 4 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
24013 4 : __Pyx_GOTREF(__pyx_t_1);
24014 4 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
24015 4 : __Pyx_GOTREF(__pyx_t_2);
24016 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24017 4 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
24018 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24019 4 : __pyx_v_m = __pyx_t_3;
24020 4 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
24021 4 : __Pyx_GOTREF(__pyx_t_2);
24022 4 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
24023 4 : __Pyx_GOTREF(__pyx_t_1);
24024 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24025 4 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
24026 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24027 4 : __pyx_v_n = __pyx_t_3;
24028 4 : __pyx_v_k = 0;
24029 4 : __pyx_v_kk = 0;
24030 4 : __pyx_v_r = __pyx_v_n;
24031 :
24032 : /* "scipy/linalg/_decomp_interpolative.pyx":283
24033 : *
24034 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank
24035 : * cdef int no_of_cols = 4, intone = 1, info = 0 # <<<<<<<<<<<<<<
24036 : * cdef cnp.float64_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], cnp.NPY_FLOAT64, 0)
24037 : * cdef cnp.float64_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
24038 : */
24039 4 : __pyx_v_no_of_cols = 4;
24040 4 : __pyx_v_intone = 1;
24041 4 : __pyx_v_info = 0;
24042 :
24043 : /* "scipy/linalg/_decomp_interpolative.pyx":284
24044 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank
24045 : * cdef int no_of_cols = 4, intone = 1, info = 0
24046 : * cdef cnp.float64_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
24047 : * cdef cnp.float64_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
24048 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] retarr
24049 : */
24050 4 : __pyx_t_3 = __pyx_v_n;
24051 4 : __pyx_t_4 = __pyx_v_m;
24052 4 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
24053 4 : if (__pyx_t_6) {
24054 : __pyx_t_5 = __pyx_t_3;
24055 : } else {
24056 : __pyx_t_5 = __pyx_t_4;
24057 : }
24058 4 : __pyx_t_7[0] = __pyx_t_5;
24059 4 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_7, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
24060 4 : __Pyx_GOTREF(__pyx_t_1);
24061 4 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 284, __pyx_L1_error)
24062 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24063 4 : __pyx_v_tau = __pyx_t_8;
24064 4 : __pyx_t_8.memview = NULL;
24065 4 : __pyx_t_8.data = NULL;
24066 :
24067 : /* "scipy/linalg/_decomp_interpolative.pyx":285
24068 : * cdef int no_of_cols = 4, intone = 1, info = 0
24069 : * cdef cnp.float64_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], cnp.NPY_FLOAT64, 0)
24070 : * cdef cnp.float64_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
24071 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] retarr
24072 : *
24073 : */
24074 4 : __pyx_t_9[0] = __pyx_v_n;
24075 4 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_9, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
24076 4 : __Pyx_GOTREF(__pyx_t_1);
24077 4 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 285, __pyx_L1_error)
24078 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24079 4 : __pyx_v_y = __pyx_t_8;
24080 4 : __pyx_t_8.memview = NULL;
24081 4 : __pyx_t_8.data = NULL;
24082 :
24083 : /* "scipy/linalg/_decomp_interpolative.pyx":294
24084 : * # Also, we hold the A.T @ x results in a separate array to return
24085 : * # and do the same for that too.
24086 : * cdef cnp.float64_t *ra = <cnp.float64_t*>PyMem_Malloc( # <<<<<<<<<<<<<<
24087 : * sizeof(cnp.float64_t)*no_of_cols*n
24088 : * )
24089 : */
24090 4 : __pyx_v_ra = ((__pyx_t_5numpy_float64_t *)PyMem_Malloc((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_no_of_cols) * __pyx_v_n)));
24091 :
24092 : /* "scipy/linalg/_decomp_interpolative.pyx":298
24093 : * )
24094 : * cdef cnp.float64_t *reallocated_ra
24095 : * cdef cnp.float64_t *ret = <cnp.float64_t*>PyMem_Malloc( # <<<<<<<<<<<<<<
24096 : * sizeof(cnp.float64_t)*no_of_cols*n
24097 : * )
24098 : */
24099 4 : __pyx_v_ret = ((__pyx_t_5numpy_float64_t *)PyMem_Malloc((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_no_of_cols) * __pyx_v_n)));
24100 :
24101 : /* "scipy/linalg/_decomp_interpolative.pyx":302
24102 : * )
24103 : * cdef cnp.float64_t *reallocated_ret
24104 : * cdef cnp.float64_t enorm = 0.0 # <<<<<<<<<<<<<<
24105 : *
24106 : * if (not ra) or (not ret):
24107 : */
24108 4 : __pyx_v_enorm = 0.0;
24109 :
24110 : /* "scipy/linalg/_decomp_interpolative.pyx":304
24111 : * cdef cnp.float64_t enorm = 0.0
24112 : *
24113 : * if (not ra) or (not ret): # <<<<<<<<<<<<<<
24114 : * raise MemoryError("Failed to allocate at least required memory "
24115 : * f"{no_of_cols*n*8} bytes for"
24116 : */
24117 4 : __pyx_t_10 = (!(__pyx_v_ra != 0));
24118 4 : if (!__pyx_t_10) {
24119 4 : } else {
24120 0 : __pyx_t_6 = __pyx_t_10;
24121 0 : goto __pyx_L4_bool_binop_done;
24122 : }
24123 4 : __pyx_t_10 = (!(__pyx_v_ret != 0));
24124 4 : __pyx_t_6 = __pyx_t_10;
24125 4 : __pyx_L4_bool_binop_done:;
24126 4 : if (unlikely(__pyx_t_6)) {
24127 :
24128 : /* "scipy/linalg/_decomp_interpolative.pyx":305
24129 : *
24130 : * if (not ra) or (not ret):
24131 : * raise MemoryError("Failed to allocate at least required memory " # <<<<<<<<<<<<<<
24132 : * f"{no_of_cols*n*8} bytes for"
24133 : * "'scipy.linalg.interpolative.idd_findrank()' "
24134 : */
24135 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
24136 0 : __Pyx_GOTREF(__pyx_t_1);
24137 0 : __pyx_t_11 = 0;
24138 0 : __pyx_t_12 = 127;
24139 0 : __Pyx_INCREF(__pyx_kp_u_Failed_to_allocate_at_least_requ);
24140 0 : __pyx_t_11 += 44;
24141 0 : __Pyx_GIVEREF(__pyx_kp_u_Failed_to_allocate_at_least_requ);
24142 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Failed_to_allocate_at_least_requ);
24143 :
24144 : /* "scipy/linalg/_decomp_interpolative.pyx":306
24145 : * if (not ra) or (not ret):
24146 : * raise MemoryError("Failed to allocate at least required memory "
24147 : * f"{no_of_cols*n*8} bytes for" # <<<<<<<<<<<<<<
24148 : * "'scipy.linalg.interpolative.idd_findrank()' "
24149 : * "function.")
24150 : */
24151 0 : __pyx_t_2 = __Pyx_PyUnicode_From_long(((__pyx_v_no_of_cols * __pyx_v_n) * 8), 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
24152 0 : __Pyx_GOTREF(__pyx_t_2);
24153 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
24154 0 : __Pyx_GIVEREF(__pyx_t_2);
24155 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
24156 0 : __pyx_t_2 = 0;
24157 0 : __Pyx_INCREF(__pyx_kp_u_bytes_for_scipy_linalg_interpol);
24158 0 : __pyx_t_11 += 63;
24159 0 : __Pyx_GIVEREF(__pyx_kp_u_bytes_for_scipy_linalg_interpol);
24160 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes_for_scipy_linalg_interpol);
24161 :
24162 : /* "scipy/linalg/_decomp_interpolative.pyx":305
24163 : *
24164 : * if (not ra) or (not ret):
24165 : * raise MemoryError("Failed to allocate at least required memory " # <<<<<<<<<<<<<<
24166 : * f"{no_of_cols*n*8} bytes for"
24167 : * "'scipy.linalg.interpolative.idd_findrank()' "
24168 : */
24169 0 : __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
24170 0 : __Pyx_GOTREF(__pyx_t_2);
24171 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24172 0 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
24173 0 : __Pyx_GOTREF(__pyx_t_1);
24174 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24175 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
24176 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24177 0 : __PYX_ERR(0, 305, __pyx_L1_error)
24178 :
24179 : /* "scipy/linalg/_decomp_interpolative.pyx":304
24180 : * cdef cnp.float64_t enorm = 0.0
24181 : *
24182 : * if (not ra) or (not ret): # <<<<<<<<<<<<<<
24183 : * raise MemoryError("Failed to allocate at least required memory "
24184 : * f"{no_of_cols*n*8} bytes for"
24185 : */
24186 : }
24187 :
24188 : /* "scipy/linalg/_decomp_interpolative.pyx":310
24189 : * "function.")
24190 : *
24191 : * krank = 0 # <<<<<<<<<<<<<<
24192 : * try:
24193 : * while True:
24194 : */
24195 4 : __pyx_v_krank = 0;
24196 :
24197 : /* "scipy/linalg/_decomp_interpolative.pyx":311
24198 : *
24199 : * krank = 0
24200 : * try: # <<<<<<<<<<<<<<
24201 : * while True:
24202 : *
24203 : */
24204 : /*try:*/ {
24205 :
24206 : /* "scipy/linalg/_decomp_interpolative.pyx":312
24207 : * krank = 0
24208 : * try:
24209 : * while True: # <<<<<<<<<<<<<<
24210 : *
24211 : * # Generate random vector and rmatvec then save the result
24212 : */
24213 57 : while (1) {
24214 :
24215 : /* "scipy/linalg/_decomp_interpolative.pyx":315
24216 : *
24217 : * # Generate random vector and rmatvec then save the result
24218 : * x = rng.uniform(size=m) # <<<<<<<<<<<<<<
24219 : * y = A.rmatvec(x)
24220 : * for kk in range(n):
24221 : */
24222 57 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L7_error)
24223 57 : __Pyx_GOTREF(__pyx_t_1);
24224 57 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L7_error)
24225 57 : __Pyx_GOTREF(__pyx_t_2);
24226 57 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L7_error)
24227 57 : __Pyx_GOTREF(__pyx_t_13);
24228 57 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_13) < 0) __PYX_ERR(0, 315, __pyx_L7_error)
24229 57 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24230 57 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 315, __pyx_L7_error)
24231 57 : __Pyx_GOTREF(__pyx_t_13);
24232 57 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24233 57 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24234 57 : __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_13);
24235 57 : __pyx_t_13 = 0;
24236 :
24237 : /* "scipy/linalg/_decomp_interpolative.pyx":316
24238 : * # Generate random vector and rmatvec then save the result
24239 : * x = rng.uniform(size=m)
24240 : * y = A.rmatvec(x) # <<<<<<<<<<<<<<
24241 : * for kk in range(n):
24242 : * ret[krank*n + kk] = y[kk]
24243 : */
24244 57 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L7_error)
24245 57 : __Pyx_GOTREF(__pyx_t_2);
24246 57 : __pyx_t_1 = NULL;
24247 57 : __pyx_t_14 = 0;
24248 : #if CYTHON_UNPACK_METHODS
24249 57 : if (likely(PyMethod_Check(__pyx_t_2))) {
24250 57 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
24251 57 : if (likely(__pyx_t_1)) {
24252 57 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24253 57 : __Pyx_INCREF(__pyx_t_1);
24254 57 : __Pyx_INCREF(function);
24255 57 : __Pyx_DECREF_SET(__pyx_t_2, function);
24256 : __pyx_t_14 = 1;
24257 : }
24258 : }
24259 : #endif
24260 : {
24261 57 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_x};
24262 57 : __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
24263 57 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24264 57 : if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L7_error)
24265 57 : __Pyx_GOTREF(__pyx_t_13);
24266 57 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24267 : }
24268 57 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_13, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 316, __pyx_L7_error)
24269 57 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24270 57 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
24271 57 : __pyx_v_y = __pyx_t_8;
24272 57 : __pyx_t_8.memview = NULL;
24273 57 : __pyx_t_8.data = NULL;
24274 :
24275 : /* "scipy/linalg/_decomp_interpolative.pyx":317
24276 : * x = rng.uniform(size=m)
24277 : * y = A.rmatvec(x)
24278 : * for kk in range(n): # <<<<<<<<<<<<<<
24279 : * ret[krank*n + kk] = y[kk]
24280 : *
24281 : */
24282 57 : __pyx_t_5 = __pyx_v_n;
24283 57 : __pyx_t_3 = __pyx_t_5;
24284 16266 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24285 16209 : __pyx_v_kk = __pyx_t_4;
24286 :
24287 : /* "scipy/linalg/_decomp_interpolative.pyx":318
24288 : * y = A.rmatvec(x)
24289 : * for kk in range(n):
24290 : * ret[krank*n + kk] = y[kk] # <<<<<<<<<<<<<<
24291 : *
24292 : * if krank == 0:
24293 : */
24294 16209 : __pyx_t_15 = __pyx_v_kk;
24295 16209 : (__pyx_v_ret[((__pyx_v_krank * __pyx_v_n) + __pyx_v_kk)]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_15)) )));
24296 : }
24297 :
24298 : /* "scipy/linalg/_decomp_interpolative.pyx":320
24299 : * ret[krank*n + kk] = y[kk]
24300 : *
24301 : * if krank == 0: # <<<<<<<<<<<<<<
24302 : * enorm = dnrm2(&n, &y[0], &intone)
24303 : * else: # krank > 0
24304 : */
24305 57 : __pyx_t_6 = (__pyx_v_krank == 0);
24306 57 : if (__pyx_t_6) {
24307 :
24308 : /* "scipy/linalg/_decomp_interpolative.pyx":321
24309 : *
24310 : * if krank == 0:
24311 : * enorm = dnrm2(&n, &y[0], &intone) # <<<<<<<<<<<<<<
24312 : * else: # krank > 0
24313 : * # Transpose-Apply previous Householder reflectors, if any
24314 : */
24315 4 : __pyx_t_15 = 0;
24316 4 : __pyx_v_enorm = __pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_15)) )))), (&__pyx_v_intone));
24317 :
24318 : /* "scipy/linalg/_decomp_interpolative.pyx":320
24319 : * ret[krank*n + kk] = y[kk]
24320 : *
24321 : * if krank == 0: # <<<<<<<<<<<<<<
24322 : * enorm = dnrm2(&n, &y[0], &intone)
24323 : * else: # krank > 0
24324 : */
24325 4 : goto __pyx_L13;
24326 : }
24327 :
24328 : /* "scipy/linalg/_decomp_interpolative.pyx":325
24329 : * # Transpose-Apply previous Householder reflectors, if any
24330 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
24331 : * dorm2r(<char*>'L',<char*>'T', &n, &intone, &krank, &ra[0], &n, # <<<<<<<<<<<<<<
24332 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info)
24333 : *
24334 : */
24335 : /*else*/ {
24336 :
24337 : /* "scipy/linalg/_decomp_interpolative.pyx":326
24338 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
24339 : * dorm2r(<char*>'L',<char*>'T', &n, &intone, &krank, &ra[0], &n,
24340 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info) # <<<<<<<<<<<<<<
24341 : *
24342 : * # Get the next Householder reflector
24343 : */
24344 53 : __pyx_t_15 = 0;
24345 53 : __pyx_t_16 = 0;
24346 :
24347 : /* "scipy/linalg/_decomp_interpolative.pyx":325
24348 : * # Transpose-Apply previous Householder reflectors, if any
24349 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
24350 : * dorm2r(<char*>'L',<char*>'T', &n, &intone, &krank, &ra[0], &n, # <<<<<<<<<<<<<<
24351 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info)
24352 : *
24353 : */
24354 53 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"L")), ((char *)((char *)"T")), (&__pyx_v_n), (&__pyx_v_intone), (&__pyx_v_krank), (&(__pyx_v_ra[0])), (&__pyx_v_n), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_tau.data) + __pyx_t_15)) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_16)) )))), (&__pyx_v_n), (&(__pyx_v_ra[((__pyx_v_no_of_cols - 1) * __pyx_v_n)])), (&__pyx_v_info));
24355 : }
24356 57 : __pyx_L13:;
24357 :
24358 : /* "scipy/linalg/_decomp_interpolative.pyx":329
24359 : *
24360 : * # Get the next Householder reflector
24361 : * r = n-krank # <<<<<<<<<<<<<<
24362 : * # N, ALPHA, X, INCX, TAU
24363 : * dlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank])
24364 : */
24365 57 : __pyx_v_r = (__pyx_v_n - __pyx_v_krank);
24366 :
24367 : /* "scipy/linalg/_decomp_interpolative.pyx":331
24368 : * r = n-krank
24369 : * # N, ALPHA, X, INCX, TAU
24370 : * dlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank]) # <<<<<<<<<<<<<<
24371 : *
24372 : * for kk in range(n):
24373 : */
24374 57 : __pyx_t_16 = __pyx_v_krank;
24375 57 : __pyx_t_15 = (__pyx_v_krank + 1);
24376 57 : __pyx_t_17 = __pyx_v_krank;
24377 57 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp((&__pyx_v_r), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_16)) )))), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_15)) )))), (&__pyx_v_intone), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_tau.data) + __pyx_t_17)) )))));
24378 :
24379 : /* "scipy/linalg/_decomp_interpolative.pyx":333
24380 : * dlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank])
24381 : *
24382 : * for kk in range(n): # <<<<<<<<<<<<<<
24383 : * ra[krank*n + kk] = y[kk]
24384 : *
24385 : */
24386 57 : __pyx_t_5 = __pyx_v_n;
24387 57 : __pyx_t_3 = __pyx_t_5;
24388 16266 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24389 16209 : __pyx_v_kk = __pyx_t_4;
24390 :
24391 : /* "scipy/linalg/_decomp_interpolative.pyx":334
24392 : *
24393 : * for kk in range(n):
24394 : * ra[krank*n + kk] = y[kk] # <<<<<<<<<<<<<<
24395 : *
24396 : * # Running out of space; try to double the size of ra
24397 : */
24398 16209 : __pyx_t_17 = __pyx_v_kk;
24399 16209 : (__pyx_v_ra[((__pyx_v_krank * __pyx_v_n) + __pyx_v_kk)]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_17)) )));
24400 : }
24401 :
24402 : /* "scipy/linalg/_decomp_interpolative.pyx":337
24403 : *
24404 : * # Running out of space; try to double the size of ra
24405 : * if krank == (no_of_cols-2): # <<<<<<<<<<<<<<
24406 : * reallocated_ra = <cnp.float64_t *>PyMem_Realloc(
24407 : * ra, sizeof(cnp.float64_t)*no_of_cols*n*2)
24408 : */
24409 57 : __pyx_t_6 = (__pyx_v_krank == (__pyx_v_no_of_cols - 2));
24410 57 : if (__pyx_t_6) {
24411 :
24412 : /* "scipy/linalg/_decomp_interpolative.pyx":338
24413 : * # Running out of space; try to double the size of ra
24414 : * if krank == (no_of_cols-2):
24415 : * reallocated_ra = <cnp.float64_t *>PyMem_Realloc( # <<<<<<<<<<<<<<
24416 : * ra, sizeof(cnp.float64_t)*no_of_cols*n*2)
24417 : * reallocated_ret = <cnp.float64_t *>PyMem_Realloc(
24418 : */
24419 9 : __pyx_v_reallocated_ra = ((__pyx_t_5numpy_float64_t *)PyMem_Realloc(__pyx_v_ra, ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_no_of_cols) * __pyx_v_n) * 2)));
24420 :
24421 : /* "scipy/linalg/_decomp_interpolative.pyx":340
24422 : * reallocated_ra = <cnp.float64_t *>PyMem_Realloc(
24423 : * ra, sizeof(cnp.float64_t)*no_of_cols*n*2)
24424 : * reallocated_ret = <cnp.float64_t *>PyMem_Realloc( # <<<<<<<<<<<<<<
24425 : * ret, sizeof(cnp.float64_t)*no_of_cols*n*2)
24426 : *
24427 : */
24428 9 : __pyx_v_reallocated_ret = ((__pyx_t_5numpy_float64_t *)PyMem_Realloc(__pyx_v_ret, ((((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_no_of_cols) * __pyx_v_n) * 2)));
24429 :
24430 : /* "scipy/linalg/_decomp_interpolative.pyx":343
24431 : * ret, sizeof(cnp.float64_t)*no_of_cols*n*2)
24432 : *
24433 : * if reallocated_ra and reallocated_ret: # <<<<<<<<<<<<<<
24434 : * ra = reallocated_ra
24435 : * ret = reallocated_ret
24436 : */
24437 9 : __pyx_t_10 = (__pyx_v_reallocated_ra != 0);
24438 9 : if (__pyx_t_10) {
24439 9 : } else {
24440 0 : __pyx_t_6 = __pyx_t_10;
24441 0 : goto __pyx_L18_bool_binop_done;
24442 : }
24443 9 : __pyx_t_10 = (__pyx_v_reallocated_ret != 0);
24444 9 : __pyx_t_6 = __pyx_t_10;
24445 9 : __pyx_L18_bool_binop_done:;
24446 9 : if (likely(__pyx_t_6)) {
24447 :
24448 : /* "scipy/linalg/_decomp_interpolative.pyx":344
24449 : *
24450 : * if reallocated_ra and reallocated_ret:
24451 : * ra = reallocated_ra # <<<<<<<<<<<<<<
24452 : * ret = reallocated_ret
24453 : * no_of_cols *= 2
24454 : */
24455 9 : __pyx_v_ra = __pyx_v_reallocated_ra;
24456 :
24457 : /* "scipy/linalg/_decomp_interpolative.pyx":345
24458 : * if reallocated_ra and reallocated_ret:
24459 : * ra = reallocated_ra
24460 : * ret = reallocated_ret # <<<<<<<<<<<<<<
24461 : * no_of_cols *= 2
24462 : * else:
24463 : */
24464 9 : __pyx_v_ret = __pyx_v_reallocated_ret;
24465 :
24466 : /* "scipy/linalg/_decomp_interpolative.pyx":346
24467 : * ra = reallocated_ra
24468 : * ret = reallocated_ret
24469 : * no_of_cols *= 2 # <<<<<<<<<<<<<<
24470 : * else:
24471 : * raise MemoryError(
24472 : */
24473 9 : __pyx_v_no_of_cols = (__pyx_v_no_of_cols * 2);
24474 :
24475 : /* "scipy/linalg/_decomp_interpolative.pyx":343
24476 : * ret, sizeof(cnp.float64_t)*no_of_cols*n*2)
24477 : *
24478 : * if reallocated_ra and reallocated_ret: # <<<<<<<<<<<<<<
24479 : * ra = reallocated_ra
24480 : * ret = reallocated_ret
24481 : */
24482 9 : goto __pyx_L17;
24483 : }
24484 :
24485 : /* "scipy/linalg/_decomp_interpolative.pyx":348
24486 : * no_of_cols *= 2
24487 : * else:
24488 : * raise MemoryError( # <<<<<<<<<<<<<<
24489 : * "'scipy.linalg.interpolative.idd_findrank()' failed to "
24490 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
24491 : */
24492 : /*else*/ {
24493 :
24494 : /* "scipy/linalg/_decomp_interpolative.pyx":349
24495 : * else:
24496 : * raise MemoryError(
24497 : * "'scipy.linalg.interpolative.idd_findrank()' failed to " # <<<<<<<<<<<<<<
24498 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
24499 : * "while trying to determine the rank (currently "
24500 : */
24501 0 : __pyx_t_13 = PyTuple_New(7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 349, __pyx_L7_error)
24502 0 : __Pyx_GOTREF(__pyx_t_13);
24503 0 : __pyx_t_11 = 0;
24504 0 : __pyx_t_12 = 127;
24505 0 : __Pyx_INCREF(__pyx_kp_u_scipy_linalg_interpolative_idd);
24506 0 : __pyx_t_11 += 83;
24507 0 : __Pyx_GIVEREF(__pyx_kp_u_scipy_linalg_interpolative_idd);
24508 0 : PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_kp_u_scipy_linalg_interpolative_idd);
24509 :
24510 : /* "scipy/linalg/_decomp_interpolative.pyx":350
24511 : * raise MemoryError(
24512 : * "'scipy.linalg.interpolative.idd_findrank()' failed to "
24513 : * f"allocate the required memory,{no_of_cols*n*16} bytes " # <<<<<<<<<<<<<<
24514 : * "while trying to determine the rank (currently "
24515 : * f"{krank}) of a LinearOperator with precision {eps}."
24516 : */
24517 0 : __pyx_t_2 = __Pyx_PyUnicode_From_long(((__pyx_v_no_of_cols * __pyx_v_n) * 16), 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L7_error)
24518 0 : __Pyx_GOTREF(__pyx_t_2);
24519 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
24520 0 : __Pyx_GIVEREF(__pyx_t_2);
24521 0 : PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
24522 0 : __pyx_t_2 = 0;
24523 0 : __Pyx_INCREF(__pyx_kp_u_bytes_while_trying_to_determine);
24524 0 : __pyx_t_11 += 53;
24525 0 : __Pyx_GIVEREF(__pyx_kp_u_bytes_while_trying_to_determine);
24526 0 : PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u_bytes_while_trying_to_determine);
24527 :
24528 : /* "scipy/linalg/_decomp_interpolative.pyx":352
24529 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
24530 : * "while trying to determine the rank (currently "
24531 : * f"{krank}) of a LinearOperator with precision {eps}." # <<<<<<<<<<<<<<
24532 : * )
24533 : * krank += 1
24534 : */
24535 0 : __pyx_t_2 = __Pyx_PyUnicode_From_int(__pyx_v_krank, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L7_error)
24536 0 : __Pyx_GOTREF(__pyx_t_2);
24537 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
24538 0 : __Pyx_GIVEREF(__pyx_t_2);
24539 0 : PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
24540 0 : __pyx_t_2 = 0;
24541 0 : __Pyx_INCREF(__pyx_kp_u_of_a_LinearOperator_with_precis);
24542 0 : __pyx_t_11 += 37;
24543 0 : __Pyx_GIVEREF(__pyx_kp_u_of_a_LinearOperator_with_precis);
24544 0 : PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_kp_u_of_a_LinearOperator_with_precis);
24545 0 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L7_error)
24546 0 : __Pyx_GOTREF(__pyx_t_2);
24547 0 : __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L7_error)
24548 0 : __Pyx_GOTREF(__pyx_t_1);
24549 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24550 0 : __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_12;
24551 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
24552 0 : __Pyx_GIVEREF(__pyx_t_1);
24553 0 : PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_1);
24554 0 : __pyx_t_1 = 0;
24555 0 : __Pyx_INCREF(__pyx_kp_u__2);
24556 0 : __pyx_t_11 += 1;
24557 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
24558 0 : PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_kp_u__2);
24559 :
24560 : /* "scipy/linalg/_decomp_interpolative.pyx":349
24561 : * else:
24562 : * raise MemoryError(
24563 : * "'scipy.linalg.interpolative.idd_findrank()' failed to " # <<<<<<<<<<<<<<
24564 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
24565 : * "while trying to determine the rank (currently "
24566 : */
24567 0 : __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_13, 7, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L7_error)
24568 0 : __Pyx_GOTREF(__pyx_t_1);
24569 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24570 :
24571 : /* "scipy/linalg/_decomp_interpolative.pyx":348
24572 : * no_of_cols *= 2
24573 : * else:
24574 : * raise MemoryError( # <<<<<<<<<<<<<<
24575 : * "'scipy.linalg.interpolative.idd_findrank()' failed to "
24576 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
24577 : */
24578 0 : __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 348, __pyx_L7_error)
24579 0 : __Pyx_GOTREF(__pyx_t_13);
24580 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24581 0 : __Pyx_Raise(__pyx_t_13, 0, 0, 0);
24582 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24583 0 : __PYX_ERR(0, 348, __pyx_L7_error)
24584 : }
24585 9 : __pyx_L17:;
24586 :
24587 : /* "scipy/linalg/_decomp_interpolative.pyx":337
24588 : *
24589 : * # Running out of space; try to double the size of ra
24590 : * if krank == (no_of_cols-2): # <<<<<<<<<<<<<<
24591 : * reallocated_ra = <cnp.float64_t *>PyMem_Realloc(
24592 : * ra, sizeof(cnp.float64_t)*no_of_cols*n*2)
24593 : */
24594 : }
24595 :
24596 : /* "scipy/linalg/_decomp_interpolative.pyx":354
24597 : * f"{krank}) of a LinearOperator with precision {eps}."
24598 : * )
24599 : * krank += 1 # <<<<<<<<<<<<<<
24600 : * if (y[krank-1] < eps*enorm) or (krank >= min(m, n)):
24601 : * break
24602 : */
24603 57 : __pyx_v_krank = (__pyx_v_krank + 1);
24604 :
24605 : /* "scipy/linalg/_decomp_interpolative.pyx":355
24606 : * )
24607 : * krank += 1
24608 : * if (y[krank-1] < eps*enorm) or (krank >= min(m, n)): # <<<<<<<<<<<<<<
24609 : * break
24610 : * finally:
24611 : */
24612 57 : __pyx_t_17 = (__pyx_v_krank - 1);
24613 57 : __pyx_t_10 = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_y.data) + __pyx_t_17)) ))) < (__pyx_v_eps * __pyx_v_enorm));
24614 57 : if (!__pyx_t_10) {
24615 53 : } else {
24616 4 : __pyx_t_6 = __pyx_t_10;
24617 4 : goto __pyx_L21_bool_binop_done;
24618 : }
24619 53 : __pyx_t_5 = __pyx_v_n;
24620 53 : __pyx_t_3 = __pyx_v_m;
24621 53 : __pyx_t_10 = (__pyx_t_5 < __pyx_t_3);
24622 53 : if (__pyx_t_10) {
24623 : __pyx_t_4 = __pyx_t_5;
24624 : } else {
24625 : __pyx_t_4 = __pyx_t_3;
24626 : }
24627 53 : __pyx_t_10 = (__pyx_v_krank >= __pyx_t_4);
24628 53 : __pyx_t_6 = __pyx_t_10;
24629 57 : __pyx_L21_bool_binop_done:;
24630 57 : if (__pyx_t_6) {
24631 :
24632 : /* "scipy/linalg/_decomp_interpolative.pyx":356
24633 : * krank += 1
24634 : * if (y[krank-1] < eps*enorm) or (krank >= min(m, n)):
24635 : * break # <<<<<<<<<<<<<<
24636 : * finally:
24637 : * # Crashed or successfully ended up here
24638 : */
24639 4 : goto __pyx_L10_break;
24640 :
24641 : /* "scipy/linalg/_decomp_interpolative.pyx":355
24642 : * )
24643 : * krank += 1
24644 : * if (y[krank-1] < eps*enorm) or (krank >= min(m, n)): # <<<<<<<<<<<<<<
24645 : * break
24646 : * finally:
24647 : */
24648 : }
24649 : }
24650 4 : __pyx_L10_break:;
24651 : }
24652 :
24653 : /* "scipy/linalg/_decomp_interpolative.pyx":360
24654 : * # Crashed or successfully ended up here
24655 : * # Discard Householder vectors
24656 : * PyMem_Free(ra) # <<<<<<<<<<<<<<
24657 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24658 : * for k in range(krank):
24659 : */
24660 : /*finally:*/ {
24661 : /*normal exit:*/{
24662 4 : PyMem_Free(__pyx_v_ra);
24663 :
24664 : /* "scipy/linalg/_decomp_interpolative.pyx":361
24665 : * # Discard Householder vectors
24666 : * PyMem_Free(ra)
24667 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
24668 : * for k in range(krank):
24669 : * for kk in range(n):
24670 : */
24671 4 : __pyx_t_18[0] = __pyx_v_krank;
24672 4 : __pyx_t_18[1] = __pyx_v_n;
24673 4 : __pyx_t_13 = PyArray_EMPTY(2, __pyx_t_18, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 361, __pyx_L1_error)
24674 4 : __Pyx_GOTREF(__pyx_t_13);
24675 4 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 361, __pyx_L1_error)
24676 4 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_13);
24677 : {
24678 4 : __Pyx_BufFmt_StackElem __pyx_stack[1];
24679 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
24680 4 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
24681 4 : if (unlikely(__pyx_t_4 < 0)) {
24682 0 : PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
24683 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_retarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
24684 : Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
24685 : __Pyx_RaiseBufferFallbackError();
24686 : } else {
24687 0 : PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
24688 : }
24689 0 : __pyx_t_20 = __pyx_t_21 = __pyx_t_22 = 0;
24690 : }
24691 4 : __pyx_pybuffernd_retarr.diminfo[0].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_retarr.diminfo[0].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_retarr.diminfo[1].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_retarr.diminfo[1].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[1];
24692 4 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 361, __pyx_L1_error)
24693 : }
24694 4 : __pyx_t_19 = 0;
24695 4 : __pyx_v_retarr = ((PyArrayObject *)__pyx_t_13);
24696 4 : __pyx_t_13 = 0;
24697 :
24698 : /* "scipy/linalg/_decomp_interpolative.pyx":362
24699 : * PyMem_Free(ra)
24700 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24701 : * for k in range(krank): # <<<<<<<<<<<<<<
24702 : * for kk in range(n):
24703 : * retarr[k, kk] = ret[k*n+kk]
24704 : */
24705 4 : __pyx_t_4 = __pyx_v_krank;
24706 4 : __pyx_t_5 = __pyx_t_4;
24707 61 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
24708 57 : __pyx_v_k = __pyx_t_3;
24709 :
24710 : /* "scipy/linalg/_decomp_interpolative.pyx":363
24711 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24712 : * for k in range(krank):
24713 : * for kk in range(n): # <<<<<<<<<<<<<<
24714 : * retarr[k, kk] = ret[k*n+kk]
24715 : * PyMem_Free(ret)
24716 : */
24717 57 : __pyx_t_23 = __pyx_v_n;
24718 57 : __pyx_t_24 = __pyx_t_23;
24719 16266 : for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
24720 16209 : __pyx_v_kk = __pyx_t_25;
24721 :
24722 : /* "scipy/linalg/_decomp_interpolative.pyx":364
24723 : * for k in range(krank):
24724 : * for kk in range(n):
24725 : * retarr[k, kk] = ret[k*n+kk] # <<<<<<<<<<<<<<
24726 : * PyMem_Free(ret)
24727 : *
24728 : */
24729 16209 : __pyx_t_17 = __pyx_v_k;
24730 16209 : __pyx_t_15 = __pyx_v_kk;
24731 16209 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_retarr.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_retarr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_retarr.diminfo[1].strides) = (__pyx_v_ret[((__pyx_v_k * __pyx_v_n) + __pyx_v_kk)]);
24732 : }
24733 : }
24734 :
24735 : /* "scipy/linalg/_decomp_interpolative.pyx":365
24736 : * for kk in range(n):
24737 : * retarr[k, kk] = ret[k*n+kk]
24738 : * PyMem_Free(ret) # <<<<<<<<<<<<<<
24739 : *
24740 : * return krank, retarr
24741 : */
24742 4 : PyMem_Free(__pyx_v_ret);
24743 4 : goto __pyx_L8;
24744 : }
24745 0 : __pyx_L7_error:;
24746 : /*exception exit:*/{
24747 0 : __Pyx_PyThreadState_declare
24748 0 : __Pyx_PyThreadState_assign
24749 0 : __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
24750 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24751 0 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
24752 0 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24753 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
24754 0 : __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL;
24755 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
24756 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
24757 0 : __Pyx_XGOTREF(__pyx_t_22);
24758 0 : __Pyx_XGOTREF(__pyx_t_21);
24759 0 : __Pyx_XGOTREF(__pyx_t_20);
24760 0 : __Pyx_XGOTREF(__pyx_t_27);
24761 0 : __Pyx_XGOTREF(__pyx_t_28);
24762 0 : __Pyx_XGOTREF(__pyx_t_29);
24763 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_26 = __pyx_filename;
24764 : {
24765 :
24766 : /* "scipy/linalg/_decomp_interpolative.pyx":360
24767 : * # Crashed or successfully ended up here
24768 : * # Discard Householder vectors
24769 : * PyMem_Free(ra) # <<<<<<<<<<<<<<
24770 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24771 : * for k in range(krank):
24772 : */
24773 0 : PyMem_Free(__pyx_v_ra);
24774 :
24775 : /* "scipy/linalg/_decomp_interpolative.pyx":361
24776 : * # Discard Householder vectors
24777 : * PyMem_Free(ra)
24778 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
24779 : * for k in range(krank):
24780 : * for kk in range(n):
24781 : */
24782 0 : __pyx_t_30[0] = __pyx_v_krank;
24783 0 : __pyx_t_30[1] = __pyx_v_n;
24784 0 : __pyx_t_13 = PyArray_EMPTY(2, __pyx_t_30, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 361, __pyx_L28_error)
24785 0 : __Pyx_GOTREF(__pyx_t_13);
24786 0 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 361, __pyx_L28_error)
24787 0 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_13);
24788 : {
24789 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
24790 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
24791 0 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
24792 0 : if (unlikely(__pyx_t_3 < 0)) {
24793 0 : PyErr_Fetch(&__pyx_t_31, &__pyx_t_32, &__pyx_t_33);
24794 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_retarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
24795 : Py_XDECREF(__pyx_t_31); Py_XDECREF(__pyx_t_32); Py_XDECREF(__pyx_t_33);
24796 : __Pyx_RaiseBufferFallbackError();
24797 : } else {
24798 0 : PyErr_Restore(__pyx_t_31, __pyx_t_32, __pyx_t_33);
24799 : }
24800 0 : __pyx_t_31 = __pyx_t_32 = __pyx_t_33 = 0;
24801 : }
24802 0 : __pyx_pybuffernd_retarr.diminfo[0].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_retarr.diminfo[0].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_retarr.diminfo[1].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_retarr.diminfo[1].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[1];
24803 0 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 361, __pyx_L28_error)
24804 : }
24805 0 : __pyx_t_19 = 0;
24806 0 : __pyx_v_retarr = ((PyArrayObject *)__pyx_t_13);
24807 0 : __pyx_t_13 = 0;
24808 :
24809 : /* "scipy/linalg/_decomp_interpolative.pyx":362
24810 : * PyMem_Free(ra)
24811 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24812 : * for k in range(krank): # <<<<<<<<<<<<<<
24813 : * for kk in range(n):
24814 : * retarr[k, kk] = ret[k*n+kk]
24815 : */
24816 0 : __pyx_t_3 = __pyx_v_krank;
24817 0 : __pyx_t_23 = __pyx_t_3;
24818 0 : for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
24819 0 : __pyx_v_k = __pyx_t_24;
24820 :
24821 : /* "scipy/linalg/_decomp_interpolative.pyx":363
24822 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_FLOAT64, 0)
24823 : * for k in range(krank):
24824 : * for kk in range(n): # <<<<<<<<<<<<<<
24825 : * retarr[k, kk] = ret[k*n+kk]
24826 : * PyMem_Free(ret)
24827 : */
24828 0 : __pyx_t_25 = __pyx_v_n;
24829 0 : __pyx_t_34 = __pyx_t_25;
24830 0 : for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
24831 0 : __pyx_v_kk = __pyx_t_35;
24832 :
24833 : /* "scipy/linalg/_decomp_interpolative.pyx":364
24834 : * for k in range(krank):
24835 : * for kk in range(n):
24836 : * retarr[k, kk] = ret[k*n+kk] # <<<<<<<<<<<<<<
24837 : * PyMem_Free(ret)
24838 : *
24839 : */
24840 0 : __pyx_t_15 = __pyx_v_k;
24841 0 : __pyx_t_17 = __pyx_v_kk;
24842 0 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_retarr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_retarr.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_retarr.diminfo[1].strides) = (__pyx_v_ret[((__pyx_v_k * __pyx_v_n) + __pyx_v_kk)]);
24843 : }
24844 : }
24845 :
24846 : /* "scipy/linalg/_decomp_interpolative.pyx":365
24847 : * for kk in range(n):
24848 : * retarr[k, kk] = ret[k*n+kk]
24849 : * PyMem_Free(ret) # <<<<<<<<<<<<<<
24850 : *
24851 : * return krank, retarr
24852 : */
24853 0 : PyMem_Free(__pyx_v_ret);
24854 : }
24855 0 : if (PY_MAJOR_VERSION >= 3) {
24856 0 : __Pyx_XGIVEREF(__pyx_t_27);
24857 0 : __Pyx_XGIVEREF(__pyx_t_28);
24858 0 : __Pyx_XGIVEREF(__pyx_t_29);
24859 0 : __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
24860 : }
24861 0 : __Pyx_XGIVEREF(__pyx_t_22);
24862 0 : __Pyx_XGIVEREF(__pyx_t_21);
24863 0 : __Pyx_XGIVEREF(__pyx_t_20);
24864 0 : __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
24865 0 : __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
24866 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_26;
24867 0 : goto __pyx_L1_error;
24868 0 : __pyx_L28_error:;
24869 0 : if (PY_MAJOR_VERSION >= 3) {
24870 0 : __Pyx_XGIVEREF(__pyx_t_27);
24871 0 : __Pyx_XGIVEREF(__pyx_t_28);
24872 0 : __Pyx_XGIVEREF(__pyx_t_29);
24873 0 : __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
24874 : }
24875 0 : __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
24876 0 : __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
24877 0 : __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
24878 0 : __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
24879 0 : goto __pyx_L1_error;
24880 : }
24881 4 : __pyx_L8:;
24882 : }
24883 :
24884 : /* "scipy/linalg/_decomp_interpolative.pyx":367
24885 : * PyMem_Free(ret)
24886 : *
24887 : * return krank, retarr # <<<<<<<<<<<<<<
24888 : *
24889 : *
24890 : */
24891 4 : __Pyx_XDECREF(__pyx_r);
24892 4 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 367, __pyx_L1_error)
24893 4 : __Pyx_GOTREF(__pyx_t_13);
24894 4 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
24895 4 : __Pyx_GOTREF(__pyx_t_1);
24896 4 : __Pyx_GIVEREF(__pyx_t_13);
24897 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_13)) __PYX_ERR(0, 367, __pyx_L1_error);
24898 4 : __Pyx_INCREF((PyObject *)__pyx_v_retarr);
24899 4 : __Pyx_GIVEREF((PyObject *)__pyx_v_retarr);
24900 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_retarr))) __PYX_ERR(0, 367, __pyx_L1_error);
24901 4 : __pyx_t_13 = 0;
24902 4 : __pyx_r = __pyx_t_1;
24903 4 : __pyx_t_1 = 0;
24904 4 : goto __pyx_L0;
24905 :
24906 : /* "scipy/linalg/_decomp_interpolative.pyx":279
24907 : *
24908 : *
24909 : * def idd_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
24910 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
24911 : *
24912 : */
24913 :
24914 : /* function exit code */
24915 0 : __pyx_L1_error:;
24916 0 : __Pyx_XDECREF(__pyx_t_1);
24917 0 : __Pyx_XDECREF(__pyx_t_2);
24918 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
24919 0 : __Pyx_XDECREF(__pyx_t_13);
24920 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
24921 0 : __Pyx_PyThreadState_declare
24922 0 : __Pyx_PyThreadState_assign
24923 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
24924 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
24925 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
24926 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_findrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
24927 0 : __pyx_r = NULL;
24928 0 : goto __pyx_L2;
24929 4 : __pyx_L0:;
24930 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
24931 4 : __pyx_L2:;
24932 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_tau, 1);
24933 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
24934 4 : __Pyx_XDECREF((PyObject *)__pyx_v_retarr);
24935 4 : __Pyx_XDECREF(__pyx_v_x);
24936 4 : __Pyx_XGIVEREF(__pyx_r);
24937 4 : __Pyx_RefNannyFinishContext();
24938 4 : return __pyx_r;
24939 : }
24940 :
24941 : /* "scipy/linalg/_decomp_interpolative.pyx":370
24942 : *
24943 : *
24944 : * def idd_id2svd( # <<<<<<<<<<<<<<
24945 : * cnp.ndarray[cnp.float64_t, mode='c', ndim=2] cols,
24946 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
24947 : */
24948 :
24949 : /* Python wrapper */
24950 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_7idd_id2svd(PyObject *__pyx_self,
24951 : #if CYTHON_METH_FASTCALL
24952 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24953 : #else
24954 : PyObject *__pyx_args, PyObject *__pyx_kwds
24955 : #endif
24956 : ); /*proto*/
24957 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_7idd_id2svd = {"idd_id2svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_7idd_id2svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24958 3 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_7idd_id2svd(PyObject *__pyx_self,
24959 : #if CYTHON_METH_FASTCALL
24960 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24961 : #else
24962 : PyObject *__pyx_args, PyObject *__pyx_kwds
24963 : #endif
24964 : ) {
24965 3 : PyArrayObject *__pyx_v_cols = 0;
24966 3 : PyArrayObject *__pyx_v_perms = 0;
24967 3 : PyArrayObject *__pyx_v_proj = 0;
24968 : #if !CYTHON_METH_FASTCALL
24969 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24970 : #endif
24971 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24972 3 : PyObject* values[3] = {0,0,0};
24973 3 : int __pyx_lineno = 0;
24974 3 : const char *__pyx_filename = NULL;
24975 3 : int __pyx_clineno = 0;
24976 3 : PyObject *__pyx_r = 0;
24977 : __Pyx_RefNannyDeclarations
24978 3 : __Pyx_RefNannySetupContext("idd_id2svd (wrapper)", 0);
24979 : #if !CYTHON_METH_FASTCALL
24980 : #if CYTHON_ASSUME_SAFE_MACROS
24981 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24982 : #else
24983 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24984 : #endif
24985 : #endif
24986 3 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24987 : {
24988 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cols,&__pyx_n_s_perms,&__pyx_n_s_proj,0};
24989 3 : if (__pyx_kwds) {
24990 2 : Py_ssize_t kw_args;
24991 2 : switch (__pyx_nargs) {
24992 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
24993 0 : CYTHON_FALLTHROUGH;
24994 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
24995 0 : CYTHON_FALLTHROUGH;
24996 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
24997 2 : CYTHON_FALLTHROUGH;
24998 2 : case 0: break;
24999 0 : default: goto __pyx_L5_argtuple_error;
25000 : }
25001 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
25002 2 : switch (__pyx_nargs) {
25003 2 : case 0:
25004 2 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) {
25005 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
25006 2 : kw_args--;
25007 : }
25008 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error)
25009 0 : else goto __pyx_L5_argtuple_error;
25010 2 : CYTHON_FALLTHROUGH;
25011 : case 1:
25012 2 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perms)) != 0)) {
25013 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
25014 2 : kw_args--;
25015 : }
25016 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error)
25017 : else {
25018 0 : __Pyx_RaiseArgtupleInvalid("idd_id2svd", 1, 3, 3, 1); __PYX_ERR(0, 370, __pyx_L3_error)
25019 : }
25020 2 : CYTHON_FALLTHROUGH;
25021 : case 2:
25022 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proj)) != 0)) {
25023 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
25024 2 : kw_args--;
25025 : }
25026 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 370, __pyx_L3_error)
25027 : else {
25028 0 : __Pyx_RaiseArgtupleInvalid("idd_id2svd", 1, 3, 3, 2); __PYX_ERR(0, 370, __pyx_L3_error)
25029 : }
25030 : }
25031 2 : if (unlikely(kw_args > 0)) {
25032 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
25033 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_id2svd") < 0)) __PYX_ERR(0, 370, __pyx_L3_error)
25034 : }
25035 1 : } else if (unlikely(__pyx_nargs != 3)) {
25036 0 : goto __pyx_L5_argtuple_error;
25037 : } else {
25038 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
25039 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
25040 1 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
25041 : }
25042 3 : __pyx_v_cols = ((PyArrayObject *)values[0]);
25043 3 : __pyx_v_perms = ((PyArrayObject *)values[1]);
25044 3 : __pyx_v_proj = ((PyArrayObject *)values[2]);
25045 : }
25046 3 : goto __pyx_L6_skip;
25047 0 : __pyx_L5_argtuple_error:;
25048 0 : __Pyx_RaiseArgtupleInvalid("idd_id2svd", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 370, __pyx_L3_error)
25049 3 : __pyx_L6_skip:;
25050 3 : goto __pyx_L4_argument_unpacking_done;
25051 0 : __pyx_L3_error:;
25052 : {
25053 0 : Py_ssize_t __pyx_temp;
25054 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25055 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
25056 : }
25057 : }
25058 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_id2svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
25059 0 : __Pyx_RefNannyFinishContext();
25060 0 : return NULL;
25061 3 : __pyx_L4_argument_unpacking_done:;
25062 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cols), __pyx_ptype_5numpy_ndarray, 1, "cols", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
25063 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perms), __pyx_ptype_5numpy_ndarray, 1, "perms", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
25064 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proj), __pyx_ptype_5numpy_ndarray, 1, "proj", 0))) __PYX_ERR(0, 373, __pyx_L1_error)
25065 3 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_6idd_id2svd(__pyx_self, __pyx_v_cols, __pyx_v_perms, __pyx_v_proj);
25066 :
25067 : /* function exit code */
25068 3 : goto __pyx_L0;
25069 : __pyx_L1_error:;
25070 : __pyx_r = NULL;
25071 3 : __pyx_L0:;
25072 : {
25073 3 : Py_ssize_t __pyx_temp;
25074 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25075 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
25076 : }
25077 : }
25078 : __Pyx_RefNannyFinishContext();
25079 : return __pyx_r;
25080 : }
25081 :
25082 3 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_6idd_id2svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_cols, PyArrayObject *__pyx_v_perms, PyArrayObject *__pyx_v_proj) {
25083 3 : int __pyx_v_m;
25084 3 : int __pyx_v_krank;
25085 3 : int __pyx_v_n;
25086 3 : int __pyx_v_info;
25087 3 : int __pyx_v_ci;
25088 3 : PyArrayObject *__pyx_v_C = 0;
25089 3 : PyArrayObject *__pyx_v_tau1 = 0;
25090 3 : PyArrayObject *__pyx_v_tau2 = 0;
25091 3 : PyArrayObject *__pyx_v_UU = 0;
25092 3 : PyArrayObject *__pyx_v_S = 0;
25093 3 : PyArrayObject *__pyx_v_V = 0;
25094 3 : PyArrayObject *__pyx_v_VV = 0;
25095 3 : PyArrayObject *__pyx_v_inds1 = 0;
25096 3 : PyArrayObject *__pyx_v_inds2 = 0;
25097 3 : PyArrayObject *__pyx_v_p = 0;
25098 3 : PyObject *__pyx_v_r = NULL;
25099 3 : PyObject *__pyx_v_t = NULL;
25100 3 : PyObject *__pyx_v_r2 = NULL;
25101 3 : PyObject *__pyx_v_r3 = NULL;
25102 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
25103 3 : __Pyx_Buffer __pyx_pybuffer_C;
25104 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
25105 3 : __Pyx_Buffer __pyx_pybuffer_S;
25106 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
25107 3 : __Pyx_Buffer __pyx_pybuffer_UU;
25108 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
25109 3 : __Pyx_Buffer __pyx_pybuffer_V;
25110 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
25111 3 : __Pyx_Buffer __pyx_pybuffer_VV;
25112 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_cols;
25113 3 : __Pyx_Buffer __pyx_pybuffer_cols;
25114 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
25115 3 : __Pyx_Buffer __pyx_pybuffer_inds1;
25116 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
25117 3 : __Pyx_Buffer __pyx_pybuffer_inds2;
25118 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
25119 3 : __Pyx_Buffer __pyx_pybuffer_p;
25120 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
25121 3 : __Pyx_Buffer __pyx_pybuffer_perms;
25122 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
25123 3 : __Pyx_Buffer __pyx_pybuffer_proj;
25124 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
25125 3 : __Pyx_Buffer __pyx_pybuffer_tau1;
25126 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
25127 3 : __Pyx_Buffer __pyx_pybuffer_tau2;
25128 3 : PyObject *__pyx_r = NULL;
25129 : __Pyx_RefNannyDeclarations
25130 3 : npy_intp __pyx_t_1[2];
25131 3 : PyObject *__pyx_t_2 = NULL;
25132 3 : PyArrayObject *__pyx_t_3 = NULL;
25133 3 : int __pyx_t_4;
25134 3 : PyObject *__pyx_t_5 = NULL;
25135 3 : PyObject *__pyx_t_6 = NULL;
25136 3 : PyObject *__pyx_t_7 = NULL;
25137 3 : npy_intp __pyx_t_8[2];
25138 3 : PyArrayObject *__pyx_t_9 = NULL;
25139 3 : npy_intp __pyx_t_10[2];
25140 3 : PyArrayObject *__pyx_t_11 = NULL;
25141 3 : int __pyx_t_12;
25142 3 : int __pyx_t_13;
25143 3 : Py_ssize_t __pyx_t_14;
25144 3 : Py_ssize_t __pyx_t_15;
25145 3 : __pyx_t_5numpy_int64_t __pyx_t_16;
25146 3 : PyObject *__pyx_t_17 = NULL;
25147 3 : PyObject *__pyx_t_18 = NULL;
25148 3 : PyObject *__pyx_t_19 = NULL;
25149 3 : unsigned int __pyx_t_20;
25150 3 : PyObject *(*__pyx_t_21)(PyObject *);
25151 3 : PyArrayObject *__pyx_t_22 = NULL;
25152 3 : PyArrayObject *__pyx_t_23 = NULL;
25153 3 : PyArrayObject *__pyx_t_24 = NULL;
25154 3 : PyArrayObject *__pyx_t_25 = NULL;
25155 3 : PyObject *__pyx_t_26 = NULL;
25156 3 : PyObject *__pyx_t_27 = NULL;
25157 3 : PyObject *__pyx_t_28 = NULL;
25158 3 : PyArrayObject *__pyx_t_29 = NULL;
25159 3 : PyArrayObject *__pyx_t_30 = NULL;
25160 3 : PyArrayObject *__pyx_t_31 = NULL;
25161 3 : Py_ssize_t __pyx_t_32;
25162 3 : Py_ssize_t __pyx_t_33;
25163 3 : Py_ssize_t __pyx_t_34;
25164 3 : Py_ssize_t __pyx_t_35;
25165 3 : Py_ssize_t __pyx_t_36;
25166 3 : int __pyx_lineno = 0;
25167 3 : const char *__pyx_filename = NULL;
25168 3 : int __pyx_clineno = 0;
25169 3 : __Pyx_RefNannySetupContext("idd_id2svd", 1);
25170 3 : __pyx_pybuffer_C.pybuffer.buf = NULL;
25171 3 : __pyx_pybuffer_C.refcount = 0;
25172 3 : __pyx_pybuffernd_C.data = NULL;
25173 3 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
25174 3 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
25175 3 : __pyx_pybuffer_tau1.refcount = 0;
25176 3 : __pyx_pybuffernd_tau1.data = NULL;
25177 3 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
25178 3 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
25179 3 : __pyx_pybuffer_tau2.refcount = 0;
25180 3 : __pyx_pybuffernd_tau2.data = NULL;
25181 3 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
25182 3 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
25183 3 : __pyx_pybuffer_UU.refcount = 0;
25184 3 : __pyx_pybuffernd_UU.data = NULL;
25185 3 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
25186 3 : __pyx_pybuffer_S.pybuffer.buf = NULL;
25187 3 : __pyx_pybuffer_S.refcount = 0;
25188 3 : __pyx_pybuffernd_S.data = NULL;
25189 3 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
25190 3 : __pyx_pybuffer_V.pybuffer.buf = NULL;
25191 3 : __pyx_pybuffer_V.refcount = 0;
25192 3 : __pyx_pybuffernd_V.data = NULL;
25193 3 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
25194 3 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
25195 3 : __pyx_pybuffer_VV.refcount = 0;
25196 3 : __pyx_pybuffernd_VV.data = NULL;
25197 3 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
25198 3 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
25199 3 : __pyx_pybuffer_inds1.refcount = 0;
25200 3 : __pyx_pybuffernd_inds1.data = NULL;
25201 3 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
25202 3 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
25203 3 : __pyx_pybuffer_inds2.refcount = 0;
25204 3 : __pyx_pybuffernd_inds2.data = NULL;
25205 3 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
25206 3 : __pyx_pybuffer_p.pybuffer.buf = NULL;
25207 3 : __pyx_pybuffer_p.refcount = 0;
25208 3 : __pyx_pybuffernd_p.data = NULL;
25209 3 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
25210 3 : __pyx_pybuffer_cols.pybuffer.buf = NULL;
25211 3 : __pyx_pybuffer_cols.refcount = 0;
25212 3 : __pyx_pybuffernd_cols.data = NULL;
25213 3 : __pyx_pybuffernd_cols.rcbuffer = &__pyx_pybuffer_cols;
25214 3 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
25215 3 : __pyx_pybuffer_perms.refcount = 0;
25216 3 : __pyx_pybuffernd_perms.data = NULL;
25217 3 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
25218 3 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
25219 3 : __pyx_pybuffer_proj.refcount = 0;
25220 3 : __pyx_pybuffernd_proj.data = NULL;
25221 3 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
25222 : {
25223 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25224 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cols.rcbuffer->pybuffer, (PyObject*)__pyx_v_cols, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 370, __pyx_L1_error)
25225 : }
25226 3 : __pyx_pybuffernd_cols.diminfo[0].strides = __pyx_pybuffernd_cols.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cols.diminfo[0].shape = __pyx_pybuffernd_cols.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cols.diminfo[1].strides = __pyx_pybuffernd_cols.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cols.diminfo[1].shape = __pyx_pybuffernd_cols.rcbuffer->pybuffer.shape[1];
25227 : {
25228 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25229 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 370, __pyx_L1_error)
25230 : }
25231 3 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
25232 : {
25233 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25234 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 370, __pyx_L1_error)
25235 : }
25236 3 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
25237 :
25238 : /* "scipy/linalg/_decomp_interpolative.pyx":375
25239 : * cnp.ndarray[cnp.float64_t, ndim=2] proj,
25240 : * ):
25241 : * cdef int m = cols.shape[0], krank = cols.shape[1] # <<<<<<<<<<<<<<
25242 : * cdef int n = proj.shape[1] + krank, info, ci
25243 : * cdef cnp.ndarray[cnp.float64_t, mode='fortran', ndim=2] C
25244 : */
25245 3 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_cols))[0]);
25246 3 : __pyx_v_krank = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_cols))[1]);
25247 :
25248 : /* "scipy/linalg/_decomp_interpolative.pyx":376
25249 : * ):
25250 : * cdef int m = cols.shape[0], krank = cols.shape[1]
25251 : * cdef int n = proj.shape[1] + krank, info, ci # <<<<<<<<<<<<<<
25252 : * cdef cnp.ndarray[cnp.float64_t, mode='fortran', ndim=2] C
25253 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] tau1
25254 : */
25255 3 : __pyx_v_n = ((__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_proj))[1]) + __pyx_v_krank);
25256 :
25257 : /* "scipy/linalg/_decomp_interpolative.pyx":388
25258 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] p
25259 : *
25260 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
25261 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
25262 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
25263 : */
25264 3 : __pyx_t_1[0] = __pyx_v_m;
25265 3 : __pyx_t_1[1] = __pyx_v_krank;
25266 3 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_1, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
25267 3 : __Pyx_GOTREF(__pyx_t_2);
25268 3 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 388, __pyx_L1_error)
25269 3 : __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
25270 : {
25271 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25272 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
25273 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
25274 3 : if (unlikely(__pyx_t_4 < 0)) {
25275 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
25276 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
25277 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
25278 : __Pyx_RaiseBufferFallbackError();
25279 : } else {
25280 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
25281 : }
25282 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
25283 : }
25284 3 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
25285 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 388, __pyx_L1_error)
25286 : }
25287 3 : __pyx_t_3 = 0;
25288 3 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
25289 3 : __pyx_t_2 = 0;
25290 :
25291 : /* "scipy/linalg/_decomp_interpolative.pyx":389
25292 : *
25293 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
25294 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
25295 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
25296 : *
25297 : */
25298 3 : __pyx_t_8[0] = __pyx_v_n;
25299 3 : __pyx_t_8[1] = __pyx_v_krank;
25300 3 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_8, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
25301 3 : __Pyx_GOTREF(__pyx_t_2);
25302 3 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 389, __pyx_L1_error)
25303 3 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
25304 : {
25305 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25306 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
25307 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
25308 3 : if (unlikely(__pyx_t_4 < 0)) {
25309 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
25310 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
25311 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
25312 : __Pyx_RaiseBufferFallbackError();
25313 : } else {
25314 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
25315 : }
25316 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
25317 : }
25318 3 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
25319 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 389, __pyx_L1_error)
25320 : }
25321 3 : __pyx_t_9 = 0;
25322 3 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_2);
25323 3 : __pyx_t_2 = 0;
25324 :
25325 : /* "scipy/linalg/_decomp_interpolative.pyx":390
25326 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
25327 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
25328 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
25329 : *
25330 : * # idd_reconint
25331 : */
25332 3 : __pyx_t_10[0] = __pyx_v_krank;
25333 3 : __pyx_t_10[1] = __pyx_v_n;
25334 3 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_10, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
25335 3 : __Pyx_GOTREF(__pyx_t_2);
25336 3 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 390, __pyx_L1_error)
25337 3 : __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
25338 : {
25339 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25340 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
25341 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
25342 3 : if (unlikely(__pyx_t_4 < 0)) {
25343 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
25344 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
25345 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
25346 : __Pyx_RaiseBufferFallbackError();
25347 : } else {
25348 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
25349 : }
25350 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
25351 : }
25352 3 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
25353 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 390, __pyx_L1_error)
25354 : }
25355 3 : __pyx_t_11 = 0;
25356 3 : __pyx_v_p = ((PyArrayObject *)__pyx_t_2);
25357 3 : __pyx_t_2 = 0;
25358 :
25359 : /* "scipy/linalg/_decomp_interpolative.pyx":393
25360 : *
25361 : * # idd_reconint
25362 : * for ci in range(krank): # <<<<<<<<<<<<<<
25363 : * p[ci, perms[ci]] = 1.0
25364 : *
25365 : */
25366 3 : __pyx_t_4 = __pyx_v_krank;
25367 3 : __pyx_t_12 = __pyx_t_4;
25368 61 : for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
25369 58 : __pyx_v_ci = __pyx_t_13;
25370 :
25371 : /* "scipy/linalg/_decomp_interpolative.pyx":394
25372 : * # idd_reconint
25373 : * for ci in range(krank):
25374 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
25375 : *
25376 : * p[:, perms[krank:]] = proj[:, :]
25377 : */
25378 58 : __pyx_t_14 = __pyx_v_ci;
25379 58 : __pyx_t_15 = __pyx_v_ci;
25380 58 : __pyx_t_16 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_perms.diminfo[0].strides));
25381 58 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_p.diminfo[1].strides) = 1.0;
25382 : }
25383 :
25384 : /* "scipy/linalg/_decomp_interpolative.pyx":396
25385 : * p[ci, perms[ci]] = 1.0
25386 : *
25387 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
25388 : *
25389 : * inds1, tau1 = iddr_qrpiv(cols, krank)
25390 : */
25391 3 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
25392 3 : __Pyx_GOTREF(__pyx_t_2);
25393 3 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 396, __pyx_L1_error)
25394 3 : __Pyx_GOTREF(__pyx_t_17);
25395 3 : __pyx_t_18 = PySlice_New(__pyx_t_17, Py_None, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 396, __pyx_L1_error)
25396 3 : __Pyx_GOTREF(__pyx_t_18);
25397 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25398 3 : __pyx_t_17 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 396, __pyx_L1_error)
25399 3 : __Pyx_GOTREF(__pyx_t_17);
25400 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25401 3 : __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 396, __pyx_L1_error)
25402 3 : __Pyx_GOTREF(__pyx_t_18);
25403 3 : __Pyx_INCREF(__pyx_slice__5);
25404 3 : __Pyx_GIVEREF(__pyx_slice__5);
25405 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_slice__5)) __PYX_ERR(0, 396, __pyx_L1_error);
25406 3 : __Pyx_GIVEREF(__pyx_t_17);
25407 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17)) __PYX_ERR(0, 396, __pyx_L1_error);
25408 3 : __pyx_t_17 = 0;
25409 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_18, __pyx_t_2) < 0))) __PYX_ERR(0, 396, __pyx_L1_error)
25410 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25411 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25412 :
25413 : /* "scipy/linalg/_decomp_interpolative.pyx":398
25414 : * p[:, perms[krank:]] = proj[:, :]
25415 : *
25416 : * inds1, tau1 = iddr_qrpiv(cols, krank) # <<<<<<<<<<<<<<
25417 : * # idd_rinqr and idd_rearr
25418 : * r = np.triu(cols[:krank, :])
25419 : */
25420 3 : __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 398, __pyx_L1_error)
25421 3 : __Pyx_GOTREF(__pyx_t_18);
25422 3 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 398, __pyx_L1_error)
25423 3 : __Pyx_GOTREF(__pyx_t_17);
25424 3 : __pyx_t_19 = NULL;
25425 3 : __pyx_t_20 = 0;
25426 : #if CYTHON_UNPACK_METHODS
25427 3 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
25428 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
25429 0 : if (likely(__pyx_t_19)) {
25430 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
25431 0 : __Pyx_INCREF(__pyx_t_19);
25432 0 : __Pyx_INCREF(function);
25433 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
25434 : __pyx_t_20 = 1;
25435 : }
25436 : }
25437 : #endif
25438 : {
25439 3 : PyObject *__pyx_callargs[3] = {__pyx_t_19, ((PyObject *)__pyx_v_cols), __pyx_t_17};
25440 3 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_20, 2+__pyx_t_20);
25441 3 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
25442 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25443 3 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error)
25444 3 : __Pyx_GOTREF(__pyx_t_2);
25445 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25446 : }
25447 3 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
25448 3 : PyObject* sequence = __pyx_t_2;
25449 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
25450 3 : if (unlikely(size != 2)) {
25451 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
25452 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
25453 0 : __PYX_ERR(0, 398, __pyx_L1_error)
25454 : }
25455 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25456 3 : if (likely(PyTuple_CheckExact(sequence))) {
25457 3 : __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0);
25458 3 : __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
25459 : } else {
25460 0 : __pyx_t_18 = PyList_GET_ITEM(sequence, 0);
25461 0 : __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
25462 : }
25463 3 : __Pyx_INCREF(__pyx_t_18);
25464 3 : __Pyx_INCREF(__pyx_t_17);
25465 : #else
25466 : __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 398, __pyx_L1_error)
25467 : __Pyx_GOTREF(__pyx_t_18);
25468 : __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 398, __pyx_L1_error)
25469 : __Pyx_GOTREF(__pyx_t_17);
25470 : #endif
25471 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25472 : } else {
25473 0 : Py_ssize_t index = -1;
25474 0 : __pyx_t_19 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 398, __pyx_L1_error)
25475 0 : __Pyx_GOTREF(__pyx_t_19);
25476 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25477 0 : __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19);
25478 0 : index = 0; __pyx_t_18 = __pyx_t_21(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L5_unpacking_failed;
25479 0 : __Pyx_GOTREF(__pyx_t_18);
25480 0 : index = 1; __pyx_t_17 = __pyx_t_21(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L5_unpacking_failed;
25481 0 : __Pyx_GOTREF(__pyx_t_17);
25482 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_19), 2) < 0) __PYX_ERR(0, 398, __pyx_L1_error)
25483 0 : __pyx_t_21 = NULL;
25484 0 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25485 0 : goto __pyx_L6_unpacking_done;
25486 0 : __pyx_L5_unpacking_failed:;
25487 0 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25488 0 : __pyx_t_21 = NULL;
25489 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
25490 0 : __PYX_ERR(0, 398, __pyx_L1_error)
25491 0 : __pyx_L6_unpacking_done:;
25492 : }
25493 3 : if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 398, __pyx_L1_error)
25494 3 : if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 398, __pyx_L1_error)
25495 3 : __pyx_t_22 = ((PyArrayObject *)__pyx_t_18);
25496 : {
25497 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25498 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
25499 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
25500 3 : if (unlikely(__pyx_t_4 < 0)) {
25501 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
25502 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
25503 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
25504 : __Pyx_RaiseBufferFallbackError();
25505 : } else {
25506 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
25507 : }
25508 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
25509 : }
25510 3 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
25511 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 398, __pyx_L1_error)
25512 : }
25513 3 : __pyx_t_22 = 0;
25514 3 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_18);
25515 3 : __pyx_t_18 = 0;
25516 3 : __pyx_t_23 = ((PyArrayObject *)__pyx_t_17);
25517 : {
25518 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25519 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
25520 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
25521 3 : if (unlikely(__pyx_t_4 < 0)) {
25522 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
25523 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
25524 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
25525 : __Pyx_RaiseBufferFallbackError();
25526 : } else {
25527 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
25528 : }
25529 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
25530 : }
25531 3 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
25532 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 398, __pyx_L1_error)
25533 : }
25534 3 : __pyx_t_23 = 0;
25535 3 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_17);
25536 3 : __pyx_t_17 = 0;
25537 :
25538 : /* "scipy/linalg/_decomp_interpolative.pyx":400
25539 : * inds1, tau1 = iddr_qrpiv(cols, krank)
25540 : * # idd_rinqr and idd_rearr
25541 : * r = np.triu(cols[:krank, :]) # <<<<<<<<<<<<<<
25542 : * for ci in range(krank-1, -1, -1):
25543 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
25544 : */
25545 3 : __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 400, __pyx_L1_error)
25546 3 : __Pyx_GOTREF(__pyx_t_17);
25547 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_triu); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 400, __pyx_L1_error)
25548 3 : __Pyx_GOTREF(__pyx_t_18);
25549 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25550 3 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 400, __pyx_L1_error)
25551 3 : __Pyx_GOTREF(__pyx_t_17);
25552 3 : __pyx_t_19 = PySlice_New(Py_None, __pyx_t_17, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L1_error)
25553 3 : __Pyx_GOTREF(__pyx_t_19);
25554 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25555 3 : __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 400, __pyx_L1_error)
25556 3 : __Pyx_GOTREF(__pyx_t_17);
25557 3 : __Pyx_GIVEREF(__pyx_t_19);
25558 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19)) __PYX_ERR(0, 400, __pyx_L1_error);
25559 3 : __Pyx_INCREF(__pyx_slice__5);
25560 3 : __Pyx_GIVEREF(__pyx_slice__5);
25561 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_slice__5)) __PYX_ERR(0, 400, __pyx_L1_error);
25562 3 : __pyx_t_19 = 0;
25563 3 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_cols), __pyx_t_17); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L1_error)
25564 3 : __Pyx_GOTREF(__pyx_t_19);
25565 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25566 3 : __pyx_t_17 = NULL;
25567 3 : __pyx_t_20 = 0;
25568 : #if CYTHON_UNPACK_METHODS
25569 3 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
25570 0 : __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18);
25571 0 : if (likely(__pyx_t_17)) {
25572 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
25573 0 : __Pyx_INCREF(__pyx_t_17);
25574 0 : __Pyx_INCREF(function);
25575 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
25576 : __pyx_t_20 = 1;
25577 : }
25578 : }
25579 : #endif
25580 : {
25581 3 : PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_19};
25582 3 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_20, 1+__pyx_t_20);
25583 3 : __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
25584 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25585 3 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
25586 3 : __Pyx_GOTREF(__pyx_t_2);
25587 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25588 : }
25589 3 : __pyx_v_r = __pyx_t_2;
25590 3 : __pyx_t_2 = 0;
25591 :
25592 : /* "scipy/linalg/_decomp_interpolative.pyx":401
25593 : * # idd_rinqr and idd_rearr
25594 : * r = np.triu(cols[:krank, :])
25595 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
25596 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
25597 : *
25598 : */
25599 61 : for (__pyx_t_4 = (__pyx_v_krank - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
25600 58 : __pyx_v_ci = __pyx_t_4;
25601 :
25602 : /* "scipy/linalg/_decomp_interpolative.pyx":402
25603 : * r = np.triu(cols[:krank, :])
25604 : * for ci in range(krank-1, -1, -1):
25605 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
25606 : *
25607 : * t = p.T.copy()
25608 : */
25609 58 : __pyx_t_14 = __pyx_v_ci;
25610 58 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
25611 58 : __Pyx_GOTREF(__pyx_t_2);
25612 58 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 402, __pyx_L1_error)
25613 58 : __Pyx_GOTREF(__pyx_t_18);
25614 58 : __pyx_t_19 = PyList_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 402, __pyx_L1_error)
25615 58 : __Pyx_GOTREF(__pyx_t_19);
25616 58 : __Pyx_GIVEREF(__pyx_t_2);
25617 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 0, __pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error);
25618 58 : __Pyx_GIVEREF(__pyx_t_18);
25619 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 1, __pyx_t_18)) __PYX_ERR(0, 402, __pyx_L1_error);
25620 58 : __pyx_t_2 = 0;
25621 58 : __pyx_t_18 = 0;
25622 58 : __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 402, __pyx_L1_error)
25623 58 : __Pyx_GOTREF(__pyx_t_18);
25624 58 : __Pyx_INCREF(__pyx_slice__5);
25625 58 : __Pyx_GIVEREF(__pyx_slice__5);
25626 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_slice__5)) __PYX_ERR(0, 402, __pyx_L1_error);
25627 58 : __Pyx_GIVEREF(__pyx_t_19);
25628 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_19)) __PYX_ERR(0, 402, __pyx_L1_error);
25629 58 : __pyx_t_19 = 0;
25630 58 : __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 402, __pyx_L1_error)
25631 58 : __Pyx_GOTREF(__pyx_t_19);
25632 58 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25633 58 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 402, __pyx_L1_error)
25634 58 : __Pyx_GOTREF(__pyx_t_18);
25635 58 : __pyx_t_14 = __pyx_v_ci;
25636 58 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
25637 58 : __Pyx_GOTREF(__pyx_t_2);
25638 58 : __pyx_t_17 = PyList_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 402, __pyx_L1_error)
25639 58 : __Pyx_GOTREF(__pyx_t_17);
25640 58 : __Pyx_GIVEREF(__pyx_t_18);
25641 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_18)) __PYX_ERR(0, 402, __pyx_L1_error);
25642 58 : __Pyx_GIVEREF(__pyx_t_2);
25643 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error);
25644 58 : __pyx_t_18 = 0;
25645 58 : __pyx_t_2 = 0;
25646 58 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
25647 58 : __Pyx_GOTREF(__pyx_t_2);
25648 58 : __Pyx_INCREF(__pyx_slice__5);
25649 58 : __Pyx_GIVEREF(__pyx_slice__5);
25650 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 402, __pyx_L1_error);
25651 58 : __Pyx_GIVEREF(__pyx_t_17);
25652 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17)) __PYX_ERR(0, 402, __pyx_L1_error);
25653 58 : __pyx_t_17 = 0;
25654 58 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_2, __pyx_t_19) < 0))) __PYX_ERR(0, 402, __pyx_L1_error)
25655 58 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25656 116 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25657 : }
25658 :
25659 : /* "scipy/linalg/_decomp_interpolative.pyx":404
25660 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
25661 : *
25662 : * t = p.T.copy() # <<<<<<<<<<<<<<
25663 : * inds2, tau2 = iddr_qrpiv(t, krank)
25664 : * r2 = np.triu(t[:krank, :])
25665 : */
25666 3 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
25667 3 : __Pyx_GOTREF(__pyx_t_2);
25668 3 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 404, __pyx_L1_error)
25669 3 : __Pyx_GOTREF(__pyx_t_17);
25670 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25671 3 : __pyx_t_2 = NULL;
25672 3 : __pyx_t_20 = 0;
25673 : #if CYTHON_UNPACK_METHODS
25674 3 : if (likely(PyMethod_Check(__pyx_t_17))) {
25675 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_17);
25676 0 : if (likely(__pyx_t_2)) {
25677 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
25678 0 : __Pyx_INCREF(__pyx_t_2);
25679 0 : __Pyx_INCREF(function);
25680 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
25681 : __pyx_t_20 = 1;
25682 : }
25683 : }
25684 : #endif
25685 : {
25686 3 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
25687 3 : __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 0+__pyx_t_20);
25688 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25689 3 : if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 404, __pyx_L1_error)
25690 3 : __Pyx_GOTREF(__pyx_t_19);
25691 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25692 : }
25693 3 : __pyx_v_t = __pyx_t_19;
25694 3 : __pyx_t_19 = 0;
25695 :
25696 : /* "scipy/linalg/_decomp_interpolative.pyx":405
25697 : *
25698 : * t = p.T.copy()
25699 : * inds2, tau2 = iddr_qrpiv(t, krank) # <<<<<<<<<<<<<<
25700 : * r2 = np.triu(t[:krank, :])
25701 : * for ci in range(krank-1, -1, -1):
25702 : */
25703 3 : __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 405, __pyx_L1_error)
25704 3 : __Pyx_GOTREF(__pyx_t_17);
25705 3 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
25706 3 : __Pyx_GOTREF(__pyx_t_2);
25707 3 : __pyx_t_18 = NULL;
25708 3 : __pyx_t_20 = 0;
25709 : #if CYTHON_UNPACK_METHODS
25710 3 : if (unlikely(PyMethod_Check(__pyx_t_17))) {
25711 0 : __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
25712 0 : if (likely(__pyx_t_18)) {
25713 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
25714 0 : __Pyx_INCREF(__pyx_t_18);
25715 0 : __Pyx_INCREF(function);
25716 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
25717 : __pyx_t_20 = 1;
25718 : }
25719 : }
25720 : #endif
25721 : {
25722 3 : PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_v_t, __pyx_t_2};
25723 3 : __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 2+__pyx_t_20);
25724 3 : __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
25725 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25726 3 : if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 405, __pyx_L1_error)
25727 3 : __Pyx_GOTREF(__pyx_t_19);
25728 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25729 : }
25730 3 : if ((likely(PyTuple_CheckExact(__pyx_t_19))) || (PyList_CheckExact(__pyx_t_19))) {
25731 3 : PyObject* sequence = __pyx_t_19;
25732 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
25733 3 : if (unlikely(size != 2)) {
25734 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
25735 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
25736 0 : __PYX_ERR(0, 405, __pyx_L1_error)
25737 : }
25738 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25739 3 : if (likely(PyTuple_CheckExact(sequence))) {
25740 3 : __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
25741 3 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
25742 : } else {
25743 0 : __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
25744 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
25745 : }
25746 3 : __Pyx_INCREF(__pyx_t_17);
25747 3 : __Pyx_INCREF(__pyx_t_2);
25748 : #else
25749 : __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 405, __pyx_L1_error)
25750 : __Pyx_GOTREF(__pyx_t_17);
25751 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
25752 : __Pyx_GOTREF(__pyx_t_2);
25753 : #endif
25754 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25755 : } else {
25756 0 : Py_ssize_t index = -1;
25757 0 : __pyx_t_18 = PyObject_GetIter(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 405, __pyx_L1_error)
25758 0 : __Pyx_GOTREF(__pyx_t_18);
25759 0 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25760 0 : __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_18);
25761 0 : index = 0; __pyx_t_17 = __pyx_t_21(__pyx_t_18); if (unlikely(!__pyx_t_17)) goto __pyx_L9_unpacking_failed;
25762 0 : __Pyx_GOTREF(__pyx_t_17);
25763 0 : index = 1; __pyx_t_2 = __pyx_t_21(__pyx_t_18); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
25764 0 : __Pyx_GOTREF(__pyx_t_2);
25765 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_18), 2) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
25766 0 : __pyx_t_21 = NULL;
25767 0 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25768 0 : goto __pyx_L10_unpacking_done;
25769 0 : __pyx_L9_unpacking_failed:;
25770 0 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25771 0 : __pyx_t_21 = NULL;
25772 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
25773 0 : __PYX_ERR(0, 405, __pyx_L1_error)
25774 0 : __pyx_L10_unpacking_done:;
25775 : }
25776 3 : if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 405, __pyx_L1_error)
25777 3 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 405, __pyx_L1_error)
25778 3 : __pyx_t_24 = ((PyArrayObject *)__pyx_t_17);
25779 : {
25780 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25781 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
25782 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
25783 3 : if (unlikely(__pyx_t_4 < 0)) {
25784 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
25785 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
25786 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
25787 : __Pyx_RaiseBufferFallbackError();
25788 : } else {
25789 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
25790 : }
25791 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
25792 : }
25793 3 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
25794 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 405, __pyx_L1_error)
25795 : }
25796 3 : __pyx_t_24 = 0;
25797 3 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_17);
25798 3 : __pyx_t_17 = 0;
25799 3 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_2);
25800 : {
25801 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
25802 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
25803 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
25804 3 : if (unlikely(__pyx_t_4 < 0)) {
25805 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
25806 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
25807 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
25808 : __Pyx_RaiseBufferFallbackError();
25809 : } else {
25810 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
25811 : }
25812 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
25813 : }
25814 3 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
25815 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 405, __pyx_L1_error)
25816 : }
25817 3 : __pyx_t_25 = 0;
25818 3 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_2);
25819 3 : __pyx_t_2 = 0;
25820 :
25821 : /* "scipy/linalg/_decomp_interpolative.pyx":406
25822 : * t = p.T.copy()
25823 : * inds2, tau2 = iddr_qrpiv(t, krank)
25824 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
25825 : * for ci in range(krank-1, -1, -1):
25826 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
25827 : */
25828 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
25829 3 : __Pyx_GOTREF(__pyx_t_2);
25830 3 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_triu); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 406, __pyx_L1_error)
25831 3 : __Pyx_GOTREF(__pyx_t_17);
25832 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25833 3 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
25834 3 : __Pyx_GOTREF(__pyx_t_2);
25835 3 : __pyx_t_18 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 406, __pyx_L1_error)
25836 3 : __Pyx_GOTREF(__pyx_t_18);
25837 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25838 3 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
25839 3 : __Pyx_GOTREF(__pyx_t_2);
25840 3 : __Pyx_GIVEREF(__pyx_t_18);
25841 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18)) __PYX_ERR(0, 406, __pyx_L1_error);
25842 3 : __Pyx_INCREF(__pyx_slice__5);
25843 3 : __Pyx_GIVEREF(__pyx_slice__5);
25844 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 406, __pyx_L1_error);
25845 3 : __pyx_t_18 = 0;
25846 3 : __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 406, __pyx_L1_error)
25847 3 : __Pyx_GOTREF(__pyx_t_18);
25848 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25849 3 : __pyx_t_2 = NULL;
25850 3 : __pyx_t_20 = 0;
25851 : #if CYTHON_UNPACK_METHODS
25852 3 : if (unlikely(PyMethod_Check(__pyx_t_17))) {
25853 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_17);
25854 0 : if (likely(__pyx_t_2)) {
25855 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
25856 0 : __Pyx_INCREF(__pyx_t_2);
25857 0 : __Pyx_INCREF(function);
25858 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
25859 : __pyx_t_20 = 1;
25860 : }
25861 : }
25862 : #endif
25863 : {
25864 3 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_18};
25865 3 : __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 1+__pyx_t_20);
25866 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25867 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25868 3 : if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 406, __pyx_L1_error)
25869 3 : __Pyx_GOTREF(__pyx_t_19);
25870 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25871 : }
25872 3 : __pyx_v_r2 = __pyx_t_19;
25873 3 : __pyx_t_19 = 0;
25874 :
25875 : /* "scipy/linalg/_decomp_interpolative.pyx":407
25876 : * inds2, tau2 = iddr_qrpiv(t, krank)
25877 : * r2 = np.triu(t[:krank, :])
25878 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
25879 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
25880 : *
25881 : */
25882 61 : for (__pyx_t_4 = (__pyx_v_krank - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
25883 58 : __pyx_v_ci = __pyx_t_4;
25884 :
25885 : /* "scipy/linalg/_decomp_interpolative.pyx":408
25886 : * r2 = np.triu(t[:krank, :])
25887 : * for ci in range(krank-1, -1, -1):
25888 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
25889 : *
25890 : * r3 = r @ r2.T
25891 : */
25892 58 : __pyx_t_14 = __pyx_v_ci;
25893 58 : __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
25894 58 : __Pyx_GOTREF(__pyx_t_19);
25895 58 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 408, __pyx_L1_error)
25896 58 : __Pyx_GOTREF(__pyx_t_17);
25897 58 : __pyx_t_18 = PyList_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 408, __pyx_L1_error)
25898 58 : __Pyx_GOTREF(__pyx_t_18);
25899 58 : __Pyx_GIVEREF(__pyx_t_19);
25900 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error);
25901 58 : __Pyx_GIVEREF(__pyx_t_17);
25902 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 1, __pyx_t_17)) __PYX_ERR(0, 408, __pyx_L1_error);
25903 58 : __pyx_t_19 = 0;
25904 58 : __pyx_t_17 = 0;
25905 58 : __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 408, __pyx_L1_error)
25906 58 : __Pyx_GOTREF(__pyx_t_17);
25907 58 : __Pyx_INCREF(__pyx_slice__5);
25908 58 : __Pyx_GIVEREF(__pyx_slice__5);
25909 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_slice__5)) __PYX_ERR(0, 408, __pyx_L1_error);
25910 58 : __Pyx_GIVEREF(__pyx_t_18);
25911 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18)) __PYX_ERR(0, 408, __pyx_L1_error);
25912 58 : __pyx_t_18 = 0;
25913 58 : __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 408, __pyx_L1_error)
25914 58 : __Pyx_GOTREF(__pyx_t_18);
25915 58 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25916 58 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 408, __pyx_L1_error)
25917 58 : __Pyx_GOTREF(__pyx_t_17);
25918 58 : __pyx_t_14 = __pyx_v_ci;
25919 58 : __pyx_t_19 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
25920 58 : __Pyx_GOTREF(__pyx_t_19);
25921 58 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
25922 58 : __Pyx_GOTREF(__pyx_t_2);
25923 58 : __Pyx_GIVEREF(__pyx_t_17);
25924 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_17)) __PYX_ERR(0, 408, __pyx_L1_error);
25925 58 : __Pyx_GIVEREF(__pyx_t_19);
25926 58 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error);
25927 58 : __pyx_t_17 = 0;
25928 58 : __pyx_t_19 = 0;
25929 58 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 408, __pyx_L1_error)
25930 58 : __Pyx_GOTREF(__pyx_t_19);
25931 58 : __Pyx_INCREF(__pyx_slice__5);
25932 58 : __Pyx_GIVEREF(__pyx_slice__5);
25933 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__5)) __PYX_ERR(0, 408, __pyx_L1_error);
25934 58 : __Pyx_GIVEREF(__pyx_t_2);
25935 58 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error);
25936 58 : __pyx_t_2 = 0;
25937 58 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_19, __pyx_t_18) < 0))) __PYX_ERR(0, 408, __pyx_L1_error)
25938 58 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25939 116 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25940 : }
25941 :
25942 : /* "scipy/linalg/_decomp_interpolative.pyx":410
25943 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
25944 : *
25945 : * r3 = r @ r2.T # <<<<<<<<<<<<<<
25946 : * UU[:krank, :krank], S, V = la.svd(r3,
25947 : * full_matrices=False,
25948 : */
25949 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 410, __pyx_L1_error)
25950 3 : __Pyx_GOTREF(__pyx_t_18);
25951 3 : __pyx_t_19 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 410, __pyx_L1_error)
25952 3 : __Pyx_GOTREF(__pyx_t_19);
25953 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25954 3 : __pyx_v_r3 = __pyx_t_19;
25955 3 : __pyx_t_19 = 0;
25956 :
25957 : /* "scipy/linalg/_decomp_interpolative.pyx":411
25958 : *
25959 : * r3 = r @ r2.T
25960 : * UU[:krank, :krank], S, V = la.svd(r3, # <<<<<<<<<<<<<<
25961 : * full_matrices=False,
25962 : * check_finite=False)
25963 : */
25964 3 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_la); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 411, __pyx_L1_error)
25965 3 : __Pyx_GOTREF(__pyx_t_19);
25966 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_svd); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 411, __pyx_L1_error)
25967 3 : __Pyx_GOTREF(__pyx_t_18);
25968 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25969 3 : __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 411, __pyx_L1_error)
25970 3 : __Pyx_GOTREF(__pyx_t_19);
25971 3 : __Pyx_INCREF(__pyx_v_r3);
25972 3 : __Pyx_GIVEREF(__pyx_v_r3);
25973 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_v_r3)) __PYX_ERR(0, 411, __pyx_L1_error);
25974 :
25975 : /* "scipy/linalg/_decomp_interpolative.pyx":412
25976 : * r3 = r @ r2.T
25977 : * UU[:krank, :krank], S, V = la.svd(r3,
25978 : * full_matrices=False, # <<<<<<<<<<<<<<
25979 : * check_finite=False)
25980 : *
25981 : */
25982 3 : __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
25983 3 : __Pyx_GOTREF(__pyx_t_2);
25984 3 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
25985 :
25986 : /* "scipy/linalg/_decomp_interpolative.pyx":413
25987 : * UU[:krank, :krank], S, V = la.svd(r3,
25988 : * full_matrices=False,
25989 : * check_finite=False) # <<<<<<<<<<<<<<
25990 : *
25991 : * # Apply Q of col to U from the left, use cols as scratch
25992 : */
25993 3 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_check_finite, Py_False) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
25994 :
25995 : /* "scipy/linalg/_decomp_interpolative.pyx":411
25996 : *
25997 : * r3 = r @ r2.T
25998 : * UU[:krank, :krank], S, V = la.svd(r3, # <<<<<<<<<<<<<<
25999 : * full_matrices=False,
26000 : * check_finite=False)
26001 : */
26002 3 : __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_19, __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 411, __pyx_L1_error)
26003 3 : __Pyx_GOTREF(__pyx_t_17);
26004 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26005 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26006 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26007 3 : if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) {
26008 3 : PyObject* sequence = __pyx_t_17;
26009 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
26010 3 : if (unlikely(size != 3)) {
26011 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
26012 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
26013 0 : __PYX_ERR(0, 411, __pyx_L1_error)
26014 : }
26015 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26016 3 : if (likely(PyTuple_CheckExact(sequence))) {
26017 3 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
26018 3 : __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1);
26019 3 : __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
26020 : } else {
26021 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
26022 0 : __pyx_t_19 = PyList_GET_ITEM(sequence, 1);
26023 0 : __pyx_t_18 = PyList_GET_ITEM(sequence, 2);
26024 : }
26025 3 : __Pyx_INCREF(__pyx_t_2);
26026 3 : __Pyx_INCREF(__pyx_t_19);
26027 3 : __Pyx_INCREF(__pyx_t_18);
26028 : #else
26029 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
26030 : __Pyx_GOTREF(__pyx_t_2);
26031 : __pyx_t_19 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 411, __pyx_L1_error)
26032 : __Pyx_GOTREF(__pyx_t_19);
26033 : __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 411, __pyx_L1_error)
26034 : __Pyx_GOTREF(__pyx_t_18);
26035 : #endif
26036 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
26037 : } else {
26038 0 : Py_ssize_t index = -1;
26039 0 : __pyx_t_26 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 411, __pyx_L1_error)
26040 0 : __Pyx_GOTREF(__pyx_t_26);
26041 0 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
26042 0 : __pyx_t_21 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_26);
26043 0 : index = 0; __pyx_t_2 = __pyx_t_21(__pyx_t_26); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
26044 0 : __Pyx_GOTREF(__pyx_t_2);
26045 0 : index = 1; __pyx_t_19 = __pyx_t_21(__pyx_t_26); if (unlikely(!__pyx_t_19)) goto __pyx_L13_unpacking_failed;
26046 0 : __Pyx_GOTREF(__pyx_t_19);
26047 0 : index = 2; __pyx_t_18 = __pyx_t_21(__pyx_t_26); if (unlikely(!__pyx_t_18)) goto __pyx_L13_unpacking_failed;
26048 0 : __Pyx_GOTREF(__pyx_t_18);
26049 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_26), 3) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
26050 0 : __pyx_t_21 = NULL;
26051 0 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
26052 0 : goto __pyx_L14_unpacking_done;
26053 0 : __pyx_L13_unpacking_failed:;
26054 0 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
26055 0 : __pyx_t_21 = NULL;
26056 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
26057 0 : __PYX_ERR(0, 411, __pyx_L1_error)
26058 0 : __pyx_L14_unpacking_done:;
26059 : }
26060 3 : if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 411, __pyx_L1_error)
26061 3 : if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 411, __pyx_L1_error)
26062 3 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 411, __pyx_L1_error)
26063 3 : __Pyx_GOTREF(__pyx_t_26);
26064 3 : __pyx_t_27 = PySlice_New(Py_None, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 411, __pyx_L1_error)
26065 3 : __Pyx_GOTREF(__pyx_t_27);
26066 3 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
26067 3 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 411, __pyx_L1_error)
26068 3 : __Pyx_GOTREF(__pyx_t_26);
26069 3 : __pyx_t_28 = PySlice_New(Py_None, __pyx_t_26, Py_None); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 411, __pyx_L1_error)
26070 3 : __Pyx_GOTREF(__pyx_t_28);
26071 3 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
26072 3 : __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 411, __pyx_L1_error)
26073 3 : __Pyx_GOTREF(__pyx_t_26);
26074 3 : __Pyx_GIVEREF(__pyx_t_27);
26075 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_27)) __PYX_ERR(0, 411, __pyx_L1_error);
26076 3 : __Pyx_GIVEREF(__pyx_t_28);
26077 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_28)) __PYX_ERR(0, 411, __pyx_L1_error);
26078 3 : __pyx_t_27 = 0;
26079 3 : __pyx_t_28 = 0;
26080 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_26, __pyx_t_2) < 0))) __PYX_ERR(0, 411, __pyx_L1_error)
26081 3 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
26082 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26083 3 : __pyx_t_29 = ((PyArrayObject *)__pyx_t_19);
26084 : {
26085 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
26086 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
26087 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
26088 3 : if (unlikely(__pyx_t_4 < 0)) {
26089 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
26090 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
26091 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
26092 : __Pyx_RaiseBufferFallbackError();
26093 : } else {
26094 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
26095 : }
26096 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
26097 : }
26098 3 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
26099 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 411, __pyx_L1_error)
26100 : }
26101 3 : __pyx_t_29 = 0;
26102 3 : __pyx_v_S = ((PyArrayObject *)__pyx_t_19);
26103 3 : __pyx_t_19 = 0;
26104 3 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_18);
26105 : {
26106 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
26107 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
26108 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
26109 3 : if (unlikely(__pyx_t_4 < 0)) {
26110 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
26111 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
26112 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
26113 : __Pyx_RaiseBufferFallbackError();
26114 : } else {
26115 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
26116 : }
26117 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
26118 : }
26119 3 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
26120 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 411, __pyx_L1_error)
26121 : }
26122 3 : __pyx_t_30 = 0;
26123 3 : __pyx_v_V = ((PyArrayObject *)__pyx_t_18);
26124 3 : __pyx_t_18 = 0;
26125 :
26126 : /* "scipy/linalg/_decomp_interpolative.pyx":416
26127 : *
26128 : * # Apply Q of col to U from the left, use cols as scratch
26129 : * C = cols[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
26130 : * dorm2r(<char*>'R', <char*>'T',
26131 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
26132 : */
26133 3 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 416, __pyx_L1_error)
26134 3 : __Pyx_GOTREF(__pyx_t_17);
26135 3 : __pyx_t_18 = PySlice_New(Py_None, __pyx_t_17, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 416, __pyx_L1_error)
26136 3 : __Pyx_GOTREF(__pyx_t_18);
26137 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
26138 3 : __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 416, __pyx_L1_error)
26139 3 : __Pyx_GOTREF(__pyx_t_17);
26140 3 : __Pyx_INCREF(__pyx_slice__5);
26141 3 : __Pyx_GIVEREF(__pyx_slice__5);
26142 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_slice__5)) __PYX_ERR(0, 416, __pyx_L1_error);
26143 3 : __Pyx_GIVEREF(__pyx_t_18);
26144 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18)) __PYX_ERR(0, 416, __pyx_L1_error);
26145 3 : __pyx_t_18 = 0;
26146 3 : __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_cols), __pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 416, __pyx_L1_error)
26147 3 : __Pyx_GOTREF(__pyx_t_18);
26148 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
26149 3 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_copy); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 416, __pyx_L1_error)
26150 3 : __Pyx_GOTREF(__pyx_t_17);
26151 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26152 3 : __pyx_t_18 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 416, __pyx_L1_error)
26153 3 : __Pyx_GOTREF(__pyx_t_18);
26154 3 : if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
26155 3 : __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_empty_tuple, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 416, __pyx_L1_error)
26156 3 : __Pyx_GOTREF(__pyx_t_19);
26157 3 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
26158 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26159 3 : if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 416, __pyx_L1_error)
26160 3 : __pyx_t_31 = ((PyArrayObject *)__pyx_t_19);
26161 : {
26162 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
26163 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
26164 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
26165 3 : if (unlikely(__pyx_t_4 < 0)) {
26166 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
26167 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
26168 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
26169 : __Pyx_RaiseBufferFallbackError();
26170 : } else {
26171 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
26172 : }
26173 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
26174 : }
26175 3 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
26176 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 416, __pyx_L1_error)
26177 : }
26178 3 : __pyx_t_31 = 0;
26179 3 : __pyx_v_C = ((PyArrayObject *)__pyx_t_19);
26180 3 : __pyx_t_19 = 0;
26181 :
26182 : /* "scipy/linalg/_decomp_interpolative.pyx":418
26183 : * C = cols[:, :krank].copy(order='F')
26184 : * dorm2r(<char*>'R', <char*>'T',
26185 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
26186 : * &UU[0,0], &krank, &cols[0, 0], &info)
26187 : *
26188 : */
26189 3 : __pyx_t_14 = 0;
26190 3 : __pyx_t_15 = 0;
26191 3 : __pyx_t_32 = 0;
26192 :
26193 : /* "scipy/linalg/_decomp_interpolative.pyx":419
26194 : * dorm2r(<char*>'R', <char*>'T',
26195 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
26196 : * &UU[0,0], &krank, &cols[0, 0], &info) # <<<<<<<<<<<<<<
26197 : *
26198 : * VV[:krank, :krank] = V[:, :].T
26199 : */
26200 3 : __pyx_t_33 = 0;
26201 3 : __pyx_t_34 = 0;
26202 3 : __pyx_t_35 = 0;
26203 3 : __pyx_t_36 = 0;
26204 :
26205 : /* "scipy/linalg/_decomp_interpolative.pyx":417
26206 : * # Apply Q of col to U from the left, use cols as scratch
26207 : * C = cols[:, :krank].copy(order='F')
26208 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
26209 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
26210 : * &UU[0,0], &krank, &cols[0, 0], &info)
26211 : */
26212 3 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cols.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_cols.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_cols.diminfo[1].strides))), (&__pyx_v_info));
26213 :
26214 : /* "scipy/linalg/_decomp_interpolative.pyx":421
26215 : * &UU[0,0], &krank, &cols[0, 0], &info)
26216 : *
26217 : * VV[:krank, :krank] = V[:, :].T # <<<<<<<<<<<<<<
26218 : * # Apply Q of t to V from the left
26219 : * C = t[:, :krank].copy(order='F')
26220 : */
26221 3 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 421, __pyx_L1_error)
26222 3 : __Pyx_GOTREF(__pyx_t_19);
26223 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_T); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 421, __pyx_L1_error)
26224 3 : __Pyx_GOTREF(__pyx_t_18);
26225 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26226 3 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 421, __pyx_L1_error)
26227 3 : __Pyx_GOTREF(__pyx_t_19);
26228 3 : __pyx_t_17 = PySlice_New(Py_None, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 421, __pyx_L1_error)
26229 3 : __Pyx_GOTREF(__pyx_t_17);
26230 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26231 3 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 421, __pyx_L1_error)
26232 3 : __Pyx_GOTREF(__pyx_t_19);
26233 3 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
26234 3 : __Pyx_GOTREF(__pyx_t_2);
26235 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26236 3 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 421, __pyx_L1_error)
26237 3 : __Pyx_GOTREF(__pyx_t_19);
26238 3 : __Pyx_GIVEREF(__pyx_t_17);
26239 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17)) __PYX_ERR(0, 421, __pyx_L1_error);
26240 3 : __Pyx_GIVEREF(__pyx_t_2);
26241 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error);
26242 3 : __pyx_t_17 = 0;
26243 3 : __pyx_t_2 = 0;
26244 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_19, __pyx_t_18) < 0))) __PYX_ERR(0, 421, __pyx_L1_error)
26245 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26246 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26247 :
26248 : /* "scipy/linalg/_decomp_interpolative.pyx":423
26249 : * VV[:krank, :krank] = V[:, :].T
26250 : * # Apply Q of t to V from the left
26251 : * C = t[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
26252 : * dorm2r(<char*>'R', <char*>'T',
26253 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
26254 : */
26255 3 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 423, __pyx_L1_error)
26256 3 : __Pyx_GOTREF(__pyx_t_18);
26257 3 : __pyx_t_19 = PySlice_New(Py_None, __pyx_t_18, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 423, __pyx_L1_error)
26258 3 : __Pyx_GOTREF(__pyx_t_19);
26259 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26260 3 : __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 423, __pyx_L1_error)
26261 3 : __Pyx_GOTREF(__pyx_t_18);
26262 3 : __Pyx_INCREF(__pyx_slice__5);
26263 3 : __Pyx_GIVEREF(__pyx_slice__5);
26264 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_slice__5)) __PYX_ERR(0, 423, __pyx_L1_error);
26265 3 : __Pyx_GIVEREF(__pyx_t_19);
26266 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_19)) __PYX_ERR(0, 423, __pyx_L1_error);
26267 3 : __pyx_t_19 = 0;
26268 3 : __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 423, __pyx_L1_error)
26269 3 : __Pyx_GOTREF(__pyx_t_19);
26270 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26271 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_copy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 423, __pyx_L1_error)
26272 3 : __Pyx_GOTREF(__pyx_t_18);
26273 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26274 3 : __pyx_t_19 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 423, __pyx_L1_error)
26275 3 : __Pyx_GOTREF(__pyx_t_19);
26276 3 : if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
26277 3 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, __pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
26278 3 : __Pyx_GOTREF(__pyx_t_2);
26279 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
26280 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
26281 3 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 423, __pyx_L1_error)
26282 3 : __pyx_t_31 = ((PyArrayObject *)__pyx_t_2);
26283 : {
26284 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
26285 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
26286 3 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
26287 3 : if (unlikely(__pyx_t_4 < 0)) {
26288 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
26289 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
26290 0 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
26291 0 : __Pyx_RaiseBufferFallbackError();
26292 : } else {
26293 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
26294 : }
26295 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
26296 : }
26297 3 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
26298 3 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 423, __pyx_L1_error)
26299 : }
26300 3 : __pyx_t_31 = 0;
26301 3 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_2));
26302 3 : __pyx_t_2 = 0;
26303 :
26304 : /* "scipy/linalg/_decomp_interpolative.pyx":425
26305 : * C = t[:, :krank].copy(order='F')
26306 : * dorm2r(<char*>'R', <char*>'T',
26307 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
26308 : * &VV[0, 0], &krank, &cols[0, 0], &info)
26309 : *
26310 : */
26311 3 : __pyx_t_36 = 0;
26312 3 : __pyx_t_35 = 0;
26313 3 : __pyx_t_34 = 0;
26314 :
26315 : /* "scipy/linalg/_decomp_interpolative.pyx":426
26316 : * dorm2r(<char*>'R', <char*>'T',
26317 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
26318 : * &VV[0, 0], &krank, &cols[0, 0], &info) # <<<<<<<<<<<<<<
26319 : *
26320 : * return UU, S, VV
26321 : */
26322 3 : __pyx_t_33 = 0;
26323 3 : __pyx_t_32 = 0;
26324 3 : __pyx_t_15 = 0;
26325 3 : __pyx_t_14 = 0;
26326 :
26327 : /* "scipy/linalg/_decomp_interpolative.pyx":424
26328 : * # Apply Q of t to V from the left
26329 : * C = t[:, :krank].copy(order='F')
26330 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
26331 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
26332 : * &VV[0, 0], &krank, &cols[0, 0], &info)
26333 : */
26334 3 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_cols.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_cols.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_cols.diminfo[1].strides))), (&__pyx_v_info));
26335 :
26336 : /* "scipy/linalg/_decomp_interpolative.pyx":428
26337 : * &VV[0, 0], &krank, &cols[0, 0], &info)
26338 : *
26339 : * return UU, S, VV # <<<<<<<<<<<<<<
26340 : *
26341 : *
26342 : */
26343 3 : __Pyx_XDECREF(__pyx_r);
26344 3 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
26345 3 : __Pyx_GOTREF(__pyx_t_2);
26346 3 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
26347 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
26348 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 428, __pyx_L1_error);
26349 3 : __Pyx_INCREF((PyObject *)__pyx_v_S);
26350 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
26351 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 428, __pyx_L1_error);
26352 3 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
26353 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
26354 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 428, __pyx_L1_error);
26355 3 : __pyx_r = __pyx_t_2;
26356 3 : __pyx_t_2 = 0;
26357 3 : goto __pyx_L0;
26358 :
26359 : /* "scipy/linalg/_decomp_interpolative.pyx":370
26360 : *
26361 : *
26362 : * def idd_id2svd( # <<<<<<<<<<<<<<
26363 : * cnp.ndarray[cnp.float64_t, mode='c', ndim=2] cols,
26364 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
26365 : */
26366 :
26367 : /* function exit code */
26368 0 : __pyx_L1_error:;
26369 0 : __Pyx_XDECREF(__pyx_t_2);
26370 0 : __Pyx_XDECREF(__pyx_t_17);
26371 0 : __Pyx_XDECREF(__pyx_t_18);
26372 0 : __Pyx_XDECREF(__pyx_t_19);
26373 0 : __Pyx_XDECREF(__pyx_t_26);
26374 0 : __Pyx_XDECREF(__pyx_t_27);
26375 0 : __Pyx_XDECREF(__pyx_t_28);
26376 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
26377 0 : __Pyx_PyThreadState_declare
26378 0 : __Pyx_PyThreadState_assign
26379 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
26380 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
26381 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
26382 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
26383 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
26384 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
26385 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cols.rcbuffer->pybuffer);
26386 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
26387 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
26388 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
26389 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
26390 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
26391 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
26392 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
26393 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
26394 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_id2svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
26395 0 : __pyx_r = NULL;
26396 0 : goto __pyx_L2;
26397 3 : __pyx_L0:;
26398 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
26399 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
26400 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
26401 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
26402 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
26403 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cols.rcbuffer->pybuffer);
26404 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
26405 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
26406 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
26407 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
26408 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
26409 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
26410 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
26411 3 : __pyx_L2:;
26412 3 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
26413 3 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
26414 3 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
26415 3 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
26416 3 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
26417 3 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
26418 3 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
26419 3 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
26420 3 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
26421 3 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
26422 3 : __Pyx_XDECREF(__pyx_v_r);
26423 3 : __Pyx_XDECREF(__pyx_v_t);
26424 3 : __Pyx_XDECREF(__pyx_v_r2);
26425 3 : __Pyx_XDECREF(__pyx_v_r3);
26426 3 : __Pyx_XGIVEREF(__pyx_r);
26427 3 : __Pyx_RefNannyFinishContext();
26428 3 : return __pyx_r;
26429 : }
26430 :
26431 : /* "scipy/linalg/_decomp_interpolative.pyx":431
26432 : *
26433 : *
26434 : * cdef inline int idd_ldiv(int l, int n) noexcept nogil: # <<<<<<<<<<<<<<
26435 : * cdef int m = l
26436 : * while (n % m != 0):
26437 : */
26438 :
26439 0 : static CYTHON_INLINE int __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_ldiv(int __pyx_v_l, int __pyx_v_n) {
26440 0 : int __pyx_v_m;
26441 0 : int __pyx_r;
26442 0 : int __pyx_t_1;
26443 :
26444 : /* "scipy/linalg/_decomp_interpolative.pyx":432
26445 : *
26446 : * cdef inline int idd_ldiv(int l, int n) noexcept nogil:
26447 : * cdef int m = l # <<<<<<<<<<<<<<
26448 : * while (n % m != 0):
26449 : * m -= 1
26450 : */
26451 0 : __pyx_v_m = __pyx_v_l;
26452 :
26453 : /* "scipy/linalg/_decomp_interpolative.pyx":433
26454 : * cdef inline int idd_ldiv(int l, int n) noexcept nogil:
26455 : * cdef int m = l
26456 : * while (n % m != 0): # <<<<<<<<<<<<<<
26457 : * m -= 1
26458 : * return m
26459 : */
26460 0 : while (1) {
26461 0 : __pyx_t_1 = ((__pyx_v_n % __pyx_v_m) != 0);
26462 0 : if (!__pyx_t_1) break;
26463 :
26464 : /* "scipy/linalg/_decomp_interpolative.pyx":434
26465 : * cdef int m = l
26466 : * while (n % m != 0):
26467 : * m -= 1 # <<<<<<<<<<<<<<
26468 : * return m
26469 : *
26470 : */
26471 0 : __pyx_v_m = (__pyx_v_m - 1);
26472 : }
26473 :
26474 : /* "scipy/linalg/_decomp_interpolative.pyx":435
26475 : * while (n % m != 0):
26476 : * m -= 1
26477 : * return m # <<<<<<<<<<<<<<
26478 : *
26479 : *
26480 : */
26481 0 : __pyx_r = __pyx_v_m;
26482 0 : goto __pyx_L0;
26483 :
26484 : /* "scipy/linalg/_decomp_interpolative.pyx":431
26485 : *
26486 : *
26487 : * cdef inline int idd_ldiv(int l, int n) noexcept nogil: # <<<<<<<<<<<<<<
26488 : * cdef int m = l
26489 : * while (n % m != 0):
26490 : */
26491 :
26492 : /* function exit code */
26493 0 : __pyx_L0:;
26494 0 : return __pyx_r;
26495 : }
26496 :
26497 : /* "scipy/linalg/_decomp_interpolative.pyx":438
26498 : *
26499 : *
26500 : * cdef int idd_poweroftwo(int m) noexcept nogil: # <<<<<<<<<<<<<<
26501 : * """
26502 : * Find the integer solution to l = floor(log2(m))
26503 : */
26504 :
26505 11 : static int __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(int __pyx_v_m) {
26506 11 : int __pyx_v_n;
26507 11 : int __pyx_r;
26508 11 : int __pyx_t_1;
26509 :
26510 : /* "scipy/linalg/_decomp_interpolative.pyx":442
26511 : * Find the integer solution to l = floor(log2(m))
26512 : * """
26513 : * cdef int n = 1 # <<<<<<<<<<<<<<
26514 : * while (n < m):
26515 : * n <<= 1 # Times 2
26516 : */
26517 6 : __pyx_v_n = 1;
26518 :
26519 : /* "scipy/linalg/_decomp_interpolative.pyx":443
26520 : * """
26521 : * cdef int n = 1
26522 : * while (n < m): # <<<<<<<<<<<<<<
26523 : * n <<= 1 # Times 2
26524 : * return n >> 1 # Divide by 2
26525 : */
26526 147 : while (1) {
26527 79 : __pyx_t_1 = (__pyx_v_n < __pyx_v_m);
26528 79 : if (!__pyx_t_1) break;
26529 :
26530 : /* "scipy/linalg/_decomp_interpolative.pyx":444
26531 : * cdef int n = 1
26532 : * while (n < m):
26533 : * n <<= 1 # Times 2 # <<<<<<<<<<<<<<
26534 : * return n >> 1 # Divide by 2
26535 : *
26536 : */
26537 68 : __pyx_v_n = (__pyx_v_n << 1);
26538 : }
26539 :
26540 : /* "scipy/linalg/_decomp_interpolative.pyx":445
26541 : * while (n < m):
26542 : * n <<= 1 # Times 2
26543 : * return n >> 1 # Divide by 2 # <<<<<<<<<<<<<<
26544 : *
26545 : *
26546 : */
26547 11 : __pyx_r = (__pyx_v_n >> 1);
26548 11 : goto __pyx_L0;
26549 :
26550 : /* "scipy/linalg/_decomp_interpolative.pyx":438
26551 : *
26552 : *
26553 : * cdef int idd_poweroftwo(int m) noexcept nogil: # <<<<<<<<<<<<<<
26554 : * """
26555 : * Find the integer solution to l = floor(log2(m))
26556 : */
26557 :
26558 : /* function exit code */
26559 11 : __pyx_L0:;
26560 6 : return __pyx_r;
26561 : }
26562 :
26563 : /* "scipy/linalg/_decomp_interpolative.pyx":448
26564 : *
26565 : *
26566 : * def idd_reconid(B, idx, proj): # <<<<<<<<<<<<<<
26567 : * cdef int m = B.shape[0], krank = B.shape[1]
26568 : * cdef int n = len(idx)
26569 : */
26570 :
26571 : /* Python wrapper */
26572 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_9idd_reconid(PyObject *__pyx_self,
26573 : #if CYTHON_METH_FASTCALL
26574 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26575 : #else
26576 : PyObject *__pyx_args, PyObject *__pyx_kwds
26577 : #endif
26578 : ); /*proto*/
26579 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_9idd_reconid = {"idd_reconid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_9idd_reconid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
26580 6 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_9idd_reconid(PyObject *__pyx_self,
26581 : #if CYTHON_METH_FASTCALL
26582 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26583 : #else
26584 : PyObject *__pyx_args, PyObject *__pyx_kwds
26585 : #endif
26586 : ) {
26587 6 : PyObject *__pyx_v_B = 0;
26588 6 : PyObject *__pyx_v_idx = 0;
26589 6 : PyObject *__pyx_v_proj = 0;
26590 : #if !CYTHON_METH_FASTCALL
26591 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
26592 : #endif
26593 6 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
26594 6 : PyObject* values[3] = {0,0,0};
26595 6 : int __pyx_lineno = 0;
26596 6 : const char *__pyx_filename = NULL;
26597 6 : int __pyx_clineno = 0;
26598 6 : PyObject *__pyx_r = 0;
26599 : __Pyx_RefNannyDeclarations
26600 6 : __Pyx_RefNannySetupContext("idd_reconid (wrapper)", 0);
26601 : #if !CYTHON_METH_FASTCALL
26602 : #if CYTHON_ASSUME_SAFE_MACROS
26603 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
26604 : #else
26605 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
26606 : #endif
26607 : #endif
26608 6 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
26609 : {
26610 6 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_idx,&__pyx_n_s_proj,0};
26611 6 : if (__pyx_kwds) {
26612 0 : Py_ssize_t kw_args;
26613 0 : switch (__pyx_nargs) {
26614 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
26615 0 : CYTHON_FALLTHROUGH;
26616 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
26617 0 : CYTHON_FALLTHROUGH;
26618 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
26619 0 : CYTHON_FALLTHROUGH;
26620 0 : case 0: break;
26621 0 : default: goto __pyx_L5_argtuple_error;
26622 : }
26623 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
26624 0 : switch (__pyx_nargs) {
26625 0 : case 0:
26626 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) {
26627 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
26628 0 : kw_args--;
26629 : }
26630 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error)
26631 0 : else goto __pyx_L5_argtuple_error;
26632 0 : CYTHON_FALLTHROUGH;
26633 : case 1:
26634 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idx)) != 0)) {
26635 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
26636 0 : kw_args--;
26637 : }
26638 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error)
26639 : else {
26640 0 : __Pyx_RaiseArgtupleInvalid("idd_reconid", 1, 3, 3, 1); __PYX_ERR(0, 448, __pyx_L3_error)
26641 : }
26642 0 : CYTHON_FALLTHROUGH;
26643 : case 2:
26644 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proj)) != 0)) {
26645 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
26646 0 : kw_args--;
26647 : }
26648 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L3_error)
26649 : else {
26650 0 : __Pyx_RaiseArgtupleInvalid("idd_reconid", 1, 3, 3, 2); __PYX_ERR(0, 448, __pyx_L3_error)
26651 : }
26652 : }
26653 0 : if (unlikely(kw_args > 0)) {
26654 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
26655 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_reconid") < 0)) __PYX_ERR(0, 448, __pyx_L3_error)
26656 : }
26657 6 : } else if (unlikely(__pyx_nargs != 3)) {
26658 0 : goto __pyx_L5_argtuple_error;
26659 : } else {
26660 6 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
26661 6 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
26662 6 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
26663 : }
26664 6 : __pyx_v_B = values[0];
26665 6 : __pyx_v_idx = values[1];
26666 6 : __pyx_v_proj = values[2];
26667 : }
26668 6 : goto __pyx_L6_skip;
26669 0 : __pyx_L5_argtuple_error:;
26670 0 : __Pyx_RaiseArgtupleInvalid("idd_reconid", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 448, __pyx_L3_error)
26671 6 : __pyx_L6_skip:;
26672 6 : goto __pyx_L4_argument_unpacking_done;
26673 0 : __pyx_L3_error:;
26674 : {
26675 0 : Py_ssize_t __pyx_temp;
26676 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26677 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26678 : }
26679 : }
26680 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_reconid", __pyx_clineno, __pyx_lineno, __pyx_filename);
26681 0 : __Pyx_RefNannyFinishContext();
26682 0 : return NULL;
26683 6 : __pyx_L4_argument_unpacking_done:;
26684 6 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_8idd_reconid(__pyx_self, __pyx_v_B, __pyx_v_idx, __pyx_v_proj);
26685 :
26686 : /* function exit code */
26687 : {
26688 6 : Py_ssize_t __pyx_temp;
26689 6 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26690 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26691 : }
26692 : }
26693 : __Pyx_RefNannyFinishContext();
26694 : return __pyx_r;
26695 : }
26696 :
26697 6 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_8idd_reconid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_B, PyObject *__pyx_v_idx, PyObject *__pyx_v_proj) {
26698 6 : int __pyx_v_m;
26699 6 : int __pyx_v_krank;
26700 6 : int __pyx_v_n;
26701 6 : PyObject *__pyx_v_approx = NULL;
26702 6 : PyObject *__pyx_r = NULL;
26703 : __Pyx_RefNannyDeclarations
26704 6 : PyObject *__pyx_t_1 = NULL;
26705 6 : PyObject *__pyx_t_2 = NULL;
26706 6 : int __pyx_t_3;
26707 6 : Py_ssize_t __pyx_t_4;
26708 6 : PyObject *__pyx_t_5 = NULL;
26709 6 : PyObject *__pyx_t_6 = NULL;
26710 6 : PyObject *__pyx_t_7 = NULL;
26711 6 : int __pyx_lineno = 0;
26712 6 : const char *__pyx_filename = NULL;
26713 6 : int __pyx_clineno = 0;
26714 6 : __Pyx_RefNannySetupContext("idd_reconid", 1);
26715 :
26716 : /* "scipy/linalg/_decomp_interpolative.pyx":449
26717 : *
26718 : * def idd_reconid(B, idx, proj):
26719 : * cdef int m = B.shape[0], krank = B.shape[1] # <<<<<<<<<<<<<<
26720 : * cdef int n = len(idx)
26721 : * approx = np.zeros([m, n], dtype=np.float64)
26722 : */
26723 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
26724 6 : __Pyx_GOTREF(__pyx_t_1);
26725 6 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
26726 6 : __Pyx_GOTREF(__pyx_t_2);
26727 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26728 6 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error)
26729 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26730 6 : __pyx_v_m = __pyx_t_3;
26731 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
26732 6 : __Pyx_GOTREF(__pyx_t_2);
26733 6 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
26734 6 : __Pyx_GOTREF(__pyx_t_1);
26735 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26736 6 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error)
26737 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26738 6 : __pyx_v_krank = __pyx_t_3;
26739 :
26740 : /* "scipy/linalg/_decomp_interpolative.pyx":450
26741 : * def idd_reconid(B, idx, proj):
26742 : * cdef int m = B.shape[0], krank = B.shape[1]
26743 : * cdef int n = len(idx) # <<<<<<<<<<<<<<
26744 : * approx = np.zeros([m, n], dtype=np.float64)
26745 : *
26746 : */
26747 6 : __pyx_t_4 = PyObject_Length(__pyx_v_idx); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 450, __pyx_L1_error)
26748 6 : __pyx_v_n = __pyx_t_4;
26749 :
26750 : /* "scipy/linalg/_decomp_interpolative.pyx":451
26751 : * cdef int m = B.shape[0], krank = B.shape[1]
26752 : * cdef int n = len(idx)
26753 : * approx = np.zeros([m, n], dtype=np.float64) # <<<<<<<<<<<<<<
26754 : *
26755 : * approx[:, idx[:krank]] = B
26756 : */
26757 6 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
26758 6 : __Pyx_GOTREF(__pyx_t_1);
26759 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
26760 6 : __Pyx_GOTREF(__pyx_t_2);
26761 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26762 6 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
26763 6 : __Pyx_GOTREF(__pyx_t_1);
26764 6 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error)
26765 6 : __Pyx_GOTREF(__pyx_t_5);
26766 6 : __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
26767 6 : __Pyx_GOTREF(__pyx_t_6);
26768 6 : __Pyx_GIVEREF(__pyx_t_1);
26769 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error);
26770 6 : __Pyx_GIVEREF(__pyx_t_5);
26771 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error);
26772 6 : __pyx_t_1 = 0;
26773 6 : __pyx_t_5 = 0;
26774 6 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error)
26775 6 : __Pyx_GOTREF(__pyx_t_5);
26776 6 : __Pyx_GIVEREF(__pyx_t_6);
26777 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error);
26778 6 : __pyx_t_6 = 0;
26779 6 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
26780 6 : __Pyx_GOTREF(__pyx_t_6);
26781 6 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
26782 6 : __Pyx_GOTREF(__pyx_t_1);
26783 6 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error)
26784 6 : __Pyx_GOTREF(__pyx_t_7);
26785 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26786 6 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
26787 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26788 6 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error)
26789 6 : __Pyx_GOTREF(__pyx_t_7);
26790 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26791 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26792 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26793 6 : __pyx_v_approx = __pyx_t_7;
26794 6 : __pyx_t_7 = 0;
26795 :
26796 : /* "scipy/linalg/_decomp_interpolative.pyx":453
26797 : * approx = np.zeros([m, n], dtype=np.float64)
26798 : *
26799 : * approx[:, idx[:krank]] = B # <<<<<<<<<<<<<<
26800 : * approx[:, idx[krank:]] = B @ proj
26801 : *
26802 : */
26803 6 : __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_idx, 0, __pyx_v_krank, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 453, __pyx_L1_error)
26804 6 : __Pyx_GOTREF(__pyx_t_7);
26805 6 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 453, __pyx_L1_error)
26806 6 : __Pyx_GOTREF(__pyx_t_6);
26807 6 : __Pyx_INCREF(__pyx_slice__5);
26808 6 : __Pyx_GIVEREF(__pyx_slice__5);
26809 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__5)) __PYX_ERR(0, 453, __pyx_L1_error);
26810 6 : __Pyx_GIVEREF(__pyx_t_7);
26811 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 453, __pyx_L1_error);
26812 6 : __pyx_t_7 = 0;
26813 6 : if (unlikely((PyObject_SetItem(__pyx_v_approx, __pyx_t_6, __pyx_v_B) < 0))) __PYX_ERR(0, 453, __pyx_L1_error)
26814 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26815 :
26816 : /* "scipy/linalg/_decomp_interpolative.pyx":454
26817 : *
26818 : * approx[:, idx[:krank]] = B
26819 : * approx[:, idx[krank:]] = B @ proj # <<<<<<<<<<<<<<
26820 : *
26821 : * return approx
26822 : */
26823 6 : __pyx_t_6 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_B, __pyx_v_proj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error)
26824 6 : __Pyx_GOTREF(__pyx_t_6);
26825 6 : __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_idx, __pyx_v_krank, 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error)
26826 6 : __Pyx_GOTREF(__pyx_t_7);
26827 6 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error)
26828 6 : __Pyx_GOTREF(__pyx_t_5);
26829 6 : __Pyx_INCREF(__pyx_slice__5);
26830 6 : __Pyx_GIVEREF(__pyx_slice__5);
26831 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__5)) __PYX_ERR(0, 454, __pyx_L1_error);
26832 6 : __Pyx_GIVEREF(__pyx_t_7);
26833 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error);
26834 6 : __pyx_t_7 = 0;
26835 6 : if (unlikely((PyObject_SetItem(__pyx_v_approx, __pyx_t_5, __pyx_t_6) < 0))) __PYX_ERR(0, 454, __pyx_L1_error)
26836 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26837 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26838 :
26839 : /* "scipy/linalg/_decomp_interpolative.pyx":456
26840 : * approx[:, idx[krank:]] = B @ proj
26841 : *
26842 : * return approx # <<<<<<<<<<<<<<
26843 : *
26844 : *
26845 : */
26846 6 : __Pyx_XDECREF(__pyx_r);
26847 6 : __Pyx_INCREF(__pyx_v_approx);
26848 6 : __pyx_r = __pyx_v_approx;
26849 6 : goto __pyx_L0;
26850 :
26851 : /* "scipy/linalg/_decomp_interpolative.pyx":448
26852 : *
26853 : *
26854 : * def idd_reconid(B, idx, proj): # <<<<<<<<<<<<<<
26855 : * cdef int m = B.shape[0], krank = B.shape[1]
26856 : * cdef int n = len(idx)
26857 : */
26858 :
26859 : /* function exit code */
26860 0 : __pyx_L1_error:;
26861 0 : __Pyx_XDECREF(__pyx_t_1);
26862 0 : __Pyx_XDECREF(__pyx_t_2);
26863 0 : __Pyx_XDECREF(__pyx_t_5);
26864 0 : __Pyx_XDECREF(__pyx_t_6);
26865 0 : __Pyx_XDECREF(__pyx_t_7);
26866 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_reconid", __pyx_clineno, __pyx_lineno, __pyx_filename);
26867 0 : __pyx_r = NULL;
26868 6 : __pyx_L0:;
26869 6 : __Pyx_XDECREF(__pyx_v_approx);
26870 6 : __Pyx_XGIVEREF(__pyx_r);
26871 6 : __Pyx_RefNannyFinishContext();
26872 6 : return __pyx_r;
26873 : }
26874 :
26875 : /* "scipy/linalg/_decomp_interpolative.pyx":459
26876 : *
26877 : *
26878 : * def idd_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
26879 : * cdef int n = A.shape[1]
26880 : * cdef int j = 0, intone = 1
26881 : */
26882 :
26883 : /* Python wrapper */
26884 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_11idd_snorm(PyObject *__pyx_self,
26885 : #if CYTHON_METH_FASTCALL
26886 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26887 : #else
26888 : PyObject *__pyx_args, PyObject *__pyx_kwds
26889 : #endif
26890 : ); /*proto*/
26891 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_11idd_snorm = {"idd_snorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_11idd_snorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
26892 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_11idd_snorm(PyObject *__pyx_self,
26893 : #if CYTHON_METH_FASTCALL
26894 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26895 : #else
26896 : PyObject *__pyx_args, PyObject *__pyx_kwds
26897 : #endif
26898 : ) {
26899 1 : PyObject *__pyx_v_A = 0;
26900 1 : PyObject *__pyx_v_rng = 0;
26901 1 : int __pyx_v_its;
26902 : #if !CYTHON_METH_FASTCALL
26903 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
26904 : #endif
26905 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
26906 1 : PyObject* values[3] = {0,0,0};
26907 1 : int __pyx_lineno = 0;
26908 1 : const char *__pyx_filename = NULL;
26909 1 : int __pyx_clineno = 0;
26910 1 : PyObject *__pyx_r = 0;
26911 : __Pyx_RefNannyDeclarations
26912 1 : __Pyx_RefNannySetupContext("idd_snorm (wrapper)", 0);
26913 : #if !CYTHON_METH_FASTCALL
26914 : #if CYTHON_ASSUME_SAFE_MACROS
26915 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
26916 : #else
26917 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
26918 : #endif
26919 : #endif
26920 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
26921 : {
26922 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_rng,&__pyx_n_s_its,0};
26923 1 : if (likely(__pyx_kwds)) {
26924 1 : Py_ssize_t kw_args;
26925 1 : switch (__pyx_nargs) {
26926 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
26927 1 : CYTHON_FALLTHROUGH;
26928 1 : case 0: break;
26929 0 : default: goto __pyx_L5_argtuple_error;
26930 : }
26931 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
26932 1 : switch (__pyx_nargs) {
26933 : case 0:
26934 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
26935 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
26936 0 : kw_args--;
26937 : }
26938 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error)
26939 0 : else goto __pyx_L5_argtuple_error;
26940 1 : CYTHON_FALLTHROUGH;
26941 : case 1:
26942 1 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
26943 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
26944 1 : kw_args--;
26945 : }
26946 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error)
26947 : else {
26948 0 : __Pyx_RaiseKeywordRequired("idd_snorm", __pyx_n_s_rng); __PYX_ERR(0, 459, __pyx_L3_error)
26949 : }
26950 : }
26951 1 : if (kw_args == 1) {
26952 1 : const Py_ssize_t index = 2;
26953 1 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
26954 1 : if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
26955 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error)
26956 : }
26957 1 : if (unlikely(kw_args > 0)) {
26958 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
26959 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idd_snorm") < 0)) __PYX_ERR(0, 459, __pyx_L3_error)
26960 : }
26961 0 : } else if (unlikely(__pyx_nargs != 1)) {
26962 0 : goto __pyx_L5_argtuple_error;
26963 : } else {
26964 0 : __Pyx_RaiseKeywordRequired("idd_snorm", __pyx_n_s_rng); __PYX_ERR(0, 459, __pyx_L3_error)
26965 : }
26966 1 : __pyx_v_A = values[0];
26967 1 : __pyx_v_rng = values[1];
26968 1 : if (values[2]) {
26969 1 : __pyx_v_its = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_its == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error)
26970 : } else {
26971 : __pyx_v_its = ((int)((int)20));
26972 : }
26973 : }
26974 1 : goto __pyx_L6_skip;
26975 0 : __pyx_L5_argtuple_error:;
26976 0 : __Pyx_RaiseArgtupleInvalid("idd_snorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 459, __pyx_L3_error)
26977 1 : __pyx_L6_skip:;
26978 1 : goto __pyx_L4_argument_unpacking_done;
26979 0 : __pyx_L3_error:;
26980 : {
26981 0 : Py_ssize_t __pyx_temp;
26982 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26983 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26984 : }
26985 : }
26986 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_snorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
26987 0 : __Pyx_RefNannyFinishContext();
26988 0 : return NULL;
26989 1 : __pyx_L4_argument_unpacking_done:;
26990 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_10idd_snorm(__pyx_self, __pyx_v_A, __pyx_v_rng, __pyx_v_its);
26991 :
26992 : /* function exit code */
26993 : {
26994 1 : Py_ssize_t __pyx_temp;
26995 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26996 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26997 : }
26998 : }
26999 : __Pyx_RefNannyFinishContext();
27000 : return __pyx_r;
27001 : }
27002 :
27003 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_10idd_snorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_rng, int __pyx_v_its) {
27004 1 : int __pyx_v_n;
27005 1 : CYTHON_UNUSED int __pyx_v_j;
27006 1 : int __pyx_v_intone;
27007 1 : __pyx_t_5numpy_float64_t __pyx_v_snorm;
27008 1 : PyArrayObject *__pyx_v_v = 0;
27009 1 : PyArrayObject *__pyx_v_u = 0;
27010 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u;
27011 1 : __Pyx_Buffer __pyx_pybuffer_u;
27012 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
27013 1 : __Pyx_Buffer __pyx_pybuffer_v;
27014 1 : PyObject *__pyx_r = NULL;
27015 : __Pyx_RefNannyDeclarations
27016 1 : PyObject *__pyx_t_1 = NULL;
27017 1 : PyObject *__pyx_t_2 = NULL;
27018 1 : int __pyx_t_3;
27019 1 : PyObject *__pyx_t_4 = NULL;
27020 1 : PyArrayObject *__pyx_t_5 = NULL;
27021 1 : PyObject *__pyx_t_6 = NULL;
27022 1 : PyObject *__pyx_t_7 = NULL;
27023 1 : PyObject *__pyx_t_8 = NULL;
27024 1 : Py_ssize_t __pyx_t_9;
27025 1 : int __pyx_t_10;
27026 1 : int __pyx_t_11;
27027 1 : unsigned int __pyx_t_12;
27028 1 : PyArrayObject *__pyx_t_13 = NULL;
27029 1 : int __pyx_t_14;
27030 1 : int __pyx_t_15;
27031 1 : PyObject *__pyx_t_16 = NULL;
27032 1 : __pyx_t_5numpy_float64_t __pyx_t_17;
27033 1 : int __pyx_lineno = 0;
27034 1 : const char *__pyx_filename = NULL;
27035 1 : int __pyx_clineno = 0;
27036 1 : __Pyx_RefNannySetupContext("idd_snorm", 1);
27037 1 : __pyx_pybuffer_v.pybuffer.buf = NULL;
27038 1 : __pyx_pybuffer_v.refcount = 0;
27039 1 : __pyx_pybuffernd_v.data = NULL;
27040 1 : __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
27041 1 : __pyx_pybuffer_u.pybuffer.buf = NULL;
27042 1 : __pyx_pybuffer_u.refcount = 0;
27043 1 : __pyx_pybuffernd_u.data = NULL;
27044 1 : __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u;
27045 :
27046 : /* "scipy/linalg/_decomp_interpolative.pyx":460
27047 : *
27048 : * def idd_snorm(A: LinearOperator, *, rng, int its=20):
27049 : * cdef int n = A.shape[1] # <<<<<<<<<<<<<<
27050 : * cdef int j = 0, intone = 1
27051 : * cdef cnp.float64_t snorm = 0.0
27052 : */
27053 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
27054 1 : __Pyx_GOTREF(__pyx_t_1);
27055 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
27056 1 : __Pyx_GOTREF(__pyx_t_2);
27057 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27058 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
27059 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27060 1 : __pyx_v_n = __pyx_t_3;
27061 :
27062 : /* "scipy/linalg/_decomp_interpolative.pyx":461
27063 : * def idd_snorm(A: LinearOperator, *, rng, int its=20):
27064 : * cdef int n = A.shape[1]
27065 : * cdef int j = 0, intone = 1 # <<<<<<<<<<<<<<
27066 : * cdef cnp.float64_t snorm = 0.0
27067 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] v
27068 : */
27069 1 : __pyx_v_j = 0;
27070 1 : __pyx_v_intone = 1;
27071 :
27072 : /* "scipy/linalg/_decomp_interpolative.pyx":462
27073 : * cdef int n = A.shape[1]
27074 : * cdef int j = 0, intone = 1
27075 : * cdef cnp.float64_t snorm = 0.0 # <<<<<<<<<<<<<<
27076 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] v
27077 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] u
27078 : */
27079 1 : __pyx_v_snorm = 0.0;
27080 :
27081 : /* "scipy/linalg/_decomp_interpolative.pyx":466
27082 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] u
27083 : *
27084 : * v = rng.uniform(low=-1., high=1., size=n) # <<<<<<<<<<<<<<
27085 : * v /= dnrm2(&n, &v[0], &intone)
27086 : *
27087 : */
27088 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
27089 1 : __Pyx_GOTREF(__pyx_t_2);
27090 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
27091 1 : __Pyx_GOTREF(__pyx_t_1);
27092 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_low, __pyx_float_neg_1_) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
27093 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_high, __pyx_float_1_) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
27094 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
27095 1 : __Pyx_GOTREF(__pyx_t_4);
27096 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_t_4) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
27097 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27098 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
27099 1 : __Pyx_GOTREF(__pyx_t_4);
27100 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27101 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27102 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 466, __pyx_L1_error)
27103 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
27104 : {
27105 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27106 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27107 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
27108 1 : if (unlikely(__pyx_t_3 < 0)) {
27109 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
27110 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
27111 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
27112 : __Pyx_RaiseBufferFallbackError();
27113 : } else {
27114 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
27115 : }
27116 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
27117 : }
27118 1 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
27119 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 466, __pyx_L1_error)
27120 : }
27121 1 : __pyx_t_5 = 0;
27122 1 : __pyx_v_v = ((PyArrayObject *)__pyx_t_4);
27123 1 : __pyx_t_4 = 0;
27124 :
27125 : /* "scipy/linalg/_decomp_interpolative.pyx":467
27126 : *
27127 : * v = rng.uniform(low=-1., high=1., size=n)
27128 : * v /= dnrm2(&n, &v[0], &intone) # <<<<<<<<<<<<<<
27129 : *
27130 : * for j in range(its):
27131 : */
27132 1 : __pyx_t_9 = 0;
27133 1 : __pyx_t_4 = PyFloat_FromDouble(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v.diminfo[0].strides))), (&__pyx_v_intone))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error)
27134 1 : __Pyx_GOTREF(__pyx_t_4);
27135 1 : __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
27136 1 : __Pyx_GOTREF(__pyx_t_1);
27137 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27138 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 467, __pyx_L1_error)
27139 1 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
27140 : {
27141 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27142 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27143 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
27144 1 : if (unlikely(__pyx_t_3 < 0)) {
27145 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
27146 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
27147 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
27148 0 : __Pyx_RaiseBufferFallbackError();
27149 : } else {
27150 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
27151 : }
27152 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
27153 : }
27154 1 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
27155 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 467, __pyx_L1_error)
27156 : }
27157 1 : __pyx_t_5 = 0;
27158 1 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_1));
27159 : __pyx_t_1 = 0;
27160 :
27161 : /* "scipy/linalg/_decomp_interpolative.pyx":469
27162 : * v /= dnrm2(&n, &v[0], &intone)
27163 : *
27164 : * for j in range(its): # <<<<<<<<<<<<<<
27165 : * u = A.matvec(v)
27166 : * v = A.rmatvec(u)
27167 : */
27168 21 : __pyx_t_3 = __pyx_v_its;
27169 : __pyx_t_10 = __pyx_t_3;
27170 21 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
27171 20 : __pyx_v_j = __pyx_t_11;
27172 :
27173 : /* "scipy/linalg/_decomp_interpolative.pyx":470
27174 : *
27175 : * for j in range(its):
27176 : * u = A.matvec(v) # <<<<<<<<<<<<<<
27177 : * v = A.rmatvec(u)
27178 : * snorm = dnrm2(&n, &v[0], &intone)
27179 : */
27180 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
27181 20 : __Pyx_GOTREF(__pyx_t_4);
27182 20 : __pyx_t_2 = NULL;
27183 20 : __pyx_t_12 = 0;
27184 : #if CYTHON_UNPACK_METHODS
27185 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
27186 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
27187 20 : if (likely(__pyx_t_2)) {
27188 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
27189 20 : __Pyx_INCREF(__pyx_t_2);
27190 20 : __Pyx_INCREF(function);
27191 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
27192 : __pyx_t_12 = 1;
27193 : }
27194 : }
27195 : #endif
27196 : {
27197 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_v)};
27198 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
27199 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27200 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
27201 20 : __Pyx_GOTREF(__pyx_t_1);
27202 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27203 : }
27204 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 470, __pyx_L1_error)
27205 20 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
27206 : {
27207 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27208 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
27209 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
27210 20 : if (unlikely(__pyx_t_14 < 0)) {
27211 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
27212 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_u, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
27213 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
27214 0 : __Pyx_RaiseBufferFallbackError();
27215 : } else {
27216 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
27217 : }
27218 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
27219 : }
27220 20 : __pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0];
27221 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 470, __pyx_L1_error)
27222 : }
27223 20 : __pyx_t_13 = 0;
27224 20 : __Pyx_XDECREF_SET(__pyx_v_u, ((PyArrayObject *)__pyx_t_1));
27225 20 : __pyx_t_1 = 0;
27226 :
27227 : /* "scipy/linalg/_decomp_interpolative.pyx":471
27228 : * for j in range(its):
27229 : * u = A.matvec(v)
27230 : * v = A.rmatvec(u) # <<<<<<<<<<<<<<
27231 : * snorm = dnrm2(&n, &v[0], &intone)
27232 : * if snorm > 0.0:
27233 : */
27234 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
27235 20 : __Pyx_GOTREF(__pyx_t_4);
27236 20 : __pyx_t_2 = NULL;
27237 20 : __pyx_t_12 = 0;
27238 : #if CYTHON_UNPACK_METHODS
27239 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
27240 20 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
27241 20 : if (likely(__pyx_t_2)) {
27242 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
27243 20 : __Pyx_INCREF(__pyx_t_2);
27244 20 : __Pyx_INCREF(function);
27245 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
27246 : __pyx_t_12 = 1;
27247 : }
27248 : }
27249 : #endif
27250 : {
27251 20 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_u)};
27252 20 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
27253 20 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27254 20 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
27255 20 : __Pyx_GOTREF(__pyx_t_1);
27256 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27257 : }
27258 20 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 471, __pyx_L1_error)
27259 20 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
27260 : {
27261 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27262 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27263 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
27264 20 : if (unlikely(__pyx_t_14 < 0)) {
27265 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
27266 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
27267 0 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
27268 0 : __Pyx_RaiseBufferFallbackError();
27269 : } else {
27270 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
27271 : }
27272 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
27273 : }
27274 20 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
27275 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 471, __pyx_L1_error)
27276 : }
27277 20 : __pyx_t_5 = 0;
27278 20 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_1));
27279 20 : __pyx_t_1 = 0;
27280 :
27281 : /* "scipy/linalg/_decomp_interpolative.pyx":472
27282 : * u = A.matvec(v)
27283 : * v = A.rmatvec(u)
27284 : * snorm = dnrm2(&n, &v[0], &intone) # <<<<<<<<<<<<<<
27285 : * if snorm > 0.0:
27286 : * v /= snorm
27287 : */
27288 20 : __pyx_t_9 = 0;
27289 20 : __pyx_v_snorm = __pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v.diminfo[0].strides))), (&__pyx_v_intone));
27290 :
27291 : /* "scipy/linalg/_decomp_interpolative.pyx":473
27292 : * v = A.rmatvec(u)
27293 : * snorm = dnrm2(&n, &v[0], &intone)
27294 : * if snorm > 0.0: # <<<<<<<<<<<<<<
27295 : * v /= snorm
27296 : *
27297 : */
27298 20 : __pyx_t_15 = (__pyx_v_snorm > 0.0);
27299 20 : if (__pyx_t_15) {
27300 :
27301 : /* "scipy/linalg/_decomp_interpolative.pyx":474
27302 : * snorm = dnrm2(&n, &v[0], &intone)
27303 : * if snorm > 0.0:
27304 : * v /= snorm # <<<<<<<<<<<<<<
27305 : *
27306 : * snorm = np.sqrt(snorm)
27307 : */
27308 20 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
27309 20 : __Pyx_GOTREF(__pyx_t_1);
27310 20 : __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
27311 20 : __Pyx_GOTREF(__pyx_t_4);
27312 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27313 20 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 474, __pyx_L1_error)
27314 20 : __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
27315 : {
27316 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27317 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27318 20 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
27319 20 : if (unlikely(__pyx_t_14 < 0)) {
27320 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
27321 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
27322 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
27323 0 : __Pyx_RaiseBufferFallbackError();
27324 : } else {
27325 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
27326 : }
27327 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
27328 : }
27329 20 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
27330 20 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 474, __pyx_L1_error)
27331 : }
27332 20 : __pyx_t_5 = 0;
27333 20 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_4));
27334 : __pyx_t_4 = 0;
27335 :
27336 : /* "scipy/linalg/_decomp_interpolative.pyx":473
27337 : * v = A.rmatvec(u)
27338 : * snorm = dnrm2(&n, &v[0], &intone)
27339 : * if snorm > 0.0: # <<<<<<<<<<<<<<
27340 : * v /= snorm
27341 : *
27342 : */
27343 : }
27344 :
27345 : /* "scipy/linalg/_decomp_interpolative.pyx":476
27346 : * v /= snorm
27347 : *
27348 : * snorm = np.sqrt(snorm) # <<<<<<<<<<<<<<
27349 : *
27350 : * return snorm
27351 : */
27352 20 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
27353 20 : __Pyx_GOTREF(__pyx_t_1);
27354 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
27355 20 : __Pyx_GOTREF(__pyx_t_2);
27356 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27357 20 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
27358 20 : __Pyx_GOTREF(__pyx_t_1);
27359 20 : __pyx_t_16 = NULL;
27360 20 : __pyx_t_12 = 0;
27361 : #if CYTHON_UNPACK_METHODS
27362 20 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
27363 0 : __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_2);
27364 0 : if (likely(__pyx_t_16)) {
27365 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27366 0 : __Pyx_INCREF(__pyx_t_16);
27367 0 : __Pyx_INCREF(function);
27368 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
27369 : __pyx_t_12 = 1;
27370 : }
27371 : }
27372 : #endif
27373 : {
27374 20 : PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_1};
27375 20 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
27376 20 : __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
27377 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27378 20 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
27379 20 : __Pyx_GOTREF(__pyx_t_4);
27380 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27381 : }
27382 20 : __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_17 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
27383 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27384 20 : __pyx_v_snorm = __pyx_t_17;
27385 : }
27386 :
27387 : /* "scipy/linalg/_decomp_interpolative.pyx":478
27388 : * snorm = np.sqrt(snorm)
27389 : *
27390 : * return snorm # <<<<<<<<<<<<<<
27391 : *
27392 : *
27393 : */
27394 1 : __Pyx_XDECREF(__pyx_r);
27395 1 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
27396 1 : __Pyx_GOTREF(__pyx_t_4);
27397 1 : __pyx_r = __pyx_t_4;
27398 1 : __pyx_t_4 = 0;
27399 1 : goto __pyx_L0;
27400 :
27401 : /* "scipy/linalg/_decomp_interpolative.pyx":459
27402 : *
27403 : *
27404 : * def idd_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
27405 : * cdef int n = A.shape[1]
27406 : * cdef int j = 0, intone = 1
27407 : */
27408 :
27409 : /* function exit code */
27410 0 : __pyx_L1_error:;
27411 0 : __Pyx_XDECREF(__pyx_t_1);
27412 0 : __Pyx_XDECREF(__pyx_t_2);
27413 0 : __Pyx_XDECREF(__pyx_t_4);
27414 0 : __Pyx_XDECREF(__pyx_t_16);
27415 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
27416 0 : __Pyx_PyThreadState_declare
27417 0 : __Pyx_PyThreadState_assign
27418 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
27419 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
27420 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27421 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
27422 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idd_snorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
27423 0 : __pyx_r = NULL;
27424 0 : goto __pyx_L2;
27425 1 : __pyx_L0:;
27426 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
27427 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
27428 1 : __pyx_L2:;
27429 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v);
27430 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u);
27431 1 : __Pyx_XGIVEREF(__pyx_r);
27432 1 : __Pyx_RefNannyFinishContext();
27433 1 : return __pyx_r;
27434 : }
27435 :
27436 : /* "scipy/linalg/_decomp_interpolative.pyx":481
27437 : *
27438 : *
27439 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
27440 : * krank, proj = idd_estrank(a, eps, rng=rng)
27441 : * if krank != 0:
27442 : */
27443 :
27444 : /* Python wrapper */
27445 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_13iddp_aid(PyObject *__pyx_self,
27446 : #if CYTHON_METH_FASTCALL
27447 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27448 : #else
27449 : PyObject *__pyx_args, PyObject *__pyx_kwds
27450 : #endif
27451 : ); /*proto*/
27452 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_13iddp_aid = {"iddp_aid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_13iddp_aid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
27453 4 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_13iddp_aid(PyObject *__pyx_self,
27454 : #if CYTHON_METH_FASTCALL
27455 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27456 : #else
27457 : PyObject *__pyx_args, PyObject *__pyx_kwds
27458 : #endif
27459 : ) {
27460 4 : PyArrayObject *__pyx_v_a = 0;
27461 4 : double __pyx_v_eps;
27462 4 : PyObject *__pyx_v_rng = 0;
27463 : #if !CYTHON_METH_FASTCALL
27464 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
27465 : #endif
27466 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
27467 4 : PyObject* values[3] = {0,0,0};
27468 4 : int __pyx_lineno = 0;
27469 4 : const char *__pyx_filename = NULL;
27470 4 : int __pyx_clineno = 0;
27471 4 : PyObject *__pyx_r = 0;
27472 : __Pyx_RefNannyDeclarations
27473 4 : __Pyx_RefNannySetupContext("iddp_aid (wrapper)", 0);
27474 : #if !CYTHON_METH_FASTCALL
27475 : #if CYTHON_ASSUME_SAFE_MACROS
27476 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
27477 : #else
27478 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
27479 : #endif
27480 : #endif
27481 4 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
27482 : {
27483 4 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
27484 4 : if (likely(__pyx_kwds)) {
27485 4 : Py_ssize_t kw_args;
27486 4 : switch (__pyx_nargs) {
27487 4 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27488 4 : CYTHON_FALLTHROUGH;
27489 4 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27490 4 : CYTHON_FALLTHROUGH;
27491 4 : case 0: break;
27492 0 : default: goto __pyx_L5_argtuple_error;
27493 : }
27494 4 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
27495 4 : switch (__pyx_nargs) {
27496 : case 0:
27497 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
27498 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
27499 0 : kw_args--;
27500 : }
27501 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error)
27502 0 : else goto __pyx_L5_argtuple_error;
27503 0 : CYTHON_FALLTHROUGH;
27504 : case 1:
27505 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
27506 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
27507 0 : kw_args--;
27508 : }
27509 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error)
27510 : else {
27511 0 : __Pyx_RaiseArgtupleInvalid("iddp_aid", 1, 2, 2, 1); __PYX_ERR(0, 481, __pyx_L3_error)
27512 : }
27513 4 : CYTHON_FALLTHROUGH;
27514 : case 2:
27515 4 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
27516 4 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
27517 4 : kw_args--;
27518 : }
27519 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error)
27520 : else {
27521 0 : __Pyx_RaiseKeywordRequired("iddp_aid", __pyx_n_s_rng); __PYX_ERR(0, 481, __pyx_L3_error)
27522 : }
27523 : }
27524 4 : if (unlikely(kw_args > 0)) {
27525 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
27526 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_aid") < 0)) __PYX_ERR(0, 481, __pyx_L3_error)
27527 : }
27528 0 : } else if (unlikely(__pyx_nargs != 2)) {
27529 0 : goto __pyx_L5_argtuple_error;
27530 : } else {
27531 0 : __Pyx_RaiseKeywordRequired("iddp_aid", __pyx_n_s_rng); __PYX_ERR(0, 481, __pyx_L3_error)
27532 : }
27533 4 : __pyx_v_a = ((PyArrayObject *)values[0]);
27534 4 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error)
27535 4 : __pyx_v_rng = values[2];
27536 : }
27537 4 : goto __pyx_L6_skip;
27538 0 : __pyx_L5_argtuple_error:;
27539 0 : __Pyx_RaiseArgtupleInvalid("iddp_aid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error)
27540 4 : __pyx_L6_skip:;
27541 4 : goto __pyx_L4_argument_unpacking_done;
27542 0 : __pyx_L3_error:;
27543 : {
27544 0 : Py_ssize_t __pyx_temp;
27545 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27546 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27547 : }
27548 : }
27549 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
27550 0 : __Pyx_RefNannyFinishContext();
27551 0 : return NULL;
27552 4 : __pyx_L4_argument_unpacking_done:;
27553 4 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 481, __pyx_L1_error)
27554 4 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_12iddp_aid(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
27555 :
27556 : /* function exit code */
27557 4 : goto __pyx_L0;
27558 0 : __pyx_L1_error:;
27559 0 : __pyx_r = NULL;
27560 4 : __pyx_L0:;
27561 : {
27562 4 : Py_ssize_t __pyx_temp;
27563 4 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27564 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27565 : }
27566 : }
27567 : __Pyx_RefNannyFinishContext();
27568 : return __pyx_r;
27569 : }
27570 :
27571 4 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_12iddp_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng) {
27572 4 : PyObject *__pyx_v_krank = NULL;
27573 4 : PyObject *__pyx_v_proj = NULL;
27574 4 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
27575 4 : __Pyx_Buffer __pyx_pybuffer_a;
27576 4 : PyObject *__pyx_r = NULL;
27577 : __Pyx_RefNannyDeclarations
27578 4 : PyObject *__pyx_t_1 = NULL;
27579 4 : PyObject *__pyx_t_2 = NULL;
27580 4 : PyObject *__pyx_t_3 = NULL;
27581 4 : PyObject *__pyx_t_4 = NULL;
27582 4 : PyObject *(*__pyx_t_5)(PyObject *);
27583 4 : int __pyx_t_6;
27584 4 : int __pyx_lineno = 0;
27585 4 : const char *__pyx_filename = NULL;
27586 4 : int __pyx_clineno = 0;
27587 4 : __Pyx_RefNannySetupContext("iddp_aid", 1);
27588 4 : __pyx_pybuffer_a.pybuffer.buf = NULL;
27589 4 : __pyx_pybuffer_a.refcount = 0;
27590 4 : __pyx_pybuffernd_a.data = NULL;
27591 4 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
27592 : {
27593 4 : __Pyx_BufFmt_StackElem __pyx_stack[1];
27594 4 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 481, __pyx_L1_error)
27595 : }
27596 4 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
27597 :
27598 : /* "scipy/linalg/_decomp_interpolative.pyx":482
27599 : *
27600 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng):
27601 : * krank, proj = idd_estrank(a, eps, rng=rng) # <<<<<<<<<<<<<<
27602 : * if krank != 0:
27603 : * proj = proj[:krank, :]
27604 : */
27605 4 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idd_estrank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
27606 4 : __Pyx_GOTREF(__pyx_t_1);
27607 4 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
27608 4 : __Pyx_GOTREF(__pyx_t_2);
27609 4 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
27610 4 : __Pyx_GOTREF(__pyx_t_3);
27611 4 : __Pyx_INCREF((PyObject *)__pyx_v_a);
27612 4 : __Pyx_GIVEREF((PyObject *)__pyx_v_a);
27613 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_a))) __PYX_ERR(0, 482, __pyx_L1_error);
27614 4 : __Pyx_GIVEREF(__pyx_t_2);
27615 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error);
27616 4 : __pyx_t_2 = 0;
27617 4 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
27618 4 : __Pyx_GOTREF(__pyx_t_2);
27619 4 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
27620 4 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error)
27621 4 : __Pyx_GOTREF(__pyx_t_4);
27622 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27623 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27624 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27625 4 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
27626 4 : PyObject* sequence = __pyx_t_4;
27627 4 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27628 4 : if (unlikely(size != 2)) {
27629 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27630 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
27631 0 : __PYX_ERR(0, 482, __pyx_L1_error)
27632 : }
27633 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27634 4 : if (likely(PyTuple_CheckExact(sequence))) {
27635 4 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
27636 4 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
27637 : } else {
27638 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
27639 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
27640 : }
27641 4 : __Pyx_INCREF(__pyx_t_2);
27642 4 : __Pyx_INCREF(__pyx_t_3);
27643 : #else
27644 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
27645 : __Pyx_GOTREF(__pyx_t_2);
27646 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
27647 : __Pyx_GOTREF(__pyx_t_3);
27648 : #endif
27649 4 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27650 : } else {
27651 0 : Py_ssize_t index = -1;
27652 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
27653 0 : __Pyx_GOTREF(__pyx_t_1);
27654 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27655 0 : __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
27656 0 : index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
27657 0 : __Pyx_GOTREF(__pyx_t_2);
27658 0 : index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
27659 0 : __Pyx_GOTREF(__pyx_t_3);
27660 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
27661 0 : __pyx_t_5 = NULL;
27662 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27663 0 : goto __pyx_L4_unpacking_done;
27664 0 : __pyx_L3_unpacking_failed:;
27665 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27666 0 : __pyx_t_5 = NULL;
27667 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
27668 0 : __PYX_ERR(0, 482, __pyx_L1_error)
27669 0 : __pyx_L4_unpacking_done:;
27670 : }
27671 4 : __pyx_v_krank = __pyx_t_2;
27672 4 : __pyx_t_2 = 0;
27673 4 : __pyx_v_proj = __pyx_t_3;
27674 4 : __pyx_t_3 = 0;
27675 :
27676 : /* "scipy/linalg/_decomp_interpolative.pyx":483
27677 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng):
27678 : * krank, proj = idd_estrank(a, eps, rng=rng)
27679 : * if krank != 0: # <<<<<<<<<<<<<<
27680 : * proj = proj[:krank, :]
27681 : * return iddp_id(proj, eps=eps)
27682 : */
27683 4 : __pyx_t_6 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_krank, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 483, __pyx_L1_error)
27684 4 : if (__pyx_t_6) {
27685 :
27686 : /* "scipy/linalg/_decomp_interpolative.pyx":484
27687 : * krank, proj = idd_estrank(a, eps, rng=rng)
27688 : * if krank != 0:
27689 : * proj = proj[:krank, :] # <<<<<<<<<<<<<<
27690 : * return iddp_id(proj, eps=eps)
27691 : *
27692 : */
27693 2 : __pyx_t_4 = PySlice_New(Py_None, __pyx_v_krank, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
27694 2 : __Pyx_GOTREF(__pyx_t_4);
27695 2 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
27696 2 : __Pyx_GOTREF(__pyx_t_3);
27697 2 : __Pyx_GIVEREF(__pyx_t_4);
27698 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error);
27699 2 : __Pyx_INCREF(__pyx_slice__5);
27700 2 : __Pyx_GIVEREF(__pyx_slice__5);
27701 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 484, __pyx_L1_error);
27702 2 : __pyx_t_4 = 0;
27703 2 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_proj, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
27704 2 : __Pyx_GOTREF(__pyx_t_4);
27705 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27706 2 : __Pyx_DECREF_SET(__pyx_v_proj, __pyx_t_4);
27707 2 : __pyx_t_4 = 0;
27708 :
27709 : /* "scipy/linalg/_decomp_interpolative.pyx":485
27710 : * if krank != 0:
27711 : * proj = proj[:krank, :]
27712 : * return iddp_id(proj, eps=eps) # <<<<<<<<<<<<<<
27713 : *
27714 : * return iddp_id(a, eps=eps)
27715 : */
27716 2 : __Pyx_XDECREF(__pyx_r);
27717 2 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_iddp_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
27718 2 : __Pyx_GOTREF(__pyx_t_4);
27719 2 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
27720 2 : __Pyx_GOTREF(__pyx_t_3);
27721 2 : __Pyx_INCREF(__pyx_v_proj);
27722 2 : __Pyx_GIVEREF(__pyx_v_proj);
27723 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_proj)) __PYX_ERR(0, 485, __pyx_L1_error);
27724 2 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
27725 2 : __Pyx_GOTREF(__pyx_t_2);
27726 2 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
27727 2 : __Pyx_GOTREF(__pyx_t_1);
27728 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_eps, __pyx_t_1) < 0) __PYX_ERR(0, 485, __pyx_L1_error)
27729 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27730 2 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
27731 2 : __Pyx_GOTREF(__pyx_t_1);
27732 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27733 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27734 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27735 2 : __pyx_r = __pyx_t_1;
27736 2 : __pyx_t_1 = 0;
27737 2 : goto __pyx_L0;
27738 :
27739 : /* "scipy/linalg/_decomp_interpolative.pyx":483
27740 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng):
27741 : * krank, proj = idd_estrank(a, eps, rng=rng)
27742 : * if krank != 0: # <<<<<<<<<<<<<<
27743 : * proj = proj[:krank, :]
27744 : * return iddp_id(proj, eps=eps)
27745 : */
27746 : }
27747 :
27748 : /* "scipy/linalg/_decomp_interpolative.pyx":487
27749 : * return iddp_id(proj, eps=eps)
27750 : *
27751 : * return iddp_id(a, eps=eps) # <<<<<<<<<<<<<<
27752 : *
27753 : *
27754 : */
27755 2 : __Pyx_XDECREF(__pyx_r);
27756 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_iddp_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
27757 2 : __Pyx_GOTREF(__pyx_t_1);
27758 2 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
27759 2 : __Pyx_GOTREF(__pyx_t_2);
27760 2 : __Pyx_INCREF((PyObject *)__pyx_v_a);
27761 2 : __Pyx_GIVEREF((PyObject *)__pyx_v_a);
27762 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_a))) __PYX_ERR(0, 487, __pyx_L1_error);
27763 2 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error)
27764 2 : __Pyx_GOTREF(__pyx_t_3);
27765 2 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error)
27766 2 : __Pyx_GOTREF(__pyx_t_4);
27767 2 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_eps, __pyx_t_4) < 0) __PYX_ERR(0, 487, __pyx_L1_error)
27768 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27769 2 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error)
27770 2 : __Pyx_GOTREF(__pyx_t_4);
27771 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27772 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27773 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27774 2 : __pyx_r = __pyx_t_4;
27775 2 : __pyx_t_4 = 0;
27776 2 : goto __pyx_L0;
27777 :
27778 : /* "scipy/linalg/_decomp_interpolative.pyx":481
27779 : *
27780 : *
27781 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
27782 : * krank, proj = idd_estrank(a, eps, rng=rng)
27783 : * if krank != 0:
27784 : */
27785 :
27786 : /* function exit code */
27787 0 : __pyx_L1_error:;
27788 0 : __Pyx_XDECREF(__pyx_t_1);
27789 0 : __Pyx_XDECREF(__pyx_t_2);
27790 0 : __Pyx_XDECREF(__pyx_t_3);
27791 0 : __Pyx_XDECREF(__pyx_t_4);
27792 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
27793 0 : __Pyx_PyThreadState_declare
27794 0 : __Pyx_PyThreadState_assign
27795 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
27796 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
27797 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
27798 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
27799 0 : __pyx_r = NULL;
27800 0 : goto __pyx_L2;
27801 4 : __pyx_L0:;
27802 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
27803 4 : __pyx_L2:;
27804 4 : __Pyx_XDECREF(__pyx_v_krank);
27805 4 : __Pyx_XDECREF(__pyx_v_proj);
27806 4 : __Pyx_XGIVEREF(__pyx_r);
27807 4 : __Pyx_RefNannyFinishContext();
27808 4 : return __pyx_r;
27809 : }
27810 :
27811 : /* "scipy/linalg/_decomp_interpolative.pyx":490
27812 : *
27813 : *
27814 : * def iddp_asvd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
27815 : * cdef int m = a.shape[0], n = a.shape[1]
27816 : * cdef int krank, info, ci
27817 : */
27818 :
27819 : /* Python wrapper */
27820 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_15iddp_asvd(PyObject *__pyx_self,
27821 : #if CYTHON_METH_FASTCALL
27822 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27823 : #else
27824 : PyObject *__pyx_args, PyObject *__pyx_kwds
27825 : #endif
27826 : ); /*proto*/
27827 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_15iddp_asvd = {"iddp_asvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_15iddp_asvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
27828 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_15iddp_asvd(PyObject *__pyx_self,
27829 : #if CYTHON_METH_FASTCALL
27830 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27831 : #else
27832 : PyObject *__pyx_args, PyObject *__pyx_kwds
27833 : #endif
27834 : ) {
27835 1 : PyArrayObject *__pyx_v_a = 0;
27836 1 : double __pyx_v_eps;
27837 1 : PyObject *__pyx_v_rng = 0;
27838 : #if !CYTHON_METH_FASTCALL
27839 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
27840 : #endif
27841 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
27842 1 : PyObject* values[3] = {0,0,0};
27843 1 : int __pyx_lineno = 0;
27844 1 : const char *__pyx_filename = NULL;
27845 1 : int __pyx_clineno = 0;
27846 1 : PyObject *__pyx_r = 0;
27847 : __Pyx_RefNannyDeclarations
27848 1 : __Pyx_RefNannySetupContext("iddp_asvd (wrapper)", 0);
27849 : #if !CYTHON_METH_FASTCALL
27850 : #if CYTHON_ASSUME_SAFE_MACROS
27851 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
27852 : #else
27853 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
27854 : #endif
27855 : #endif
27856 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
27857 : {
27858 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
27859 1 : if (likely(__pyx_kwds)) {
27860 1 : Py_ssize_t kw_args;
27861 1 : switch (__pyx_nargs) {
27862 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27863 1 : CYTHON_FALLTHROUGH;
27864 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27865 1 : CYTHON_FALLTHROUGH;
27866 1 : case 0: break;
27867 0 : default: goto __pyx_L5_argtuple_error;
27868 : }
27869 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
27870 1 : switch (__pyx_nargs) {
27871 : case 0:
27872 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
27873 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
27874 0 : kw_args--;
27875 : }
27876 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
27877 0 : else goto __pyx_L5_argtuple_error;
27878 0 : CYTHON_FALLTHROUGH;
27879 : case 1:
27880 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
27881 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
27882 0 : kw_args--;
27883 : }
27884 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
27885 : else {
27886 0 : __Pyx_RaiseArgtupleInvalid("iddp_asvd", 1, 2, 2, 1); __PYX_ERR(0, 490, __pyx_L3_error)
27887 : }
27888 1 : CYTHON_FALLTHROUGH;
27889 : case 2:
27890 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
27891 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
27892 1 : kw_args--;
27893 : }
27894 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
27895 : else {
27896 0 : __Pyx_RaiseKeywordRequired("iddp_asvd", __pyx_n_s_rng); __PYX_ERR(0, 490, __pyx_L3_error)
27897 : }
27898 : }
27899 1 : if (unlikely(kw_args > 0)) {
27900 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
27901 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_asvd") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
27902 : }
27903 0 : } else if (unlikely(__pyx_nargs != 2)) {
27904 0 : goto __pyx_L5_argtuple_error;
27905 : } else {
27906 0 : __Pyx_RaiseKeywordRequired("iddp_asvd", __pyx_n_s_rng); __PYX_ERR(0, 490, __pyx_L3_error)
27907 : }
27908 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
27909 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
27910 1 : __pyx_v_rng = values[2];
27911 : }
27912 1 : goto __pyx_L6_skip;
27913 0 : __pyx_L5_argtuple_error:;
27914 0 : __Pyx_RaiseArgtupleInvalid("iddp_asvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error)
27915 1 : __pyx_L6_skip:;
27916 1 : goto __pyx_L4_argument_unpacking_done;
27917 0 : __pyx_L3_error:;
27918 : {
27919 0 : Py_ssize_t __pyx_temp;
27920 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27921 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27922 : }
27923 : }
27924 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
27925 0 : __Pyx_RefNannyFinishContext();
27926 0 : return NULL;
27927 1 : __pyx_L4_argument_unpacking_done:;
27928 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 490, __pyx_L1_error)
27929 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_14iddp_asvd(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
27930 :
27931 : /* function exit code */
27932 1 : goto __pyx_L0;
27933 0 : __pyx_L1_error:;
27934 0 : __pyx_r = NULL;
27935 1 : __pyx_L0:;
27936 : {
27937 1 : Py_ssize_t __pyx_temp;
27938 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27939 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27940 : }
27941 : }
27942 : __Pyx_RefNannyFinishContext();
27943 : return __pyx_r;
27944 : }
27945 :
27946 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_14iddp_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng) {
27947 1 : int __pyx_v_m;
27948 1 : int __pyx_v_n;
27949 1 : int __pyx_v_krank;
27950 1 : int __pyx_v_info;
27951 1 : int __pyx_v_ci;
27952 1 : PyArrayObject *__pyx_v_C = 0;
27953 1 : PyArrayObject *__pyx_v_tau1 = 0;
27954 1 : PyArrayObject *__pyx_v_tau2 = 0;
27955 1 : PyArrayObject *__pyx_v_UU = 0;
27956 1 : PyArrayObject *__pyx_v_S = 0;
27957 1 : PyArrayObject *__pyx_v_V = 0;
27958 1 : PyArrayObject *__pyx_v_VV = 0;
27959 1 : PyArrayObject *__pyx_v_proj = 0;
27960 1 : PyArrayObject *__pyx_v_perms = 0;
27961 1 : PyArrayObject *__pyx_v_inds1 = 0;
27962 1 : PyArrayObject *__pyx_v_inds2 = 0;
27963 1 : PyArrayObject *__pyx_v_p = 0;
27964 1 : PyArrayObject *__pyx_v_col = 0;
27965 1 : PyObject *__pyx_v_r = NULL;
27966 1 : PyObject *__pyx_v_t = NULL;
27967 1 : PyObject *__pyx_v_r2 = NULL;
27968 1 : PyObject *__pyx_v_r3 = NULL;
27969 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
27970 1 : __Pyx_Buffer __pyx_pybuffer_C;
27971 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
27972 1 : __Pyx_Buffer __pyx_pybuffer_S;
27973 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
27974 1 : __Pyx_Buffer __pyx_pybuffer_UU;
27975 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
27976 1 : __Pyx_Buffer __pyx_pybuffer_V;
27977 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
27978 1 : __Pyx_Buffer __pyx_pybuffer_VV;
27979 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
27980 1 : __Pyx_Buffer __pyx_pybuffer_a;
27981 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
27982 1 : __Pyx_Buffer __pyx_pybuffer_col;
27983 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
27984 1 : __Pyx_Buffer __pyx_pybuffer_inds1;
27985 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
27986 1 : __Pyx_Buffer __pyx_pybuffer_inds2;
27987 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
27988 1 : __Pyx_Buffer __pyx_pybuffer_p;
27989 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
27990 1 : __Pyx_Buffer __pyx_pybuffer_perms;
27991 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
27992 1 : __Pyx_Buffer __pyx_pybuffer_proj;
27993 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
27994 1 : __Pyx_Buffer __pyx_pybuffer_tau1;
27995 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
27996 1 : __Pyx_Buffer __pyx_pybuffer_tau2;
27997 1 : PyObject *__pyx_r = NULL;
27998 : __Pyx_RefNannyDeclarations
27999 1 : PyObject *__pyx_t_1 = NULL;
28000 1 : PyObject *__pyx_t_2 = NULL;
28001 1 : PyObject *__pyx_t_3 = NULL;
28002 1 : PyObject *__pyx_t_4 = NULL;
28003 1 : unsigned int __pyx_t_5;
28004 1 : PyObject *__pyx_t_6 = NULL;
28005 1 : PyObject *(*__pyx_t_7)(PyObject *);
28006 1 : int __pyx_t_8;
28007 1 : PyArrayObject *__pyx_t_9 = NULL;
28008 1 : PyObject *__pyx_t_10 = NULL;
28009 1 : PyObject *__pyx_t_11 = NULL;
28010 1 : PyObject *__pyx_t_12 = NULL;
28011 1 : PyArrayObject *__pyx_t_13 = NULL;
28012 1 : int __pyx_t_14;
28013 1 : npy_intp __pyx_t_15[2];
28014 1 : PyArrayObject *__pyx_t_16 = NULL;
28015 1 : npy_intp __pyx_t_17[2];
28016 1 : PyArrayObject *__pyx_t_18 = NULL;
28017 1 : npy_intp __pyx_t_19[2];
28018 1 : PyArrayObject *__pyx_t_20 = NULL;
28019 1 : PyArrayObject *__pyx_t_21 = NULL;
28020 1 : int __pyx_t_22;
28021 1 : int __pyx_t_23;
28022 1 : Py_ssize_t __pyx_t_24;
28023 1 : Py_ssize_t __pyx_t_25;
28024 1 : npy_int64 __pyx_t_26;
28025 1 : PyArrayObject *__pyx_t_27 = NULL;
28026 1 : PyArrayObject *__pyx_t_28 = NULL;
28027 1 : PyArrayObject *__pyx_t_29 = NULL;
28028 1 : PyArrayObject *__pyx_t_30 = NULL;
28029 1 : PyObject *__pyx_t_31 = NULL;
28030 1 : PyObject *__pyx_t_32 = NULL;
28031 1 : PyArrayObject *__pyx_t_33 = NULL;
28032 1 : PyArrayObject *__pyx_t_34 = NULL;
28033 1 : PyArrayObject *__pyx_t_35 = NULL;
28034 1 : Py_ssize_t __pyx_t_36;
28035 1 : Py_ssize_t __pyx_t_37;
28036 1 : Py_ssize_t __pyx_t_38;
28037 1 : Py_ssize_t __pyx_t_39;
28038 1 : Py_ssize_t __pyx_t_40;
28039 1 : int __pyx_lineno = 0;
28040 1 : const char *__pyx_filename = NULL;
28041 1 : int __pyx_clineno = 0;
28042 1 : __Pyx_RefNannySetupContext("iddp_asvd", 1);
28043 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
28044 1 : __pyx_pybuffer_C.refcount = 0;
28045 1 : __pyx_pybuffernd_C.data = NULL;
28046 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
28047 1 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
28048 1 : __pyx_pybuffer_tau1.refcount = 0;
28049 1 : __pyx_pybuffernd_tau1.data = NULL;
28050 1 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
28051 1 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
28052 1 : __pyx_pybuffer_tau2.refcount = 0;
28053 1 : __pyx_pybuffernd_tau2.data = NULL;
28054 1 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
28055 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
28056 1 : __pyx_pybuffer_UU.refcount = 0;
28057 1 : __pyx_pybuffernd_UU.data = NULL;
28058 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
28059 1 : __pyx_pybuffer_S.pybuffer.buf = NULL;
28060 1 : __pyx_pybuffer_S.refcount = 0;
28061 1 : __pyx_pybuffernd_S.data = NULL;
28062 1 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
28063 1 : __pyx_pybuffer_V.pybuffer.buf = NULL;
28064 1 : __pyx_pybuffer_V.refcount = 0;
28065 1 : __pyx_pybuffernd_V.data = NULL;
28066 1 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
28067 1 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
28068 1 : __pyx_pybuffer_VV.refcount = 0;
28069 1 : __pyx_pybuffernd_VV.data = NULL;
28070 1 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
28071 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
28072 1 : __pyx_pybuffer_proj.refcount = 0;
28073 1 : __pyx_pybuffernd_proj.data = NULL;
28074 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
28075 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
28076 1 : __pyx_pybuffer_perms.refcount = 0;
28077 1 : __pyx_pybuffernd_perms.data = NULL;
28078 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
28079 1 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
28080 1 : __pyx_pybuffer_inds1.refcount = 0;
28081 1 : __pyx_pybuffernd_inds1.data = NULL;
28082 1 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
28083 1 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
28084 1 : __pyx_pybuffer_inds2.refcount = 0;
28085 1 : __pyx_pybuffernd_inds2.data = NULL;
28086 1 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
28087 1 : __pyx_pybuffer_p.pybuffer.buf = NULL;
28088 1 : __pyx_pybuffer_p.refcount = 0;
28089 1 : __pyx_pybuffernd_p.data = NULL;
28090 1 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
28091 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
28092 1 : __pyx_pybuffer_col.refcount = 0;
28093 1 : __pyx_pybuffernd_col.data = NULL;
28094 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
28095 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
28096 1 : __pyx_pybuffer_a.refcount = 0;
28097 1 : __pyx_pybuffernd_a.data = NULL;
28098 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
28099 : {
28100 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28101 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 490, __pyx_L1_error)
28102 : }
28103 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
28104 :
28105 : /* "scipy/linalg/_decomp_interpolative.pyx":491
28106 : *
28107 : * def iddp_asvd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng):
28108 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
28109 : * cdef int krank, info, ci
28110 : * cdef cnp.ndarray[cnp.float64_t, mode='fortran', ndim=2] C
28111 : */
28112 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
28113 1 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
28114 :
28115 : /* "scipy/linalg/_decomp_interpolative.pyx":507
28116 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] col
28117 : *
28118 : * krank, perms, proj = iddp_aid(a.copy(), eps, rng=rng) # <<<<<<<<<<<<<<
28119 : *
28120 : * if krank > 0:
28121 : */
28122 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_iddp_aid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
28123 1 : __Pyx_GOTREF(__pyx_t_1);
28124 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
28125 1 : __Pyx_GOTREF(__pyx_t_3);
28126 1 : __pyx_t_4 = NULL;
28127 1 : __pyx_t_5 = 0;
28128 : #if CYTHON_UNPACK_METHODS
28129 1 : if (likely(PyMethod_Check(__pyx_t_3))) {
28130 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
28131 0 : if (likely(__pyx_t_4)) {
28132 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
28133 0 : __Pyx_INCREF(__pyx_t_4);
28134 0 : __Pyx_INCREF(function);
28135 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
28136 : __pyx_t_5 = 1;
28137 : }
28138 : }
28139 : #endif
28140 : {
28141 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
28142 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
28143 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28144 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
28145 1 : __Pyx_GOTREF(__pyx_t_2);
28146 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28147 : }
28148 1 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
28149 1 : __Pyx_GOTREF(__pyx_t_3);
28150 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
28151 1 : __Pyx_GOTREF(__pyx_t_4);
28152 1 : __Pyx_GIVEREF(__pyx_t_2);
28153 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error);
28154 1 : __Pyx_GIVEREF(__pyx_t_3);
28155 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error);
28156 1 : __pyx_t_2 = 0;
28157 1 : __pyx_t_3 = 0;
28158 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
28159 1 : __Pyx_GOTREF(__pyx_t_3);
28160 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
28161 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
28162 1 : __Pyx_GOTREF(__pyx_t_2);
28163 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28164 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28165 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28166 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
28167 1 : PyObject* sequence = __pyx_t_2;
28168 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
28169 1 : if (unlikely(size != 3)) {
28170 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
28171 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
28172 0 : __PYX_ERR(0, 507, __pyx_L1_error)
28173 : }
28174 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28175 1 : if (likely(PyTuple_CheckExact(sequence))) {
28176 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
28177 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
28178 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
28179 : } else {
28180 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
28181 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
28182 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
28183 : }
28184 1 : __Pyx_INCREF(__pyx_t_3);
28185 1 : __Pyx_INCREF(__pyx_t_4);
28186 1 : __Pyx_INCREF(__pyx_t_1);
28187 : #else
28188 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
28189 : __Pyx_GOTREF(__pyx_t_3);
28190 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
28191 : __Pyx_GOTREF(__pyx_t_4);
28192 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
28193 : __Pyx_GOTREF(__pyx_t_1);
28194 : #endif
28195 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28196 : } else {
28197 0 : Py_ssize_t index = -1;
28198 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
28199 0 : __Pyx_GOTREF(__pyx_t_6);
28200 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28201 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
28202 0 : index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
28203 0 : __Pyx_GOTREF(__pyx_t_3);
28204 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
28205 0 : __Pyx_GOTREF(__pyx_t_4);
28206 0 : index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
28207 0 : __Pyx_GOTREF(__pyx_t_1);
28208 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
28209 0 : __pyx_t_7 = NULL;
28210 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28211 0 : goto __pyx_L4_unpacking_done;
28212 0 : __pyx_L3_unpacking_failed:;
28213 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28214 0 : __pyx_t_7 = NULL;
28215 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
28216 0 : __PYX_ERR(0, 507, __pyx_L1_error)
28217 0 : __pyx_L4_unpacking_done:;
28218 : }
28219 1 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
28220 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28221 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 507, __pyx_L1_error)
28222 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 507, __pyx_L1_error)
28223 1 : __pyx_v_krank = __pyx_t_8;
28224 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
28225 : {
28226 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28227 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
28228 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
28229 1 : if (unlikely(__pyx_t_8 < 0)) {
28230 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
28231 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
28232 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
28233 : __Pyx_RaiseBufferFallbackError();
28234 : } else {
28235 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
28236 : }
28237 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
28238 : }
28239 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
28240 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 507, __pyx_L1_error)
28241 : }
28242 1 : __pyx_t_9 = 0;
28243 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_4);
28244 1 : __pyx_t_4 = 0;
28245 1 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
28246 : {
28247 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28248 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
28249 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
28250 1 : if (unlikely(__pyx_t_8 < 0)) {
28251 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
28252 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
28253 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
28254 : __Pyx_RaiseBufferFallbackError();
28255 : } else {
28256 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
28257 : }
28258 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
28259 : }
28260 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
28261 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 507, __pyx_L1_error)
28262 : }
28263 1 : __pyx_t_13 = 0;
28264 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_1);
28265 1 : __pyx_t_1 = 0;
28266 :
28267 : /* "scipy/linalg/_decomp_interpolative.pyx":509
28268 : * krank, perms, proj = iddp_aid(a.copy(), eps, rng=rng)
28269 : *
28270 : * if krank > 0: # <<<<<<<<<<<<<<
28271 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
28272 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
28273 : */
28274 1 : __pyx_t_14 = (__pyx_v_krank > 0);
28275 1 : if (__pyx_t_14) {
28276 :
28277 : /* "scipy/linalg/_decomp_interpolative.pyx":510
28278 : *
28279 : * if krank > 0:
28280 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
28281 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
28282 : *
28283 : */
28284 1 : __pyx_t_15[0] = __pyx_v_m;
28285 1 : __pyx_t_15[1] = __pyx_v_krank;
28286 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_15, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
28287 1 : __Pyx_GOTREF(__pyx_t_2);
28288 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 510, __pyx_L1_error)
28289 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
28290 : {
28291 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28292 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
28293 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
28294 1 : if (unlikely(__pyx_t_8 < 0)) {
28295 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
28296 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
28297 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
28298 : __Pyx_RaiseBufferFallbackError();
28299 : } else {
28300 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
28301 : }
28302 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
28303 : }
28304 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
28305 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 510, __pyx_L1_error)
28306 : }
28307 1 : __pyx_t_16 = 0;
28308 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
28309 1 : __pyx_t_2 = 0;
28310 :
28311 : /* "scipy/linalg/_decomp_interpolative.pyx":511
28312 : * if krank > 0:
28313 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
28314 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
28315 : *
28316 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
28317 : */
28318 1 : __pyx_t_17[0] = __pyx_v_n;
28319 1 : __pyx_t_17[1] = __pyx_v_krank;
28320 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_17, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
28321 1 : __Pyx_GOTREF(__pyx_t_2);
28322 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 511, __pyx_L1_error)
28323 1 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_2);
28324 : {
28325 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28326 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
28327 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
28328 1 : if (unlikely(__pyx_t_8 < 0)) {
28329 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
28330 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
28331 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
28332 : __Pyx_RaiseBufferFallbackError();
28333 : } else {
28334 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
28335 : }
28336 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
28337 : }
28338 1 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
28339 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 511, __pyx_L1_error)
28340 : }
28341 1 : __pyx_t_18 = 0;
28342 1 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_2);
28343 1 : __pyx_t_2 = 0;
28344 :
28345 : /* "scipy/linalg/_decomp_interpolative.pyx":513
28346 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
28347 : *
28348 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
28349 : * col = a[:, perms[:krank]].copy()
28350 : *
28351 : */
28352 1 : __pyx_t_19[0] = __pyx_v_krank;
28353 1 : __pyx_t_19[1] = __pyx_v_n;
28354 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_19, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
28355 1 : __Pyx_GOTREF(__pyx_t_2);
28356 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 513, __pyx_L1_error)
28357 1 : __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
28358 : {
28359 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28360 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
28361 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
28362 1 : if (unlikely(__pyx_t_8 < 0)) {
28363 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
28364 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
28365 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
28366 : __Pyx_RaiseBufferFallbackError();
28367 : } else {
28368 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
28369 : }
28370 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
28371 : }
28372 1 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
28373 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 513, __pyx_L1_error)
28374 : }
28375 1 : __pyx_t_20 = 0;
28376 1 : __pyx_v_p = ((PyArrayObject *)__pyx_t_2);
28377 1 : __pyx_t_2 = 0;
28378 :
28379 : /* "scipy/linalg/_decomp_interpolative.pyx":514
28380 : *
28381 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
28382 : * col = a[:, perms[:krank]].copy() # <<<<<<<<<<<<<<
28383 : *
28384 : * # idd_reconint
28385 : */
28386 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
28387 1 : __Pyx_GOTREF(__pyx_t_1);
28388 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
28389 1 : __Pyx_GOTREF(__pyx_t_4);
28390 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28391 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
28392 1 : __Pyx_GOTREF(__pyx_t_1);
28393 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28394 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
28395 1 : __Pyx_GOTREF(__pyx_t_4);
28396 1 : __Pyx_INCREF(__pyx_slice__5);
28397 1 : __Pyx_GIVEREF(__pyx_slice__5);
28398 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 514, __pyx_L1_error);
28399 1 : __Pyx_GIVEREF(__pyx_t_1);
28400 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error);
28401 1 : __pyx_t_1 = 0;
28402 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
28403 1 : __Pyx_GOTREF(__pyx_t_1);
28404 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28405 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
28406 1 : __Pyx_GOTREF(__pyx_t_4);
28407 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28408 1 : __pyx_t_1 = NULL;
28409 1 : __pyx_t_5 = 0;
28410 : #if CYTHON_UNPACK_METHODS
28411 1 : if (likely(PyMethod_Check(__pyx_t_4))) {
28412 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
28413 0 : if (likely(__pyx_t_1)) {
28414 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28415 0 : __Pyx_INCREF(__pyx_t_1);
28416 0 : __Pyx_INCREF(function);
28417 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
28418 : __pyx_t_5 = 1;
28419 : }
28420 : }
28421 : #endif
28422 : {
28423 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
28424 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
28425 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28426 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
28427 1 : __Pyx_GOTREF(__pyx_t_2);
28428 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28429 : }
28430 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 514, __pyx_L1_error)
28431 1 : __pyx_t_21 = ((PyArrayObject *)__pyx_t_2);
28432 : {
28433 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28434 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
28435 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
28436 1 : if (unlikely(__pyx_t_8 < 0)) {
28437 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
28438 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
28439 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
28440 : __Pyx_RaiseBufferFallbackError();
28441 : } else {
28442 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
28443 : }
28444 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
28445 : }
28446 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
28447 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 514, __pyx_L1_error)
28448 : }
28449 1 : __pyx_t_21 = 0;
28450 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_2);
28451 1 : __pyx_t_2 = 0;
28452 :
28453 : /* "scipy/linalg/_decomp_interpolative.pyx":517
28454 : *
28455 : * # idd_reconint
28456 : * for ci in range(krank): # <<<<<<<<<<<<<<
28457 : * p[ci, perms[ci]] = 1.0
28458 : *
28459 : */
28460 1 : __pyx_t_8 = __pyx_v_krank;
28461 1 : __pyx_t_22 = __pyx_t_8;
28462 20 : for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
28463 19 : __pyx_v_ci = __pyx_t_23;
28464 :
28465 : /* "scipy/linalg/_decomp_interpolative.pyx":518
28466 : * # idd_reconint
28467 : * for ci in range(krank):
28468 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
28469 : *
28470 : * # p[np.arange(krank), perms[:krank]] = 1.
28471 : */
28472 19 : __pyx_t_24 = __pyx_v_ci;
28473 19 : __pyx_t_25 = __pyx_v_ci;
28474 19 : __pyx_t_26 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_perms.diminfo[0].strides));
28475 19 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_p.diminfo[1].strides) = 1.0;
28476 : }
28477 :
28478 : /* "scipy/linalg/_decomp_interpolative.pyx":521
28479 : *
28480 : * # p[np.arange(krank), perms[:krank]] = 1.
28481 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
28482 : *
28483 : * inds1, tau1 = iddr_qrpiv(col, krank)
28484 : */
28485 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
28486 1 : __Pyx_GOTREF(__pyx_t_2);
28487 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error)
28488 1 : __Pyx_GOTREF(__pyx_t_4);
28489 1 : __pyx_t_1 = PySlice_New(__pyx_t_4, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
28490 1 : __Pyx_GOTREF(__pyx_t_1);
28491 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28492 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error)
28493 1 : __Pyx_GOTREF(__pyx_t_4);
28494 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28495 1 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
28496 1 : __Pyx_GOTREF(__pyx_t_1);
28497 1 : __Pyx_INCREF(__pyx_slice__5);
28498 1 : __Pyx_GIVEREF(__pyx_slice__5);
28499 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 521, __pyx_L1_error);
28500 1 : __Pyx_GIVEREF(__pyx_t_4);
28501 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error);
28502 1 : __pyx_t_4 = 0;
28503 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 521, __pyx_L1_error)
28504 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28505 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28506 :
28507 : /* "scipy/linalg/_decomp_interpolative.pyx":523
28508 : * p[:, perms[krank:]] = proj[:, :]
28509 : *
28510 : * inds1, tau1 = iddr_qrpiv(col, krank) # <<<<<<<<<<<<<<
28511 : * # idd_rinqr and idd_rearr
28512 : * r = np.triu(col[:krank, :])
28513 : */
28514 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
28515 1 : __Pyx_GOTREF(__pyx_t_1);
28516 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
28517 1 : __Pyx_GOTREF(__pyx_t_4);
28518 1 : __pyx_t_3 = NULL;
28519 1 : __pyx_t_5 = 0;
28520 : #if CYTHON_UNPACK_METHODS
28521 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
28522 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
28523 0 : if (likely(__pyx_t_3)) {
28524 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
28525 0 : __Pyx_INCREF(__pyx_t_3);
28526 0 : __Pyx_INCREF(function);
28527 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
28528 : __pyx_t_5 = 1;
28529 : }
28530 : }
28531 : #endif
28532 : {
28533 1 : PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_col), __pyx_t_4};
28534 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
28535 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28536 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28537 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
28538 1 : __Pyx_GOTREF(__pyx_t_2);
28539 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28540 : }
28541 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
28542 1 : PyObject* sequence = __pyx_t_2;
28543 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
28544 1 : if (unlikely(size != 2)) {
28545 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
28546 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
28547 0 : __PYX_ERR(0, 523, __pyx_L1_error)
28548 : }
28549 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28550 1 : if (likely(PyTuple_CheckExact(sequence))) {
28551 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
28552 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
28553 : } else {
28554 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
28555 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
28556 : }
28557 1 : __Pyx_INCREF(__pyx_t_1);
28558 1 : __Pyx_INCREF(__pyx_t_4);
28559 : #else
28560 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
28561 : __Pyx_GOTREF(__pyx_t_1);
28562 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
28563 : __Pyx_GOTREF(__pyx_t_4);
28564 : #endif
28565 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28566 : } else {
28567 0 : Py_ssize_t index = -1;
28568 0 : __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
28569 0 : __Pyx_GOTREF(__pyx_t_3);
28570 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28571 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
28572 0 : index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
28573 0 : __Pyx_GOTREF(__pyx_t_1);
28574 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
28575 0 : __Pyx_GOTREF(__pyx_t_4);
28576 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
28577 0 : __pyx_t_7 = NULL;
28578 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28579 0 : goto __pyx_L9_unpacking_done;
28580 0 : __pyx_L8_unpacking_failed:;
28581 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28582 0 : __pyx_t_7 = NULL;
28583 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
28584 0 : __PYX_ERR(0, 523, __pyx_L1_error)
28585 0 : __pyx_L9_unpacking_done:;
28586 : }
28587 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 523, __pyx_L1_error)
28588 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 523, __pyx_L1_error)
28589 1 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_1);
28590 : {
28591 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28592 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
28593 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
28594 1 : if (unlikely(__pyx_t_8 < 0)) {
28595 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
28596 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
28597 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
28598 : __Pyx_RaiseBufferFallbackError();
28599 : } else {
28600 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
28601 : }
28602 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
28603 : }
28604 1 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
28605 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 523, __pyx_L1_error)
28606 : }
28607 1 : __pyx_t_27 = 0;
28608 1 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_1);
28609 1 : __pyx_t_1 = 0;
28610 1 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_4);
28611 : {
28612 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28613 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
28614 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
28615 1 : if (unlikely(__pyx_t_8 < 0)) {
28616 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
28617 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
28618 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
28619 : __Pyx_RaiseBufferFallbackError();
28620 : } else {
28621 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
28622 : }
28623 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
28624 : }
28625 1 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
28626 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 523, __pyx_L1_error)
28627 : }
28628 1 : __pyx_t_28 = 0;
28629 1 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_4);
28630 1 : __pyx_t_4 = 0;
28631 :
28632 : /* "scipy/linalg/_decomp_interpolative.pyx":525
28633 : * inds1, tau1 = iddr_qrpiv(col, krank)
28634 : * # idd_rinqr and idd_rearr
28635 : * r = np.triu(col[:krank, :]) # <<<<<<<<<<<<<<
28636 : * for ci in range(krank-1, -1, -1):
28637 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
28638 : */
28639 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
28640 1 : __Pyx_GOTREF(__pyx_t_4);
28641 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_triu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
28642 1 : __Pyx_GOTREF(__pyx_t_1);
28643 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28644 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
28645 1 : __Pyx_GOTREF(__pyx_t_4);
28646 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
28647 1 : __Pyx_GOTREF(__pyx_t_3);
28648 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28649 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
28650 1 : __Pyx_GOTREF(__pyx_t_4);
28651 1 : __Pyx_GIVEREF(__pyx_t_3);
28652 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error);
28653 1 : __Pyx_INCREF(__pyx_slice__5);
28654 1 : __Pyx_GIVEREF(__pyx_slice__5);
28655 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 525, __pyx_L1_error);
28656 1 : __pyx_t_3 = 0;
28657 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
28658 1 : __Pyx_GOTREF(__pyx_t_3);
28659 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28660 1 : __pyx_t_4 = NULL;
28661 1 : __pyx_t_5 = 0;
28662 : #if CYTHON_UNPACK_METHODS
28663 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
28664 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
28665 0 : if (likely(__pyx_t_4)) {
28666 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
28667 0 : __Pyx_INCREF(__pyx_t_4);
28668 0 : __Pyx_INCREF(function);
28669 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
28670 : __pyx_t_5 = 1;
28671 : }
28672 : }
28673 : #endif
28674 : {
28675 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
28676 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
28677 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28678 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28679 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
28680 1 : __Pyx_GOTREF(__pyx_t_2);
28681 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28682 : }
28683 1 : __pyx_v_r = __pyx_t_2;
28684 1 : __pyx_t_2 = 0;
28685 :
28686 : /* "scipy/linalg/_decomp_interpolative.pyx":526
28687 : * # idd_rinqr and idd_rearr
28688 : * r = np.triu(col[:krank, :])
28689 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
28690 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
28691 : *
28692 : */
28693 20 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
28694 19 : __pyx_v_ci = __pyx_t_8;
28695 :
28696 : /* "scipy/linalg/_decomp_interpolative.pyx":527
28697 : * r = np.triu(col[:krank, :])
28698 : * for ci in range(krank-1, -1, -1):
28699 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
28700 : *
28701 : * t = p.T.copy()
28702 : */
28703 19 : __pyx_t_24 = __pyx_v_ci;
28704 19 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
28705 19 : __Pyx_GOTREF(__pyx_t_2);
28706 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
28707 19 : __Pyx_GOTREF(__pyx_t_1);
28708 19 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
28709 19 : __Pyx_GOTREF(__pyx_t_3);
28710 19 : __Pyx_GIVEREF(__pyx_t_2);
28711 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error);
28712 19 : __Pyx_GIVEREF(__pyx_t_1);
28713 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error);
28714 19 : __pyx_t_2 = 0;
28715 19 : __pyx_t_1 = 0;
28716 19 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
28717 19 : __Pyx_GOTREF(__pyx_t_1);
28718 19 : __Pyx_INCREF(__pyx_slice__5);
28719 19 : __Pyx_GIVEREF(__pyx_slice__5);
28720 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 527, __pyx_L1_error);
28721 19 : __Pyx_GIVEREF(__pyx_t_3);
28722 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error);
28723 19 : __pyx_t_3 = 0;
28724 19 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
28725 19 : __Pyx_GOTREF(__pyx_t_3);
28726 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28727 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
28728 19 : __Pyx_GOTREF(__pyx_t_1);
28729 19 : __pyx_t_24 = __pyx_v_ci;
28730 19 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
28731 19 : __Pyx_GOTREF(__pyx_t_2);
28732 19 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
28733 19 : __Pyx_GOTREF(__pyx_t_4);
28734 19 : __Pyx_GIVEREF(__pyx_t_1);
28735 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error);
28736 19 : __Pyx_GIVEREF(__pyx_t_2);
28737 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error);
28738 19 : __pyx_t_1 = 0;
28739 19 : __pyx_t_2 = 0;
28740 19 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
28741 19 : __Pyx_GOTREF(__pyx_t_2);
28742 19 : __Pyx_INCREF(__pyx_slice__5);
28743 19 : __Pyx_GIVEREF(__pyx_slice__5);
28744 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 527, __pyx_L1_error);
28745 19 : __Pyx_GIVEREF(__pyx_t_4);
28746 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error);
28747 19 : __pyx_t_4 = 0;
28748 19 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_2, __pyx_t_3) < 0))) __PYX_ERR(0, 527, __pyx_L1_error)
28749 19 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28750 38 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28751 : }
28752 :
28753 : /* "scipy/linalg/_decomp_interpolative.pyx":529
28754 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
28755 : *
28756 : * t = p.T.copy() # <<<<<<<<<<<<<<
28757 : * inds2, tau2 = iddr_qrpiv(t, krank)
28758 : * r2 = np.triu(t[:krank, :])
28759 : */
28760 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
28761 1 : __Pyx_GOTREF(__pyx_t_2);
28762 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
28763 1 : __Pyx_GOTREF(__pyx_t_4);
28764 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28765 1 : __pyx_t_2 = NULL;
28766 1 : __pyx_t_5 = 0;
28767 : #if CYTHON_UNPACK_METHODS
28768 1 : if (likely(PyMethod_Check(__pyx_t_4))) {
28769 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
28770 0 : if (likely(__pyx_t_2)) {
28771 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28772 0 : __Pyx_INCREF(__pyx_t_2);
28773 0 : __Pyx_INCREF(function);
28774 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
28775 : __pyx_t_5 = 1;
28776 : }
28777 : }
28778 : #endif
28779 : {
28780 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
28781 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
28782 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28783 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
28784 1 : __Pyx_GOTREF(__pyx_t_3);
28785 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28786 : }
28787 1 : __pyx_v_t = __pyx_t_3;
28788 1 : __pyx_t_3 = 0;
28789 :
28790 : /* "scipy/linalg/_decomp_interpolative.pyx":530
28791 : *
28792 : * t = p.T.copy()
28793 : * inds2, tau2 = iddr_qrpiv(t, krank) # <<<<<<<<<<<<<<
28794 : * r2 = np.triu(t[:krank, :])
28795 : * for ci in range(krank-1, -1, -1):
28796 : */
28797 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
28798 1 : __Pyx_GOTREF(__pyx_t_4);
28799 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
28800 1 : __Pyx_GOTREF(__pyx_t_2);
28801 1 : __pyx_t_1 = NULL;
28802 1 : __pyx_t_5 = 0;
28803 : #if CYTHON_UNPACK_METHODS
28804 1 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
28805 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
28806 0 : if (likely(__pyx_t_1)) {
28807 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28808 0 : __Pyx_INCREF(__pyx_t_1);
28809 0 : __Pyx_INCREF(function);
28810 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
28811 : __pyx_t_5 = 1;
28812 : }
28813 : }
28814 : #endif
28815 : {
28816 1 : PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_t, __pyx_t_2};
28817 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
28818 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28819 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28820 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
28821 1 : __Pyx_GOTREF(__pyx_t_3);
28822 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28823 : }
28824 1 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
28825 1 : PyObject* sequence = __pyx_t_3;
28826 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
28827 1 : if (unlikely(size != 2)) {
28828 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
28829 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
28830 0 : __PYX_ERR(0, 530, __pyx_L1_error)
28831 : }
28832 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28833 1 : if (likely(PyTuple_CheckExact(sequence))) {
28834 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
28835 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
28836 : } else {
28837 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
28838 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
28839 : }
28840 1 : __Pyx_INCREF(__pyx_t_4);
28841 1 : __Pyx_INCREF(__pyx_t_2);
28842 : #else
28843 : __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
28844 : __Pyx_GOTREF(__pyx_t_4);
28845 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
28846 : __Pyx_GOTREF(__pyx_t_2);
28847 : #endif
28848 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28849 : } else {
28850 0 : Py_ssize_t index = -1;
28851 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
28852 0 : __Pyx_GOTREF(__pyx_t_1);
28853 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28854 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
28855 0 : index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed;
28856 0 : __Pyx_GOTREF(__pyx_t_4);
28857 0 : index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed;
28858 0 : __Pyx_GOTREF(__pyx_t_2);
28859 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_1), 2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
28860 0 : __pyx_t_7 = NULL;
28861 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28862 0 : goto __pyx_L13_unpacking_done;
28863 0 : __pyx_L12_unpacking_failed:;
28864 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28865 0 : __pyx_t_7 = NULL;
28866 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
28867 0 : __PYX_ERR(0, 530, __pyx_L1_error)
28868 0 : __pyx_L13_unpacking_done:;
28869 : }
28870 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 530, __pyx_L1_error)
28871 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 530, __pyx_L1_error)
28872 1 : __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
28873 : {
28874 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28875 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
28876 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
28877 1 : if (unlikely(__pyx_t_8 < 0)) {
28878 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
28879 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
28880 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
28881 : __Pyx_RaiseBufferFallbackError();
28882 : } else {
28883 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
28884 : }
28885 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
28886 : }
28887 1 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
28888 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 530, __pyx_L1_error)
28889 : }
28890 1 : __pyx_t_29 = 0;
28891 1 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_4);
28892 1 : __pyx_t_4 = 0;
28893 1 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_2);
28894 : {
28895 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
28896 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
28897 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
28898 1 : if (unlikely(__pyx_t_8 < 0)) {
28899 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
28900 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
28901 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
28902 : __Pyx_RaiseBufferFallbackError();
28903 : } else {
28904 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
28905 : }
28906 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
28907 : }
28908 1 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
28909 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 530, __pyx_L1_error)
28910 : }
28911 1 : __pyx_t_30 = 0;
28912 1 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_2);
28913 1 : __pyx_t_2 = 0;
28914 :
28915 : /* "scipy/linalg/_decomp_interpolative.pyx":531
28916 : * t = p.T.copy()
28917 : * inds2, tau2 = iddr_qrpiv(t, krank)
28918 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
28919 : * for ci in range(krank-1, -1, -1):
28920 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
28921 : */
28922 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
28923 1 : __Pyx_GOTREF(__pyx_t_2);
28924 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_triu); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
28925 1 : __Pyx_GOTREF(__pyx_t_4);
28926 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28927 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
28928 1 : __Pyx_GOTREF(__pyx_t_2);
28929 1 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
28930 1 : __Pyx_GOTREF(__pyx_t_1);
28931 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28932 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
28933 1 : __Pyx_GOTREF(__pyx_t_2);
28934 1 : __Pyx_GIVEREF(__pyx_t_1);
28935 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error);
28936 1 : __Pyx_INCREF(__pyx_slice__5);
28937 1 : __Pyx_GIVEREF(__pyx_slice__5);
28938 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 531, __pyx_L1_error);
28939 1 : __pyx_t_1 = 0;
28940 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
28941 1 : __Pyx_GOTREF(__pyx_t_1);
28942 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28943 1 : __pyx_t_2 = NULL;
28944 1 : __pyx_t_5 = 0;
28945 : #if CYTHON_UNPACK_METHODS
28946 1 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
28947 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
28948 0 : if (likely(__pyx_t_2)) {
28949 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28950 0 : __Pyx_INCREF(__pyx_t_2);
28951 0 : __Pyx_INCREF(function);
28952 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
28953 : __pyx_t_5 = 1;
28954 : }
28955 : }
28956 : #endif
28957 : {
28958 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
28959 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
28960 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28961 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28962 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
28963 1 : __Pyx_GOTREF(__pyx_t_3);
28964 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28965 : }
28966 1 : __pyx_v_r2 = __pyx_t_3;
28967 1 : __pyx_t_3 = 0;
28968 :
28969 : /* "scipy/linalg/_decomp_interpolative.pyx":532
28970 : * inds2, tau2 = iddr_qrpiv(t, krank)
28971 : * r2 = np.triu(t[:krank, :])
28972 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
28973 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
28974 : *
28975 : */
28976 20 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
28977 19 : __pyx_v_ci = __pyx_t_8;
28978 :
28979 : /* "scipy/linalg/_decomp_interpolative.pyx":533
28980 : * r2 = np.triu(t[:krank, :])
28981 : * for ci in range(krank-1, -1, -1):
28982 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
28983 : *
28984 : * r3 = r @ r2.T
28985 : */
28986 19 : __pyx_t_24 = __pyx_v_ci;
28987 19 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
28988 19 : __Pyx_GOTREF(__pyx_t_3);
28989 19 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
28990 19 : __Pyx_GOTREF(__pyx_t_4);
28991 19 : __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
28992 19 : __Pyx_GOTREF(__pyx_t_1);
28993 19 : __Pyx_GIVEREF(__pyx_t_3);
28994 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error);
28995 19 : __Pyx_GIVEREF(__pyx_t_4);
28996 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error);
28997 19 : __pyx_t_3 = 0;
28998 19 : __pyx_t_4 = 0;
28999 19 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
29000 19 : __Pyx_GOTREF(__pyx_t_4);
29001 19 : __Pyx_INCREF(__pyx_slice__5);
29002 19 : __Pyx_GIVEREF(__pyx_slice__5);
29003 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 533, __pyx_L1_error);
29004 19 : __Pyx_GIVEREF(__pyx_t_1);
29005 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error);
29006 19 : __pyx_t_1 = 0;
29007 19 : __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
29008 19 : __Pyx_GOTREF(__pyx_t_1);
29009 19 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29010 19 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
29011 19 : __Pyx_GOTREF(__pyx_t_4);
29012 19 : __pyx_t_24 = __pyx_v_ci;
29013 19 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
29014 19 : __Pyx_GOTREF(__pyx_t_3);
29015 19 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
29016 19 : __Pyx_GOTREF(__pyx_t_2);
29017 19 : __Pyx_GIVEREF(__pyx_t_4);
29018 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error);
29019 19 : __Pyx_GIVEREF(__pyx_t_3);
29020 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error);
29021 19 : __pyx_t_4 = 0;
29022 19 : __pyx_t_3 = 0;
29023 19 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
29024 19 : __Pyx_GOTREF(__pyx_t_3);
29025 19 : __Pyx_INCREF(__pyx_slice__5);
29026 19 : __Pyx_GIVEREF(__pyx_slice__5);
29027 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 533, __pyx_L1_error);
29028 19 : __Pyx_GIVEREF(__pyx_t_2);
29029 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error);
29030 19 : __pyx_t_2 = 0;
29031 19 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(0, 533, __pyx_L1_error)
29032 19 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29033 38 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29034 : }
29035 :
29036 : /* "scipy/linalg/_decomp_interpolative.pyx":535
29037 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
29038 : *
29039 : * r3 = r @ r2.T # <<<<<<<<<<<<<<
29040 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False)
29041 : *
29042 : */
29043 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
29044 1 : __Pyx_GOTREF(__pyx_t_1);
29045 1 : __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
29046 1 : __Pyx_GOTREF(__pyx_t_3);
29047 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29048 1 : __pyx_v_r3 = __pyx_t_3;
29049 1 : __pyx_t_3 = 0;
29050 :
29051 : /* "scipy/linalg/_decomp_interpolative.pyx":536
29052 : *
29053 : * r3 = r @ r2.T
29054 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False) # <<<<<<<<<<<<<<
29055 : *
29056 : * # Apply Q of col to U from the left
29057 : */
29058 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_la); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
29059 1 : __Pyx_GOTREF(__pyx_t_3);
29060 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
29061 1 : __Pyx_GOTREF(__pyx_t_1);
29062 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29063 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
29064 1 : __Pyx_GOTREF(__pyx_t_3);
29065 1 : __Pyx_INCREF(__pyx_v_r3);
29066 1 : __Pyx_GIVEREF(__pyx_v_r3);
29067 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_r3)) __PYX_ERR(0, 536, __pyx_L1_error);
29068 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
29069 1 : __Pyx_GOTREF(__pyx_t_2);
29070 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
29071 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
29072 1 : __Pyx_GOTREF(__pyx_t_4);
29073 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29074 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29075 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29076 1 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
29077 1 : PyObject* sequence = __pyx_t_4;
29078 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29079 1 : if (unlikely(size != 3)) {
29080 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
29081 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29082 0 : __PYX_ERR(0, 536, __pyx_L1_error)
29083 : }
29084 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29085 1 : if (likely(PyTuple_CheckExact(sequence))) {
29086 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
29087 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
29088 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
29089 : } else {
29090 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
29091 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
29092 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
29093 : }
29094 1 : __Pyx_INCREF(__pyx_t_2);
29095 1 : __Pyx_INCREF(__pyx_t_3);
29096 1 : __Pyx_INCREF(__pyx_t_1);
29097 : #else
29098 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
29099 : __Pyx_GOTREF(__pyx_t_2);
29100 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
29101 : __Pyx_GOTREF(__pyx_t_3);
29102 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
29103 : __Pyx_GOTREF(__pyx_t_1);
29104 : #endif
29105 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29106 : } else {
29107 0 : Py_ssize_t index = -1;
29108 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
29109 0 : __Pyx_GOTREF(__pyx_t_6);
29110 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29111 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
29112 0 : index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L16_unpacking_failed;
29113 0 : __Pyx_GOTREF(__pyx_t_2);
29114 0 : index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed;
29115 0 : __Pyx_GOTREF(__pyx_t_3);
29116 0 : index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L16_unpacking_failed;
29117 0 : __Pyx_GOTREF(__pyx_t_1);
29118 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
29119 0 : __pyx_t_7 = NULL;
29120 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29121 0 : goto __pyx_L17_unpacking_done;
29122 0 : __pyx_L16_unpacking_failed:;
29123 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29124 0 : __pyx_t_7 = NULL;
29125 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
29126 0 : __PYX_ERR(0, 536, __pyx_L1_error)
29127 0 : __pyx_L17_unpacking_done:;
29128 : }
29129 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
29130 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
29131 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
29132 1 : __Pyx_GOTREF(__pyx_t_6);
29133 1 : __pyx_t_31 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 536, __pyx_L1_error)
29134 1 : __Pyx_GOTREF(__pyx_t_31);
29135 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29136 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
29137 1 : __Pyx_GOTREF(__pyx_t_6);
29138 1 : __pyx_t_32 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 536, __pyx_L1_error)
29139 1 : __Pyx_GOTREF(__pyx_t_32);
29140 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29141 1 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
29142 1 : __Pyx_GOTREF(__pyx_t_6);
29143 1 : __Pyx_GIVEREF(__pyx_t_31);
29144 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_31)) __PYX_ERR(0, 536, __pyx_L1_error);
29145 1 : __Pyx_GIVEREF(__pyx_t_32);
29146 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_32)) __PYX_ERR(0, 536, __pyx_L1_error);
29147 1 : __pyx_t_31 = 0;
29148 1 : __pyx_t_32 = 0;
29149 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_6, __pyx_t_2) < 0))) __PYX_ERR(0, 536, __pyx_L1_error)
29150 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29151 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29152 1 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_3);
29153 : {
29154 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
29155 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
29156 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
29157 1 : if (unlikely(__pyx_t_8 < 0)) {
29158 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
29159 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
29160 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
29161 : __Pyx_RaiseBufferFallbackError();
29162 : } else {
29163 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
29164 : }
29165 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
29166 : }
29167 1 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
29168 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 536, __pyx_L1_error)
29169 : }
29170 1 : __pyx_t_33 = 0;
29171 1 : __pyx_v_S = ((PyArrayObject *)__pyx_t_3);
29172 1 : __pyx_t_3 = 0;
29173 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_1);
29174 : {
29175 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
29176 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
29177 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
29178 1 : if (unlikely(__pyx_t_8 < 0)) {
29179 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
29180 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
29181 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
29182 : __Pyx_RaiseBufferFallbackError();
29183 : } else {
29184 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
29185 : }
29186 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
29187 : }
29188 1 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
29189 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 536, __pyx_L1_error)
29190 : }
29191 1 : __pyx_t_34 = 0;
29192 1 : __pyx_v_V = ((PyArrayObject *)__pyx_t_1);
29193 1 : __pyx_t_1 = 0;
29194 :
29195 : /* "scipy/linalg/_decomp_interpolative.pyx":539
29196 : *
29197 : * # Apply Q of col to U from the left
29198 : * C = col[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
29199 : * dorm2r(<char*>'R', <char*>'T',
29200 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
29201 : */
29202 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
29203 1 : __Pyx_GOTREF(__pyx_t_4);
29204 1 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
29205 1 : __Pyx_GOTREF(__pyx_t_1);
29206 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29207 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
29208 1 : __Pyx_GOTREF(__pyx_t_4);
29209 1 : __Pyx_INCREF(__pyx_slice__5);
29210 1 : __Pyx_GIVEREF(__pyx_slice__5);
29211 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 539, __pyx_L1_error);
29212 1 : __Pyx_GIVEREF(__pyx_t_1);
29213 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error);
29214 1 : __pyx_t_1 = 0;
29215 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
29216 1 : __Pyx_GOTREF(__pyx_t_1);
29217 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29218 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
29219 1 : __Pyx_GOTREF(__pyx_t_4);
29220 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29221 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
29222 1 : __Pyx_GOTREF(__pyx_t_1);
29223 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
29224 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
29225 1 : __Pyx_GOTREF(__pyx_t_3);
29226 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29227 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29228 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 539, __pyx_L1_error)
29229 1 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_3);
29230 : {
29231 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
29232 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
29233 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
29234 1 : if (unlikely(__pyx_t_8 < 0)) {
29235 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
29236 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
29237 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
29238 : __Pyx_RaiseBufferFallbackError();
29239 : } else {
29240 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
29241 : }
29242 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
29243 : }
29244 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
29245 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 539, __pyx_L1_error)
29246 : }
29247 1 : __pyx_t_35 = 0;
29248 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_3);
29249 1 : __pyx_t_3 = 0;
29250 :
29251 : /* "scipy/linalg/_decomp_interpolative.pyx":541
29252 : * C = col[:, :krank].copy(order='F')
29253 : * dorm2r(<char*>'R', <char*>'T',
29254 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
29255 : * &UU[0,0], &krank, &a[0, 0], &info)
29256 : *
29257 : */
29258 1 : __pyx_t_24 = 0;
29259 1 : __pyx_t_25 = 0;
29260 1 : __pyx_t_36 = 0;
29261 :
29262 : /* "scipy/linalg/_decomp_interpolative.pyx":542
29263 : * dorm2r(<char*>'R', <char*>'T',
29264 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
29265 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
29266 : *
29267 : * VV[:krank, :krank] = V[:, :].T
29268 : */
29269 1 : __pyx_t_37 = 0;
29270 1 : __pyx_t_38 = 0;
29271 1 : __pyx_t_39 = 0;
29272 1 : __pyx_t_40 = 0;
29273 :
29274 : /* "scipy/linalg/_decomp_interpolative.pyx":540
29275 : * # Apply Q of col to U from the left
29276 : * C = col[:, :krank].copy(order='F')
29277 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
29278 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
29279 : * &UU[0,0], &krank, &a[0, 0], &info)
29280 : */
29281 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
29282 :
29283 : /* "scipy/linalg/_decomp_interpolative.pyx":544
29284 : * &UU[0,0], &krank, &a[0, 0], &info)
29285 : *
29286 : * VV[:krank, :krank] = V[:, :].T # <<<<<<<<<<<<<<
29287 : * # Apply Q of t to V from the left
29288 : * C = t[:, :krank].copy(order='F')
29289 : */
29290 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
29291 1 : __Pyx_GOTREF(__pyx_t_3);
29292 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
29293 1 : __Pyx_GOTREF(__pyx_t_1);
29294 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29295 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
29296 1 : __Pyx_GOTREF(__pyx_t_3);
29297 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
29298 1 : __Pyx_GOTREF(__pyx_t_4);
29299 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29300 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
29301 1 : __Pyx_GOTREF(__pyx_t_3);
29302 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
29303 1 : __Pyx_GOTREF(__pyx_t_2);
29304 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29305 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
29306 1 : __Pyx_GOTREF(__pyx_t_3);
29307 1 : __Pyx_GIVEREF(__pyx_t_4);
29308 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error);
29309 1 : __Pyx_GIVEREF(__pyx_t_2);
29310 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error);
29311 1 : __pyx_t_4 = 0;
29312 1 : __pyx_t_2 = 0;
29313 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(0, 544, __pyx_L1_error)
29314 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29315 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29316 :
29317 : /* "scipy/linalg/_decomp_interpolative.pyx":546
29318 : * VV[:krank, :krank] = V[:, :].T
29319 : * # Apply Q of t to V from the left
29320 : * C = t[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
29321 : * dorm2r(<char*>'R', <char*>'T',
29322 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
29323 : */
29324 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
29325 1 : __Pyx_GOTREF(__pyx_t_1);
29326 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
29327 1 : __Pyx_GOTREF(__pyx_t_3);
29328 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29329 1 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
29330 1 : __Pyx_GOTREF(__pyx_t_1);
29331 1 : __Pyx_INCREF(__pyx_slice__5);
29332 1 : __Pyx_GIVEREF(__pyx_slice__5);
29333 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 546, __pyx_L1_error);
29334 1 : __Pyx_GIVEREF(__pyx_t_3);
29335 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error);
29336 1 : __pyx_t_3 = 0;
29337 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
29338 1 : __Pyx_GOTREF(__pyx_t_3);
29339 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29340 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
29341 1 : __Pyx_GOTREF(__pyx_t_1);
29342 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29343 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
29344 1 : __Pyx_GOTREF(__pyx_t_3);
29345 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
29346 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
29347 1 : __Pyx_GOTREF(__pyx_t_2);
29348 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29349 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29350 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 546, __pyx_L1_error)
29351 1 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_2);
29352 : {
29353 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
29354 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
29355 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
29356 1 : if (unlikely(__pyx_t_8 < 0)) {
29357 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
29358 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
29359 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
29360 0 : __Pyx_RaiseBufferFallbackError();
29361 : } else {
29362 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
29363 : }
29364 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
29365 : }
29366 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
29367 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 546, __pyx_L1_error)
29368 : }
29369 1 : __pyx_t_35 = 0;
29370 1 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_2));
29371 1 : __pyx_t_2 = 0;
29372 :
29373 : /* "scipy/linalg/_decomp_interpolative.pyx":548
29374 : * C = t[:, :krank].copy(order='F')
29375 : * dorm2r(<char*>'R', <char*>'T',
29376 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
29377 : * &VV[0, 0], &krank, &a[0, 0], &info)
29378 : *
29379 : */
29380 1 : __pyx_t_40 = 0;
29381 1 : __pyx_t_39 = 0;
29382 1 : __pyx_t_38 = 0;
29383 :
29384 : /* "scipy/linalg/_decomp_interpolative.pyx":549
29385 : * dorm2r(<char*>'R', <char*>'T',
29386 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
29387 : * &VV[0, 0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
29388 : *
29389 : * return UU, S, VV
29390 : */
29391 1 : __pyx_t_37 = 0;
29392 1 : __pyx_t_36 = 0;
29393 1 : __pyx_t_25 = 0;
29394 1 : __pyx_t_24 = 0;
29395 :
29396 : /* "scipy/linalg/_decomp_interpolative.pyx":547
29397 : * # Apply Q of t to V from the left
29398 : * C = t[:, :krank].copy(order='F')
29399 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
29400 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
29401 : * &VV[0, 0], &krank, &a[0, 0], &info)
29402 : */
29403 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
29404 :
29405 : /* "scipy/linalg/_decomp_interpolative.pyx":509
29406 : * krank, perms, proj = iddp_aid(a.copy(), eps, rng=rng)
29407 : *
29408 : * if krank > 0: # <<<<<<<<<<<<<<
29409 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
29410 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
29411 : */
29412 : }
29413 :
29414 : /* "scipy/linalg/_decomp_interpolative.pyx":551
29415 : * &VV[0, 0], &krank, &a[0, 0], &info)
29416 : *
29417 : * return UU, S, VV # <<<<<<<<<<<<<<
29418 : *
29419 : *
29420 : */
29421 1 : __Pyx_XDECREF(__pyx_r);
29422 1 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
29423 1 : __Pyx_GOTREF(__pyx_t_2);
29424 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
29425 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
29426 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 551, __pyx_L1_error);
29427 1 : __Pyx_INCREF((PyObject *)__pyx_v_S);
29428 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
29429 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 551, __pyx_L1_error);
29430 1 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
29431 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
29432 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 551, __pyx_L1_error);
29433 1 : __pyx_r = __pyx_t_2;
29434 1 : __pyx_t_2 = 0;
29435 1 : goto __pyx_L0;
29436 :
29437 : /* "scipy/linalg/_decomp_interpolative.pyx":490
29438 : *
29439 : *
29440 : * def iddp_asvd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
29441 : * cdef int m = a.shape[0], n = a.shape[1]
29442 : * cdef int krank, info, ci
29443 : */
29444 :
29445 : /* function exit code */
29446 0 : __pyx_L1_error:;
29447 0 : __Pyx_XDECREF(__pyx_t_1);
29448 0 : __Pyx_XDECREF(__pyx_t_2);
29449 0 : __Pyx_XDECREF(__pyx_t_3);
29450 0 : __Pyx_XDECREF(__pyx_t_4);
29451 0 : __Pyx_XDECREF(__pyx_t_6);
29452 0 : __Pyx_XDECREF(__pyx_t_31);
29453 0 : __Pyx_XDECREF(__pyx_t_32);
29454 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
29455 0 : __Pyx_PyThreadState_declare
29456 0 : __Pyx_PyThreadState_assign
29457 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
29458 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
29459 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
29460 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
29461 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
29462 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
29463 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
29464 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
29465 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
29466 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
29467 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
29468 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
29469 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
29470 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
29471 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
29472 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
29473 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
29474 0 : __pyx_r = NULL;
29475 0 : goto __pyx_L2;
29476 1 : __pyx_L0:;
29477 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
29478 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
29479 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
29480 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
29481 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
29482 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
29483 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
29484 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
29485 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
29486 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
29487 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
29488 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
29489 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
29490 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
29491 1 : __pyx_L2:;
29492 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
29493 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
29494 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
29495 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
29496 1 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
29497 1 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
29498 1 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
29499 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
29500 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
29501 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
29502 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
29503 1 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
29504 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
29505 1 : __Pyx_XDECREF(__pyx_v_r);
29506 1 : __Pyx_XDECREF(__pyx_v_t);
29507 1 : __Pyx_XDECREF(__pyx_v_r2);
29508 1 : __Pyx_XDECREF(__pyx_v_r3);
29509 1 : __Pyx_XGIVEREF(__pyx_r);
29510 1 : __Pyx_RefNannyFinishContext();
29511 1 : return __pyx_r;
29512 : }
29513 :
29514 : /* "scipy/linalg/_decomp_interpolative.pyx":554
29515 : *
29516 : *
29517 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
29518 : * cdef int n = a.shape[1], krank, tmp_int, p
29519 : * cdef cnp.float64_t one = 1
29520 : */
29521 :
29522 : /* Python wrapper */
29523 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_17iddp_id(PyObject *__pyx_self,
29524 : #if CYTHON_METH_FASTCALL
29525 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
29526 : #else
29527 : PyObject *__pyx_args, PyObject *__pyx_kwds
29528 : #endif
29529 : ); /*proto*/
29530 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_17iddp_id = {"iddp_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_17iddp_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
29531 8 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_17iddp_id(PyObject *__pyx_self,
29532 : #if CYTHON_METH_FASTCALL
29533 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
29534 : #else
29535 : PyObject *__pyx_args, PyObject *__pyx_kwds
29536 : #endif
29537 : ) {
29538 8 : PyArrayObject *__pyx_v_a = 0;
29539 8 : double __pyx_v_eps;
29540 : #if !CYTHON_METH_FASTCALL
29541 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
29542 : #endif
29543 8 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
29544 8 : PyObject* values[2] = {0,0};
29545 8 : int __pyx_lineno = 0;
29546 8 : const char *__pyx_filename = NULL;
29547 8 : int __pyx_clineno = 0;
29548 8 : PyObject *__pyx_r = 0;
29549 : __Pyx_RefNannyDeclarations
29550 8 : __Pyx_RefNannySetupContext("iddp_id (wrapper)", 0);
29551 : #if !CYTHON_METH_FASTCALL
29552 : #if CYTHON_ASSUME_SAFE_MACROS
29553 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
29554 : #else
29555 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
29556 : #endif
29557 : #endif
29558 8 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
29559 : {
29560 8 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
29561 8 : if (__pyx_kwds) {
29562 4 : Py_ssize_t kw_args;
29563 4 : switch (__pyx_nargs) {
29564 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
29565 4 : CYTHON_FALLTHROUGH;
29566 4 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
29567 4 : CYTHON_FALLTHROUGH;
29568 4 : case 0: break;
29569 0 : default: goto __pyx_L5_argtuple_error;
29570 : }
29571 4 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
29572 4 : switch (__pyx_nargs) {
29573 : case 0:
29574 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
29575 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
29576 0 : kw_args--;
29577 : }
29578 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error)
29579 0 : else goto __pyx_L5_argtuple_error;
29580 4 : CYTHON_FALLTHROUGH;
29581 : case 1:
29582 4 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
29583 4 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
29584 4 : kw_args--;
29585 : }
29586 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error)
29587 : else {
29588 0 : __Pyx_RaiseArgtupleInvalid("iddp_id", 1, 2, 2, 1); __PYX_ERR(0, 554, __pyx_L3_error)
29589 : }
29590 : }
29591 4 : if (unlikely(kw_args > 0)) {
29592 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
29593 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_id") < 0)) __PYX_ERR(0, 554, __pyx_L3_error)
29594 : }
29595 4 : } else if (unlikely(__pyx_nargs != 2)) {
29596 0 : goto __pyx_L5_argtuple_error;
29597 : } else {
29598 4 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
29599 4 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
29600 : }
29601 8 : __pyx_v_a = ((PyArrayObject *)values[0]);
29602 8 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error)
29603 : }
29604 8 : goto __pyx_L6_skip;
29605 0 : __pyx_L5_argtuple_error:;
29606 0 : __Pyx_RaiseArgtupleInvalid("iddp_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error)
29607 8 : __pyx_L6_skip:;
29608 8 : goto __pyx_L4_argument_unpacking_done;
29609 0 : __pyx_L3_error:;
29610 : {
29611 0 : Py_ssize_t __pyx_temp;
29612 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
29613 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
29614 : }
29615 : }
29616 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
29617 0 : __Pyx_RefNannyFinishContext();
29618 0 : return NULL;
29619 8 : __pyx_L4_argument_unpacking_done:;
29620 8 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 554, __pyx_L1_error)
29621 8 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_16iddp_id(__pyx_self, __pyx_v_a, __pyx_v_eps);
29622 :
29623 : /* function exit code */
29624 8 : goto __pyx_L0;
29625 0 : __pyx_L1_error:;
29626 0 : __pyx_r = NULL;
29627 8 : __pyx_L0:;
29628 : {
29629 8 : Py_ssize_t __pyx_temp;
29630 8 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
29631 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
29632 : }
29633 : }
29634 : __Pyx_RefNannyFinishContext();
29635 : return __pyx_r;
29636 : }
29637 :
29638 8 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_16iddp_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps) {
29639 8 : int __pyx_v_n;
29640 8 : int __pyx_v_krank;
29641 8 : int __pyx_v_tmp_int;
29642 8 : int __pyx_v_p;
29643 8 : __pyx_t_5numpy_float64_t __pyx_v_one;
29644 8 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
29645 8 : PyObject *__pyx_v_inds = NULL;
29646 8 : PyObject *__pyx_v_perms = NULL;
29647 8 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
29648 8 : __Pyx_Buffer __pyx_pybuffer_a;
29649 8 : PyObject *__pyx_r = NULL;
29650 : __Pyx_RefNannyDeclarations
29651 8 : PyObject *__pyx_t_1 = NULL;
29652 8 : PyObject *__pyx_t_2 = NULL;
29653 8 : PyObject *__pyx_t_3 = NULL;
29654 8 : PyObject *__pyx_t_4 = NULL;
29655 8 : unsigned int __pyx_t_5;
29656 8 : PyObject *__pyx_t_6 = NULL;
29657 8 : PyObject *(*__pyx_t_7)(PyObject *);
29658 8 : int __pyx_t_8;
29659 8 : npy_intp __pyx_t_9[1];
29660 8 : int __pyx_t_10;
29661 8 : int __pyx_t_11;
29662 8 : int __pyx_t_12;
29663 8 : int __pyx_t_13;
29664 8 : Py_ssize_t __pyx_t_14;
29665 8 : Py_ssize_t __pyx_t_15;
29666 8 : Py_ssize_t __pyx_t_16;
29667 8 : Py_ssize_t __pyx_t_17;
29668 8 : int __pyx_lineno = 0;
29669 8 : const char *__pyx_filename = NULL;
29670 8 : int __pyx_clineno = 0;
29671 8 : __Pyx_RefNannySetupContext("iddp_id", 1);
29672 8 : __pyx_pybuffer_a.pybuffer.buf = NULL;
29673 8 : __pyx_pybuffer_a.refcount = 0;
29674 8 : __pyx_pybuffernd_a.data = NULL;
29675 8 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
29676 : {
29677 8 : __Pyx_BufFmt_StackElem __pyx_stack[1];
29678 8 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 554, __pyx_L1_error)
29679 : }
29680 8 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
29681 :
29682 : /* "scipy/linalg/_decomp_interpolative.pyx":555
29683 : *
29684 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float):
29685 : * cdef int n = a.shape[1], krank, tmp_int, p # <<<<<<<<<<<<<<
29686 : * cdef cnp.float64_t one = 1
29687 : * krank, _, inds = iddp_qrpiv(a, eps)
29688 : */
29689 8 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
29690 :
29691 : /* "scipy/linalg/_decomp_interpolative.pyx":556
29692 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float):
29693 : * cdef int n = a.shape[1], krank, tmp_int, p
29694 : * cdef cnp.float64_t one = 1 # <<<<<<<<<<<<<<
29695 : * krank, _, inds = iddp_qrpiv(a, eps)
29696 : *
29697 : */
29698 8 : __pyx_v_one = 1.0;
29699 :
29700 : /* "scipy/linalg/_decomp_interpolative.pyx":557
29701 : * cdef int n = a.shape[1], krank, tmp_int, p
29702 : * cdef cnp.float64_t one = 1
29703 : * krank, _, inds = iddp_qrpiv(a, eps) # <<<<<<<<<<<<<<
29704 : *
29705 : * # Change pivots to permutation
29706 : */
29707 8 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddp_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
29708 8 : __Pyx_GOTREF(__pyx_t_2);
29709 8 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
29710 8 : __Pyx_GOTREF(__pyx_t_3);
29711 8 : __pyx_t_4 = NULL;
29712 8 : __pyx_t_5 = 0;
29713 : #if CYTHON_UNPACK_METHODS
29714 8 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
29715 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
29716 0 : if (likely(__pyx_t_4)) {
29717 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29718 0 : __Pyx_INCREF(__pyx_t_4);
29719 0 : __Pyx_INCREF(function);
29720 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
29721 : __pyx_t_5 = 1;
29722 : }
29723 : }
29724 : #endif
29725 : {
29726 8 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
29727 8 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
29728 8 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29729 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29730 8 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
29731 8 : __Pyx_GOTREF(__pyx_t_1);
29732 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29733 : }
29734 8 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
29735 8 : PyObject* sequence = __pyx_t_1;
29736 8 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29737 8 : if (unlikely(size != 3)) {
29738 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
29739 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29740 0 : __PYX_ERR(0, 557, __pyx_L1_error)
29741 : }
29742 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29743 8 : if (likely(PyTuple_CheckExact(sequence))) {
29744 8 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
29745 8 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
29746 8 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
29747 : } else {
29748 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
29749 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
29750 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
29751 : }
29752 8 : __Pyx_INCREF(__pyx_t_2);
29753 8 : __Pyx_INCREF(__pyx_t_3);
29754 8 : __Pyx_INCREF(__pyx_t_4);
29755 : #else
29756 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
29757 : __Pyx_GOTREF(__pyx_t_2);
29758 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
29759 : __Pyx_GOTREF(__pyx_t_3);
29760 : __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
29761 : __Pyx_GOTREF(__pyx_t_4);
29762 : #endif
29763 8 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29764 : } else {
29765 0 : Py_ssize_t index = -1;
29766 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error)
29767 0 : __Pyx_GOTREF(__pyx_t_6);
29768 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29769 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
29770 0 : index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
29771 0 : __Pyx_GOTREF(__pyx_t_2);
29772 0 : index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
29773 0 : __Pyx_GOTREF(__pyx_t_3);
29774 0 : index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
29775 0 : __Pyx_GOTREF(__pyx_t_4);
29776 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
29777 0 : __pyx_t_7 = NULL;
29778 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29779 0 : goto __pyx_L4_unpacking_done;
29780 0 : __pyx_L3_unpacking_failed:;
29781 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29782 0 : __pyx_t_7 = NULL;
29783 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
29784 0 : __PYX_ERR(0, 557, __pyx_L1_error)
29785 0 : __pyx_L4_unpacking_done:;
29786 : }
29787 8 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L1_error)
29788 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29789 8 : __pyx_v_krank = __pyx_t_8;
29790 8 : __pyx_v__ = __pyx_t_3;
29791 8 : __pyx_t_3 = 0;
29792 8 : __pyx_v_inds = __pyx_t_4;
29793 8 : __pyx_t_4 = 0;
29794 :
29795 : /* "scipy/linalg/_decomp_interpolative.pyx":560
29796 : *
29797 : * # Change pivots to permutation
29798 : * perms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
29799 : * for p in range(n):
29800 : * perms[p] = p
29801 : */
29802 8 : __pyx_t_9[0] = __pyx_v_n;
29803 8 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_9, NPY_INT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
29804 8 : __Pyx_GOTREF(__pyx_t_1);
29805 8 : __pyx_v_perms = __pyx_t_1;
29806 8 : __pyx_t_1 = 0;
29807 :
29808 : /* "scipy/linalg/_decomp_interpolative.pyx":561
29809 : * # Change pivots to permutation
29810 : * perms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
29811 : * for p in range(n): # <<<<<<<<<<<<<<
29812 : * perms[p] = p
29813 : *
29814 : */
29815 8 : __pyx_t_8 = __pyx_v_n;
29816 8 : __pyx_t_10 = __pyx_t_8;
29817 1526 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
29818 1518 : __pyx_v_p = __pyx_t_11;
29819 :
29820 : /* "scipy/linalg/_decomp_interpolative.pyx":562
29821 : * perms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
29822 : * for p in range(n):
29823 : * perms[p] = p # <<<<<<<<<<<<<<
29824 : *
29825 : * if krank > 0:
29826 : */
29827 1518 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
29828 1518 : __Pyx_GOTREF(__pyx_t_1);
29829 1518 : if (unlikely((__Pyx_SetItemInt(__pyx_v_perms, __pyx_v_p, __pyx_t_1, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 562, __pyx_L1_error)
29830 1733 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29831 : }
29832 :
29833 : /* "scipy/linalg/_decomp_interpolative.pyx":564
29834 : * perms[p] = p
29835 : *
29836 : * if krank > 0: # <<<<<<<<<<<<<<
29837 : * for p in range(krank):
29838 : * # Apply pivots
29839 : */
29840 8 : __pyx_t_12 = (__pyx_v_krank > 0);
29841 8 : if (__pyx_t_12) {
29842 :
29843 : /* "scipy/linalg/_decomp_interpolative.pyx":565
29844 : *
29845 : * if krank > 0:
29846 : * for p in range(krank): # <<<<<<<<<<<<<<
29847 : * # Apply pivots
29848 : * tmp_int = perms[p]
29849 : */
29850 117 : __pyx_t_8 = __pyx_v_krank;
29851 117 : __pyx_t_10 = __pyx_t_8;
29852 117 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
29853 109 : __pyx_v_p = __pyx_t_11;
29854 :
29855 : /* "scipy/linalg/_decomp_interpolative.pyx":567
29856 : * for p in range(krank):
29857 : * # Apply pivots
29858 : * tmp_int = perms[p] # <<<<<<<<<<<<<<
29859 : * perms[p] = perms[inds[p]]
29860 : * perms[inds[p]] = tmp_int
29861 : */
29862 109 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_perms, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
29863 109 : __Pyx_GOTREF(__pyx_t_1);
29864 109 : __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L1_error)
29865 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29866 109 : __pyx_v_tmp_int = __pyx_t_13;
29867 :
29868 : /* "scipy/linalg/_decomp_interpolative.pyx":568
29869 : * # Apply pivots
29870 : * tmp_int = perms[p]
29871 : * perms[p] = perms[inds[p]] # <<<<<<<<<<<<<<
29872 : * perms[inds[p]] = tmp_int
29873 : * # perms[[p, inds[p]]] = perms[[inds[p], p]]
29874 : */
29875 109 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
29876 109 : __Pyx_GOTREF(__pyx_t_1);
29877 109 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_perms, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
29878 109 : __Pyx_GOTREF(__pyx_t_4);
29879 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29880 109 : if (unlikely((__Pyx_SetItemInt(__pyx_v_perms, __pyx_v_p, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 568, __pyx_L1_error)
29881 109 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29882 :
29883 : /* "scipy/linalg/_decomp_interpolative.pyx":569
29884 : * tmp_int = perms[p]
29885 : * perms[p] = perms[inds[p]]
29886 : * perms[inds[p]] = tmp_int # <<<<<<<<<<<<<<
29887 : * # perms[[p, inds[p]]] = perms[[inds[p], p]]
29888 : *
29889 : */
29890 109 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_tmp_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
29891 109 : __Pyx_GOTREF(__pyx_t_4);
29892 109 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
29893 109 : __Pyx_GOTREF(__pyx_t_1);
29894 109 : if (unlikely((PyObject_SetItem(__pyx_v_perms, __pyx_t_1, __pyx_t_4) < 0))) __PYX_ERR(0, 569, __pyx_L1_error)
29895 109 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29896 109 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29897 : }
29898 :
29899 : /* "scipy/linalg/_decomp_interpolative.pyx":564
29900 : * perms[p] = p
29901 : *
29902 : * if krank > 0: # <<<<<<<<<<<<<<
29903 : * for p in range(krank):
29904 : * # Apply pivots
29905 : */
29906 : }
29907 :
29908 : /* "scipy/linalg/_decomp_interpolative.pyx":585
29909 : * # Fortran already sees A1 as A1.T and becomes lower tri, side = R
29910 : *
29911 : * tmp_int = n - krank # <<<<<<<<<<<<<<
29912 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
29913 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
29914 : */
29915 8 : __pyx_v_tmp_int = (__pyx_v_n - __pyx_v_krank);
29916 :
29917 : /* "scipy/linalg/_decomp_interpolative.pyx":588
29918 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
29919 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
29920 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n) # <<<<<<<<<<<<<<
29921 : *
29922 : * return krank, np.array(perms), a[:krank, krank:]
29923 : */
29924 8 : __pyx_t_14 = 0;
29925 8 : __pyx_t_15 = 0;
29926 8 : __pyx_t_16 = 0;
29927 8 : __pyx_t_17 = __pyx_v_krank;
29928 :
29929 : /* "scipy/linalg/_decomp_interpolative.pyx":587
29930 : * tmp_int = n - krank
29931 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
29932 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N', # <<<<<<<<<<<<<<
29933 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
29934 : *
29935 : */
29936 8 : __pyx_f_5scipy_6linalg_11cython_blas_dtrsm(((char *)((char *)"R")), ((char *)((char *)"L")), ((char *)((char *)"N")), ((char *)((char *)"N")), (&__pyx_v_tmp_int), (&__pyx_v_krank), (&__pyx_v_one), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n));
29937 :
29938 : /* "scipy/linalg/_decomp_interpolative.pyx":590
29939 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
29940 : *
29941 : * return krank, np.array(perms), a[:krank, krank:] # <<<<<<<<<<<<<<
29942 : *
29943 : *
29944 : */
29945 8 : __Pyx_XDECREF(__pyx_r);
29946 8 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
29947 8 : __Pyx_GOTREF(__pyx_t_4);
29948 8 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
29949 8 : __Pyx_GOTREF(__pyx_t_3);
29950 8 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
29951 8 : __Pyx_GOTREF(__pyx_t_2);
29952 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29953 8 : __pyx_t_3 = NULL;
29954 8 : __pyx_t_5 = 0;
29955 : #if CYTHON_UNPACK_METHODS
29956 8 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
29957 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
29958 0 : if (likely(__pyx_t_3)) {
29959 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29960 0 : __Pyx_INCREF(__pyx_t_3);
29961 0 : __Pyx_INCREF(function);
29962 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
29963 : __pyx_t_5 = 1;
29964 : }
29965 : }
29966 : #endif
29967 : {
29968 8 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_perms};
29969 8 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
29970 8 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29971 8 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
29972 8 : __Pyx_GOTREF(__pyx_t_1);
29973 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29974 : }
29975 8 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
29976 8 : __Pyx_GOTREF(__pyx_t_2);
29977 8 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
29978 8 : __Pyx_GOTREF(__pyx_t_3);
29979 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29980 8 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
29981 8 : __Pyx_GOTREF(__pyx_t_2);
29982 8 : __pyx_t_6 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
29983 8 : __Pyx_GOTREF(__pyx_t_6);
29984 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29985 8 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
29986 8 : __Pyx_GOTREF(__pyx_t_2);
29987 8 : __Pyx_GIVEREF(__pyx_t_3);
29988 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error);
29989 8 : __Pyx_GIVEREF(__pyx_t_6);
29990 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error);
29991 8 : __pyx_t_3 = 0;
29992 8 : __pyx_t_6 = 0;
29993 8 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
29994 8 : __Pyx_GOTREF(__pyx_t_6);
29995 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29996 8 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
29997 8 : __Pyx_GOTREF(__pyx_t_2);
29998 8 : __Pyx_GIVEREF(__pyx_t_4);
29999 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error);
30000 8 : __Pyx_GIVEREF(__pyx_t_1);
30001 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error);
30002 8 : __Pyx_GIVEREF(__pyx_t_6);
30003 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error);
30004 8 : __pyx_t_4 = 0;
30005 8 : __pyx_t_1 = 0;
30006 8 : __pyx_t_6 = 0;
30007 8 : __pyx_r = __pyx_t_2;
30008 8 : __pyx_t_2 = 0;
30009 8 : goto __pyx_L0;
30010 :
30011 : /* "scipy/linalg/_decomp_interpolative.pyx":554
30012 : *
30013 : *
30014 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
30015 : * cdef int n = a.shape[1], krank, tmp_int, p
30016 : * cdef cnp.float64_t one = 1
30017 : */
30018 :
30019 : /* function exit code */
30020 0 : __pyx_L1_error:;
30021 0 : __Pyx_XDECREF(__pyx_t_1);
30022 0 : __Pyx_XDECREF(__pyx_t_2);
30023 0 : __Pyx_XDECREF(__pyx_t_3);
30024 0 : __Pyx_XDECREF(__pyx_t_4);
30025 0 : __Pyx_XDECREF(__pyx_t_6);
30026 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
30027 0 : __Pyx_PyThreadState_declare
30028 0 : __Pyx_PyThreadState_assign
30029 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
30030 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
30031 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
30032 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
30033 0 : __pyx_r = NULL;
30034 0 : goto __pyx_L2;
30035 8 : __pyx_L0:;
30036 8 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
30037 8 : __pyx_L2:;
30038 8 : __Pyx_XDECREF(__pyx_v__);
30039 8 : __Pyx_XDECREF(__pyx_v_inds);
30040 8 : __Pyx_XDECREF(__pyx_v_perms);
30041 8 : __Pyx_XGIVEREF(__pyx_r);
30042 8 : __Pyx_RefNannyFinishContext();
30043 8 : return __pyx_r;
30044 : }
30045 :
30046 : /* "scipy/linalg/_decomp_interpolative.pyx":593
30047 : *
30048 : *
30049 : * def iddp_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
30050 : * """
30051 : * This is a minimal version of ?GEQP3 from LAPACK with an
30052 : */
30053 :
30054 : /* Python wrapper */
30055 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_19iddp_qrpiv(PyObject *__pyx_self,
30056 : #if CYTHON_METH_FASTCALL
30057 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
30058 : #else
30059 : PyObject *__pyx_args, PyObject *__pyx_kwds
30060 : #endif
30061 : ); /*proto*/
30062 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_21_decomp_interpolative_18iddp_qrpiv, "\n This is a minimal version of ?GEQP3 from LAPACK with an\n additional early stopping criterion over given precision.\n\n This function overwrites entries of \"a\" !\n ");
30063 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_19iddp_qrpiv = {"iddp_qrpiv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_19iddp_qrpiv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_21_decomp_interpolative_18iddp_qrpiv};
30064 9 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_19iddp_qrpiv(PyObject *__pyx_self,
30065 : #if CYTHON_METH_FASTCALL
30066 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
30067 : #else
30068 : PyObject *__pyx_args, PyObject *__pyx_kwds
30069 : #endif
30070 : ) {
30071 9 : PyArrayObject *__pyx_v_a = 0;
30072 9 : __pyx_t_5numpy_float64_t __pyx_v_eps;
30073 : #if !CYTHON_METH_FASTCALL
30074 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
30075 : #endif
30076 9 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
30077 9 : PyObject* values[2] = {0,0};
30078 9 : int __pyx_lineno = 0;
30079 9 : const char *__pyx_filename = NULL;
30080 9 : int __pyx_clineno = 0;
30081 9 : PyObject *__pyx_r = 0;
30082 : __Pyx_RefNannyDeclarations
30083 9 : __Pyx_RefNannySetupContext("iddp_qrpiv (wrapper)", 0);
30084 : #if !CYTHON_METH_FASTCALL
30085 : #if CYTHON_ASSUME_SAFE_MACROS
30086 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
30087 : #else
30088 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
30089 : #endif
30090 : #endif
30091 9 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
30092 : {
30093 9 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
30094 9 : if (__pyx_kwds) {
30095 0 : Py_ssize_t kw_args;
30096 0 : switch (__pyx_nargs) {
30097 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
30098 0 : CYTHON_FALLTHROUGH;
30099 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
30100 0 : CYTHON_FALLTHROUGH;
30101 0 : case 0: break;
30102 0 : default: goto __pyx_L5_argtuple_error;
30103 : }
30104 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
30105 0 : switch (__pyx_nargs) {
30106 : case 0:
30107 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
30108 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
30109 0 : kw_args--;
30110 : }
30111 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L3_error)
30112 0 : else goto __pyx_L5_argtuple_error;
30113 0 : CYTHON_FALLTHROUGH;
30114 : case 1:
30115 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
30116 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
30117 0 : kw_args--;
30118 : }
30119 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L3_error)
30120 : else {
30121 0 : __Pyx_RaiseArgtupleInvalid("iddp_qrpiv", 1, 2, 2, 1); __PYX_ERR(0, 593, __pyx_L3_error)
30122 : }
30123 : }
30124 0 : if (unlikely(kw_args > 0)) {
30125 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
30126 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_qrpiv") < 0)) __PYX_ERR(0, 593, __pyx_L3_error)
30127 : }
30128 9 : } else if (unlikely(__pyx_nargs != 2)) {
30129 0 : goto __pyx_L5_argtuple_error;
30130 : } else {
30131 9 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
30132 9 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
30133 : }
30134 9 : __pyx_v_a = ((PyArrayObject *)values[0]);
30135 9 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 593, __pyx_L3_error)
30136 : }
30137 9 : goto __pyx_L6_skip;
30138 0 : __pyx_L5_argtuple_error:;
30139 0 : __Pyx_RaiseArgtupleInvalid("iddp_qrpiv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 593, __pyx_L3_error)
30140 9 : __pyx_L6_skip:;
30141 9 : goto __pyx_L4_argument_unpacking_done;
30142 0 : __pyx_L3_error:;
30143 : {
30144 0 : Py_ssize_t __pyx_temp;
30145 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
30146 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
30147 : }
30148 : }
30149 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
30150 0 : __Pyx_RefNannyFinishContext();
30151 0 : return NULL;
30152 9 : __pyx_L4_argument_unpacking_done:;
30153 9 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
30154 9 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_18iddp_qrpiv(__pyx_self, __pyx_v_a, __pyx_v_eps);
30155 :
30156 : /* function exit code */
30157 9 : goto __pyx_L0;
30158 0 : __pyx_L1_error:;
30159 0 : __pyx_r = NULL;
30160 9 : __pyx_L0:;
30161 : {
30162 9 : Py_ssize_t __pyx_temp;
30163 9 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
30164 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
30165 : }
30166 : }
30167 : __Pyx_RefNannyFinishContext();
30168 : return __pyx_r;
30169 : }
30170 :
30171 9 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_18iddp_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps) {
30172 9 : int __pyx_v_m;
30173 9 : int __pyx_v_n;
30174 9 : PyArrayObject *__pyx_v_col_norms = 0;
30175 9 : int __pyx_v_k;
30176 9 : int __pyx_v_kpiv;
30177 9 : int __pyx_v_i;
30178 9 : int __pyx_v_tmp_int;
30179 9 : int __pyx_v_int_n;
30180 9 : __pyx_t_5numpy_float64_t __pyx_v_tmp_sca;
30181 9 : PyArrayObject *__pyx_v_taus = 0;
30182 9 : PyArrayObject *__pyx_v_ind = 0;
30183 9 : __Pyx_memviewslice __pyx_v_taus_v = { 0, 0, { 0 }, { 0 }, { 0 } };
30184 9 : __pyx_t_5numpy_float64_t __pyx_v_feps;
30185 9 : __pyx_t_5numpy_float64_t __pyx_v_ssmax;
30186 9 : __pyx_t_5numpy_float64_t __pyx_v_ssmaxin;
30187 9 : int __pyx_v_nupdate;
30188 9 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
30189 9 : __Pyx_Buffer __pyx_pybuffer_a;
30190 9 : PyObject *__pyx_r = NULL;
30191 : __Pyx_RefNannyDeclarations
30192 9 : npy_intp __pyx_t_1[1];
30193 9 : PyObject *__pyx_t_2 = NULL;
30194 9 : npy_intp __pyx_t_3[1];
30195 9 : npy_intp __pyx_t_4[1];
30196 9 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
30197 9 : int __pyx_t_6;
30198 9 : int __pyx_t_7;
30199 9 : int __pyx_t_8;
30200 9 : Py_ssize_t __pyx_t_9;
30201 9 : Py_ssize_t __pyx_t_10;
30202 9 : PyObject *__pyx_t_11 = NULL;
30203 9 : PyObject *__pyx_t_12 = NULL;
30204 9 : unsigned int __pyx_t_13;
30205 9 : __pyx_t_5numpy_float64_t __pyx_t_14;
30206 9 : int __pyx_t_15;
30207 9 : PyObject *__pyx_t_16 = NULL;
30208 9 : Py_ssize_t __pyx_t_17;
30209 9 : PyObject *__pyx_t_18 = NULL;
30210 9 : PyObject *__pyx_t_19 = NULL;
30211 9 : PyObject *__pyx_t_20 = NULL;
30212 9 : PyObject *__pyx_t_21 = NULL;
30213 9 : PyObject *__pyx_t_22 = NULL;
30214 9 : int __pyx_t_23;
30215 9 : int __pyx_t_24;
30216 9 : int __pyx_t_25;
30217 9 : int __pyx_t_26;
30218 9 : int __pyx_lineno = 0;
30219 9 : const char *__pyx_filename = NULL;
30220 9 : int __pyx_clineno = 0;
30221 9 : __Pyx_RefNannySetupContext("iddp_qrpiv", 1);
30222 9 : __pyx_pybuffer_a.pybuffer.buf = NULL;
30223 9 : __pyx_pybuffer_a.refcount = 0;
30224 9 : __pyx_pybuffernd_a.data = NULL;
30225 9 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
30226 : {
30227 9 : __Pyx_BufFmt_StackElem __pyx_stack[1];
30228 9 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 593, __pyx_L1_error)
30229 : }
30230 9 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
30231 :
30232 : /* "scipy/linalg/_decomp_interpolative.pyx":601
30233 : * """
30234 : *
30235 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
30236 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
30237 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
30238 : */
30239 9 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
30240 9 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
30241 :
30242 : /* "scipy/linalg/_decomp_interpolative.pyx":602
30243 : *
30244 : * cdef int m = a.shape[0], n = a.shape[1]
30245 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
30246 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
30247 : * cdef cnp.float64_t tmp_sca = 0.
30248 : */
30249 9 : __pyx_t_1[0] = __pyx_v_n;
30250 9 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_1, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
30251 9 : __Pyx_GOTREF(__pyx_t_2);
30252 9 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 602, __pyx_L1_error)
30253 9 : __pyx_v_col_norms = ((PyArrayObject *)__pyx_t_2);
30254 9 : __pyx_t_2 = 0;
30255 :
30256 : /* "scipy/linalg/_decomp_interpolative.pyx":603
30257 : * cdef int m = a.shape[0], n = a.shape[1]
30258 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
30259 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0 # <<<<<<<<<<<<<<
30260 : * cdef cnp.float64_t tmp_sca = 0.
30261 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
30262 : */
30263 9 : __pyx_v_k = 0;
30264 9 : __pyx_v_kpiv = 0;
30265 9 : __pyx_v_i = 0;
30266 9 : __pyx_v_tmp_int = 0;
30267 9 : __pyx_v_int_n = 0;
30268 :
30269 : /* "scipy/linalg/_decomp_interpolative.pyx":604
30270 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
30271 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
30272 : * cdef cnp.float64_t tmp_sca = 0. # <<<<<<<<<<<<<<
30273 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
30274 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
30275 : */
30276 9 : __pyx_v_tmp_sca = 0.;
30277 :
30278 : /* "scipy/linalg/_decomp_interpolative.pyx":605
30279 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
30280 : * cdef cnp.float64_t tmp_sca = 0.
30281 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
30282 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
30283 : * cdef cnp.float64_t[::1] taus_v = taus
30284 : */
30285 9 : __pyx_t_3[0] = __pyx_v_m;
30286 9 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error)
30287 9 : __Pyx_GOTREF(__pyx_t_2);
30288 9 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 605, __pyx_L1_error)
30289 9 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_2);
30290 9 : __pyx_t_2 = 0;
30291 :
30292 : /* "scipy/linalg/_decomp_interpolative.pyx":606
30293 : * cdef cnp.float64_t tmp_sca = 0.
30294 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
30295 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
30296 : * cdef cnp.float64_t[::1] taus_v = taus
30297 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
30298 : */
30299 9 : __pyx_t_4[0] = __pyx_v_n;
30300 9 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
30301 9 : __Pyx_GOTREF(__pyx_t_2);
30302 9 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 606, __pyx_L1_error)
30303 9 : __pyx_v_ind = ((PyArrayObject *)__pyx_t_2);
30304 9 : __pyx_t_2 = 0;
30305 :
30306 : /* "scipy/linalg/_decomp_interpolative.pyx":607
30307 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
30308 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
30309 : * cdef cnp.float64_t[::1] taus_v = taus # <<<<<<<<<<<<<<
30310 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
30311 : * cdef cnp.float64_t ssmax, ssmaxin
30312 : */
30313 9 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_taus), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 607, __pyx_L1_error)
30314 9 : __pyx_v_taus_v = __pyx_t_5;
30315 9 : __pyx_t_5.memview = NULL;
30316 9 : __pyx_t_5.data = NULL;
30317 :
30318 : /* "scipy/linalg/_decomp_interpolative.pyx":608
30319 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
30320 : * cdef cnp.float64_t[::1] taus_v = taus
30321 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps # <<<<<<<<<<<<<<
30322 : * cdef cnp.float64_t ssmax, ssmaxin
30323 : * cdef int nupdate = 0
30324 : */
30325 9 : __pyx_v_feps = 0.1e-16;
30326 :
30327 : /* "scipy/linalg/_decomp_interpolative.pyx":610
30328 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
30329 : * cdef cnp.float64_t ssmax, ssmaxin
30330 : * cdef int nupdate = 0 # <<<<<<<<<<<<<<
30331 : *
30332 : * for i in range(n):
30333 : */
30334 9 : __pyx_v_nupdate = 0;
30335 :
30336 : /* "scipy/linalg/_decomp_interpolative.pyx":612
30337 : * cdef int nupdate = 0
30338 : *
30339 : * for i in range(n): # <<<<<<<<<<<<<<
30340 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2
30341 : *
30342 : */
30343 9 : __pyx_t_6 = __pyx_v_n;
30344 9 : __pyx_t_7 = __pyx_t_6;
30345 1827 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
30346 1818 : __pyx_v_i = __pyx_t_8;
30347 :
30348 : /* "scipy/linalg/_decomp_interpolative.pyx":613
30349 : *
30350 : * for i in range(n):
30351 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2 # <<<<<<<<<<<<<<
30352 : *
30353 : * kpiv = np.argmax(col_norms)
30354 : */
30355 1818 : __pyx_t_9 = 0;
30356 1818 : __pyx_t_10 = __pyx_v_i;
30357 1818 : __pyx_t_2 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_m), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
30358 1818 : __Pyx_GOTREF(__pyx_t_2);
30359 1818 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 613, __pyx_L1_error)
30360 3636 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30361 : }
30362 :
30363 : /* "scipy/linalg/_decomp_interpolative.pyx":615
30364 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2
30365 : *
30366 : * kpiv = np.argmax(col_norms) # <<<<<<<<<<<<<<
30367 : * ssmax = col_norms[kpiv]
30368 : * ssmaxin = ssmax
30369 : */
30370 9 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 615, __pyx_L1_error)
30371 9 : __Pyx_GOTREF(__pyx_t_11);
30372 9 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argmax); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 615, __pyx_L1_error)
30373 9 : __Pyx_GOTREF(__pyx_t_12);
30374 9 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30375 9 : __pyx_t_11 = NULL;
30376 9 : __pyx_t_13 = 0;
30377 : #if CYTHON_UNPACK_METHODS
30378 9 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
30379 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
30380 0 : if (likely(__pyx_t_11)) {
30381 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
30382 0 : __Pyx_INCREF(__pyx_t_11);
30383 0 : __Pyx_INCREF(function);
30384 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
30385 : __pyx_t_13 = 1;
30386 : }
30387 : }
30388 : #endif
30389 : {
30390 9 : PyObject *__pyx_callargs[2] = {__pyx_t_11, ((PyObject *)__pyx_v_col_norms)};
30391 9 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
30392 9 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
30393 9 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
30394 9 : __Pyx_GOTREF(__pyx_t_2);
30395 9 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
30396 : }
30397 9 : __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 615, __pyx_L1_error)
30398 9 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30399 9 : __pyx_v_kpiv = __pyx_t_6;
30400 :
30401 : /* "scipy/linalg/_decomp_interpolative.pyx":616
30402 : *
30403 : * kpiv = np.argmax(col_norms)
30404 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
30405 : * ssmaxin = ssmax
30406 : *
30407 : */
30408 9 : __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
30409 9 : __Pyx_GOTREF(__pyx_t_2);
30410 9 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L1_error)
30411 9 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30412 9 : __pyx_v_ssmax = __pyx_t_14;
30413 :
30414 : /* "scipy/linalg/_decomp_interpolative.pyx":617
30415 : * kpiv = np.argmax(col_norms)
30416 : * ssmax = col_norms[kpiv]
30417 : * ssmaxin = ssmax # <<<<<<<<<<<<<<
30418 : *
30419 : * for k in range(min(m, n)):
30420 : */
30421 9 : __pyx_v_ssmaxin = __pyx_v_ssmax;
30422 :
30423 : /* "scipy/linalg/_decomp_interpolative.pyx":619
30424 : * ssmaxin = ssmax
30425 : *
30426 : * for k in range(min(m, n)): # <<<<<<<<<<<<<<
30427 : *
30428 : * # Pivoting
30429 : */
30430 9 : __pyx_t_6 = __pyx_v_n;
30431 9 : __pyx_t_7 = __pyx_v_m;
30432 9 : __pyx_t_15 = (__pyx_t_6 < __pyx_t_7);
30433 9 : if (__pyx_t_15) {
30434 : __pyx_t_8 = __pyx_t_6;
30435 : } else {
30436 : __pyx_t_8 = __pyx_t_7;
30437 : }
30438 9 : __pyx_t_6 = __pyx_t_8;
30439 9 : __pyx_t_8 = __pyx_t_6;
30440 128 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
30441 128 : __pyx_v_k = __pyx_t_7;
30442 :
30443 : /* "scipy/linalg/_decomp_interpolative.pyx":622
30444 : *
30445 : * # Pivoting
30446 : * ind[k] = kpiv # <<<<<<<<<<<<<<
30447 : * # Swap columns a[:, k] and a[:, kpiv]
30448 : * a[:, [kpiv, k]] = a[:, [k, kpiv]]
30449 : */
30450 128 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
30451 128 : __Pyx_GOTREF(__pyx_t_2);
30452 128 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_ind), __pyx_v_k, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 622, __pyx_L1_error)
30453 128 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30454 :
30455 : /* "scipy/linalg/_decomp_interpolative.pyx":624
30456 : * ind[k] = kpiv
30457 : * # Swap columns a[:, k] and a[:, kpiv]
30458 : * a[:, [kpiv, k]] = a[:, [k, kpiv]] # <<<<<<<<<<<<<<
30459 : *
30460 : * # Swap col_norms[krank] and col_norms[kpiv]
30461 : */
30462 128 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
30463 128 : __Pyx_GOTREF(__pyx_t_2);
30464 128 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 624, __pyx_L1_error)
30465 128 : __Pyx_GOTREF(__pyx_t_12);
30466 128 : __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 624, __pyx_L1_error)
30467 128 : __Pyx_GOTREF(__pyx_t_11);
30468 128 : __Pyx_GIVEREF(__pyx_t_2);
30469 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error);
30470 128 : __Pyx_GIVEREF(__pyx_t_12);
30471 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(0, 624, __pyx_L1_error);
30472 128 : __pyx_t_2 = 0;
30473 128 : __pyx_t_12 = 0;
30474 128 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 624, __pyx_L1_error)
30475 128 : __Pyx_GOTREF(__pyx_t_12);
30476 128 : __Pyx_INCREF(__pyx_slice__5);
30477 128 : __Pyx_GIVEREF(__pyx_slice__5);
30478 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__5)) __PYX_ERR(0, 624, __pyx_L1_error);
30479 128 : __Pyx_GIVEREF(__pyx_t_11);
30480 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(0, 624, __pyx_L1_error);
30481 128 : __pyx_t_11 = 0;
30482 128 : __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 624, __pyx_L1_error)
30483 128 : __Pyx_GOTREF(__pyx_t_11);
30484 128 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
30485 128 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 624, __pyx_L1_error)
30486 128 : __Pyx_GOTREF(__pyx_t_12);
30487 128 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
30488 128 : __Pyx_GOTREF(__pyx_t_2);
30489 128 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 624, __pyx_L1_error)
30490 128 : __Pyx_GOTREF(__pyx_t_16);
30491 128 : __Pyx_GIVEREF(__pyx_t_12);
30492 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_12)) __PYX_ERR(0, 624, __pyx_L1_error);
30493 128 : __Pyx_GIVEREF(__pyx_t_2);
30494 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error);
30495 128 : __pyx_t_12 = 0;
30496 128 : __pyx_t_2 = 0;
30497 128 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
30498 128 : __Pyx_GOTREF(__pyx_t_2);
30499 128 : __Pyx_INCREF(__pyx_slice__5);
30500 128 : __Pyx_GIVEREF(__pyx_slice__5);
30501 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 624, __pyx_L1_error);
30502 128 : __Pyx_GIVEREF(__pyx_t_16);
30503 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16)) __PYX_ERR(0, 624, __pyx_L1_error);
30504 128 : __pyx_t_16 = 0;
30505 128 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_11) < 0))) __PYX_ERR(0, 624, __pyx_L1_error)
30506 128 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30507 128 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30508 :
30509 : /* "scipy/linalg/_decomp_interpolative.pyx":627
30510 : *
30511 : * # Swap col_norms[krank] and col_norms[kpiv]
30512 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]] # <<<<<<<<<<<<<<
30513 : *
30514 : * if k < m-1:
30515 : */
30516 128 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 627, __pyx_L1_error)
30517 128 : __Pyx_GOTREF(__pyx_t_11);
30518 128 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
30519 128 : __Pyx_GOTREF(__pyx_t_2);
30520 128 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 627, __pyx_L1_error)
30521 128 : __Pyx_GOTREF(__pyx_t_16);
30522 128 : __Pyx_GIVEREF(__pyx_t_11);
30523 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_11)) __PYX_ERR(0, 627, __pyx_L1_error);
30524 128 : __Pyx_GIVEREF(__pyx_t_2);
30525 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error);
30526 128 : __pyx_t_11 = 0;
30527 128 : __pyx_t_2 = 0;
30528 128 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
30529 128 : __Pyx_GOTREF(__pyx_t_2);
30530 128 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
30531 128 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 627, __pyx_L1_error)
30532 128 : __Pyx_GOTREF(__pyx_t_16);
30533 128 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 627, __pyx_L1_error)
30534 128 : __Pyx_GOTREF(__pyx_t_11);
30535 128 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 627, __pyx_L1_error)
30536 128 : __Pyx_GOTREF(__pyx_t_12);
30537 128 : __Pyx_GIVEREF(__pyx_t_16);
30538 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_16)) __PYX_ERR(0, 627, __pyx_L1_error);
30539 128 : __Pyx_GIVEREF(__pyx_t_11);
30540 128 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(0, 627, __pyx_L1_error);
30541 128 : __pyx_t_16 = 0;
30542 128 : __pyx_t_11 = 0;
30543 128 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_12, __pyx_t_2) < 0))) __PYX_ERR(0, 627, __pyx_L1_error)
30544 128 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
30545 128 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30546 :
30547 : /* "scipy/linalg/_decomp_interpolative.pyx":629
30548 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]]
30549 : *
30550 : * if k < m-1: # <<<<<<<<<<<<<<
30551 : * # Compute the householder reflector for column k
30552 : * tmp_sca = a[k, k]
30553 : */
30554 128 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_m - 1));
30555 128 : if (__pyx_t_15) {
30556 :
30557 : /* "scipy/linalg/_decomp_interpolative.pyx":631
30558 : * if k < m-1:
30559 : * # Compute the householder reflector for column k
30560 : * tmp_sca = a[k, k] # <<<<<<<<<<<<<<
30561 : * # FIX: Convert these to F_INT
30562 : * tmp_int = <int>(m - k)
30563 : */
30564 128 : __pyx_t_10 = __pyx_v_k;
30565 128 : __pyx_t_9 = __pyx_v_k;
30566 128 : __pyx_v_tmp_sca = (*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_a.diminfo[1].strides));
30567 :
30568 : /* "scipy/linalg/_decomp_interpolative.pyx":633
30569 : * tmp_sca = a[k, k]
30570 : * # FIX: Convert these to F_INT
30571 : * tmp_int = <int>(m - k) # <<<<<<<<<<<<<<
30572 : * int_n = <int>n
30573 : * dlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k])
30574 : */
30575 128 : __pyx_v_tmp_int = ((int)(__pyx_v_m - __pyx_v_k));
30576 :
30577 : /* "scipy/linalg/_decomp_interpolative.pyx":634
30578 : * # FIX: Convert these to F_INT
30579 : * tmp_int = <int>(m - k)
30580 : * int_n = <int>n # <<<<<<<<<<<<<<
30581 : * dlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k])
30582 : *
30583 : */
30584 128 : __pyx_v_int_n = ((int)__pyx_v_n);
30585 :
30586 : /* "scipy/linalg/_decomp_interpolative.pyx":635
30587 : * tmp_int = <int>(m - k)
30588 : * int_n = <int>n
30589 : * dlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k]) # <<<<<<<<<<<<<<
30590 : *
30591 : * # Overwrite with 1. for easy matmul
30592 : */
30593 128 : __pyx_t_9 = (__pyx_v_k + 1);
30594 128 : __pyx_t_10 = __pyx_v_k;
30595 128 : __pyx_t_17 = __pyx_v_k;
30596 128 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp((&__pyx_v_tmp_int), (&__pyx_v_tmp_sca), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_int_n), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_taus_v.data) + __pyx_t_17)) )))));
30597 :
30598 : /* "scipy/linalg/_decomp_interpolative.pyx":638
30599 : *
30600 : * # Overwrite with 1. for easy matmul
30601 : * a[k, k] = 1 # <<<<<<<<<<<<<<
30602 : * if k < n-1:
30603 : * # Apply the householder reflector to the rest on the right
30604 : */
30605 128 : __pyx_t_17 = __pyx_v_k;
30606 128 : __pyx_t_10 = __pyx_v_k;
30607 128 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides) = 1.0;
30608 :
30609 : /* "scipy/linalg/_decomp_interpolative.pyx":639
30610 : * # Overwrite with 1. for easy matmul
30611 : * a[k, k] = 1
30612 : * if k < n-1: # <<<<<<<<<<<<<<
30613 : * # Apply the householder reflector to the rest on the right
30614 : * a[k:, k+1:] -= np.outer(taus[k]*a[k:, k], a[k:, k] @ a[k:, k+1:])
30615 : */
30616 128 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
30617 128 : if (__pyx_t_15) {
30618 :
30619 : /* "scipy/linalg/_decomp_interpolative.pyx":641
30620 : * if k < n-1:
30621 : * # Apply the householder reflector to the rest on the right
30622 : * a[k:, k+1:] -= np.outer(taus[k]*a[k:, k], a[k:, k] @ a[k:, k+1:]) # <<<<<<<<<<<<<<
30623 : *
30624 : * # Put back the beta in place
30625 : */
30626 127 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
30627 127 : __Pyx_GOTREF(__pyx_t_2);
30628 127 : __pyx_t_12 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 641, __pyx_L1_error)
30629 127 : __Pyx_GOTREF(__pyx_t_12);
30630 127 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30631 127 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
30632 127 : __Pyx_GOTREF(__pyx_t_2);
30633 127 : __pyx_t_11 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 641, __pyx_L1_error)
30634 127 : __Pyx_GOTREF(__pyx_t_11);
30635 127 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30636 127 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
30637 127 : __Pyx_GOTREF(__pyx_t_2);
30638 127 : __Pyx_GIVEREF(__pyx_t_12);
30639 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12)) __PYX_ERR(0, 641, __pyx_L1_error);
30640 127 : __Pyx_GIVEREF(__pyx_t_11);
30641 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_11)) __PYX_ERR(0, 641, __pyx_L1_error);
30642 127 : __pyx_t_12 = 0;
30643 127 : __pyx_t_11 = 0;
30644 127 : __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 641, __pyx_L1_error)
30645 127 : __Pyx_GOTREF(__pyx_t_11);
30646 127 : __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error)
30647 127 : __Pyx_GOTREF(__pyx_t_16);
30648 127 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_outer); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 641, __pyx_L1_error)
30649 127 : __Pyx_GOTREF(__pyx_t_18);
30650 127 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
30651 127 : __pyx_t_16 = __Pyx_GetItemInt(((PyObject *)__pyx_v_taus), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error)
30652 127 : __Pyx_GOTREF(__pyx_t_16);
30653 127 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30654 127 : __Pyx_GOTREF(__pyx_t_19);
30655 127 : __pyx_t_20 = PySlice_New(__pyx_t_19, Py_None, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30656 127 : __Pyx_GOTREF(__pyx_t_20);
30657 127 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
30658 127 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30659 127 : __Pyx_GOTREF(__pyx_t_19);
30660 127 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 641, __pyx_L1_error)
30661 127 : __Pyx_GOTREF(__pyx_t_21);
30662 127 : __Pyx_GIVEREF(__pyx_t_20);
30663 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error);
30664 127 : __Pyx_GIVEREF(__pyx_t_19);
30665 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error);
30666 127 : __pyx_t_20 = 0;
30667 127 : __pyx_t_19 = 0;
30668 127 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30669 127 : __Pyx_GOTREF(__pyx_t_19);
30670 127 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
30671 127 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_16, __pyx_t_19); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 641, __pyx_L1_error)
30672 127 : __Pyx_GOTREF(__pyx_t_21);
30673 127 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
30674 127 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
30675 127 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30676 127 : __Pyx_GOTREF(__pyx_t_19);
30677 127 : __pyx_t_16 = PySlice_New(__pyx_t_19, Py_None, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error)
30678 127 : __Pyx_GOTREF(__pyx_t_16);
30679 127 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
30680 127 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30681 127 : __Pyx_GOTREF(__pyx_t_19);
30682 127 : __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30683 127 : __Pyx_GOTREF(__pyx_t_20);
30684 127 : __Pyx_GIVEREF(__pyx_t_16);
30685 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error);
30686 127 : __Pyx_GIVEREF(__pyx_t_19);
30687 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error);
30688 127 : __pyx_t_16 = 0;
30689 127 : __pyx_t_19 = 0;
30690 127 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 641, __pyx_L1_error)
30691 127 : __Pyx_GOTREF(__pyx_t_19);
30692 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30693 127 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30694 127 : __Pyx_GOTREF(__pyx_t_20);
30695 127 : __pyx_t_16 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error)
30696 127 : __Pyx_GOTREF(__pyx_t_16);
30697 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30698 127 : __pyx_t_20 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30699 127 : __Pyx_GOTREF(__pyx_t_20);
30700 127 : __pyx_t_22 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 641, __pyx_L1_error)
30701 127 : __Pyx_GOTREF(__pyx_t_22);
30702 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30703 127 : __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30704 127 : __Pyx_GOTREF(__pyx_t_20);
30705 127 : __Pyx_GIVEREF(__pyx_t_16);
30706 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16)) __PYX_ERR(0, 641, __pyx_L1_error);
30707 127 : __Pyx_GIVEREF(__pyx_t_22);
30708 127 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22)) __PYX_ERR(0, 641, __pyx_L1_error);
30709 127 : __pyx_t_16 = 0;
30710 127 : __pyx_t_22 = 0;
30711 127 : __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_20); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 641, __pyx_L1_error)
30712 127 : __Pyx_GOTREF(__pyx_t_22);
30713 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30714 127 : __pyx_t_20 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_19, __pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 641, __pyx_L1_error)
30715 127 : __Pyx_GOTREF(__pyx_t_20);
30716 127 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
30717 127 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
30718 127 : __pyx_t_22 = NULL;
30719 127 : __pyx_t_13 = 0;
30720 : #if CYTHON_UNPACK_METHODS
30721 127 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
30722 0 : __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_18);
30723 0 : if (likely(__pyx_t_22)) {
30724 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
30725 0 : __Pyx_INCREF(__pyx_t_22);
30726 0 : __Pyx_INCREF(function);
30727 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
30728 : __pyx_t_13 = 1;
30729 : }
30730 : }
30731 : #endif
30732 : {
30733 127 : PyObject *__pyx_callargs[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_20};
30734 127 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
30735 127 : __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
30736 127 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
30737 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30738 127 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 641, __pyx_L1_error)
30739 127 : __Pyx_GOTREF(__pyx_t_12);
30740 127 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
30741 : }
30742 127 : __pyx_t_18 = PyNumber_InPlaceSubtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 641, __pyx_L1_error)
30743 127 : __Pyx_GOTREF(__pyx_t_18);
30744 127 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30745 127 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
30746 127 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_18) < 0))) __PYX_ERR(0, 641, __pyx_L1_error)
30747 127 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
30748 127 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30749 :
30750 : /* "scipy/linalg/_decomp_interpolative.pyx":639
30751 : * # Overwrite with 1. for easy matmul
30752 : * a[k, k] = 1
30753 : * if k < n-1: # <<<<<<<<<<<<<<
30754 : * # Apply the householder reflector to the rest on the right
30755 : * a[k:, k+1:] -= np.outer(taus[k]*a[k:, k], a[k:, k] @ a[k:, k+1:])
30756 : */
30757 : }
30758 :
30759 : /* "scipy/linalg/_decomp_interpolative.pyx":644
30760 : *
30761 : * # Put back the beta in place
30762 : * a[k, k] = tmp_sca # <<<<<<<<<<<<<<
30763 : *
30764 : * # Update the norms
30765 : */
30766 128 : __pyx_t_10 = __pyx_v_k;
30767 128 : __pyx_t_17 = __pyx_v_k;
30768 128 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_v_tmp_sca;
30769 :
30770 : /* "scipy/linalg/_decomp_interpolative.pyx":647
30771 : *
30772 : * # Update the norms
30773 : * col_norms[k] = 0 # <<<<<<<<<<<<<<
30774 : * col_norms[k+1:] -= a[k, k+1:]**2
30775 : * ssmax = 0
30776 : */
30777 128 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_k, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 647, __pyx_L1_error)
30778 :
30779 : /* "scipy/linalg/_decomp_interpolative.pyx":648
30780 : * # Update the norms
30781 : * col_norms[k] = 0
30782 : * col_norms[k+1:] -= a[k, k+1:]**2 # <<<<<<<<<<<<<<
30783 : * ssmax = 0
30784 : * kpiv = k+1
30785 : */
30786 128 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
30787 128 : __Pyx_GOTREF(__pyx_t_2);
30788 128 : __pyx_t_18 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 648, __pyx_L1_error)
30789 128 : __Pyx_GOTREF(__pyx_t_18);
30790 128 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30791 128 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
30792 128 : __Pyx_GOTREF(__pyx_t_2);
30793 128 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 648, __pyx_L1_error)
30794 128 : __Pyx_GOTREF(__pyx_t_12);
30795 128 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 648, __pyx_L1_error)
30796 128 : __Pyx_GOTREF(__pyx_t_11);
30797 128 : __pyx_t_20 = PySlice_New(__pyx_t_11, Py_None, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 648, __pyx_L1_error)
30798 128 : __Pyx_GOTREF(__pyx_t_20);
30799 128 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30800 128 : __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 648, __pyx_L1_error)
30801 128 : __Pyx_GOTREF(__pyx_t_11);
30802 128 : __Pyx_GIVEREF(__pyx_t_12);
30803 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12)) __PYX_ERR(0, 648, __pyx_L1_error);
30804 128 : __Pyx_GIVEREF(__pyx_t_20);
30805 128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_20)) __PYX_ERR(0, 648, __pyx_L1_error);
30806 128 : __pyx_t_12 = 0;
30807 128 : __pyx_t_20 = 0;
30808 128 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 648, __pyx_L1_error)
30809 128 : __Pyx_GOTREF(__pyx_t_20);
30810 128 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30811 128 : __pyx_t_11 = PyNumber_Power(__pyx_t_20, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 648, __pyx_L1_error)
30812 128 : __Pyx_GOTREF(__pyx_t_11);
30813 128 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30814 128 : __pyx_t_20 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 648, __pyx_L1_error)
30815 128 : __Pyx_GOTREF(__pyx_t_20);
30816 128 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30817 128 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30818 128 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18, __pyx_t_20) < 0))) __PYX_ERR(0, 648, __pyx_L1_error)
30819 128 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30820 128 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
30821 :
30822 : /* "scipy/linalg/_decomp_interpolative.pyx":649
30823 : * col_norms[k] = 0
30824 : * col_norms[k+1:] -= a[k, k+1:]**2
30825 : * ssmax = 0 # <<<<<<<<<<<<<<
30826 : * kpiv = k+1
30827 : * if k < n-1:
30828 : */
30829 128 : __pyx_v_ssmax = 0.0;
30830 :
30831 : /* "scipy/linalg/_decomp_interpolative.pyx":650
30832 : * col_norms[k+1:] -= a[k, k+1:]**2
30833 : * ssmax = 0
30834 : * kpiv = k+1 # <<<<<<<<<<<<<<
30835 : * if k < n-1:
30836 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
30837 : */
30838 128 : __pyx_v_kpiv = (__pyx_v_k + 1);
30839 :
30840 : /* "scipy/linalg/_decomp_interpolative.pyx":651
30841 : * ssmax = 0
30842 : * kpiv = k+1
30843 : * if k < n-1: # <<<<<<<<<<<<<<
30844 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
30845 : * ssmax = col_norms[kpiv]
30846 : */
30847 128 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
30848 128 : if (__pyx_t_15) {
30849 :
30850 : /* "scipy/linalg/_decomp_interpolative.pyx":652
30851 : * kpiv = k+1
30852 : * if k < n-1:
30853 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1) # <<<<<<<<<<<<<<
30854 : * ssmax = col_norms[kpiv]
30855 : *
30856 : */
30857 127 : __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_np); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 652, __pyx_L1_error)
30858 127 : __Pyx_GOTREF(__pyx_t_20);
30859 127 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_argmax); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 652, __pyx_L1_error)
30860 127 : __Pyx_GOTREF(__pyx_t_11);
30861 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30862 127 : __pyx_t_20 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_k + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 652, __pyx_L1_error)
30863 127 : __Pyx_GOTREF(__pyx_t_20);
30864 127 : __pyx_t_2 = NULL;
30865 127 : __pyx_t_13 = 0;
30866 : #if CYTHON_UNPACK_METHODS
30867 127 : if (unlikely(PyMethod_Check(__pyx_t_11))) {
30868 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
30869 0 : if (likely(__pyx_t_2)) {
30870 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
30871 0 : __Pyx_INCREF(__pyx_t_2);
30872 0 : __Pyx_INCREF(function);
30873 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
30874 : __pyx_t_13 = 1;
30875 : }
30876 : }
30877 : #endif
30878 : {
30879 127 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_20};
30880 127 : __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
30881 127 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
30882 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30883 127 : if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 652, __pyx_L1_error)
30884 127 : __Pyx_GOTREF(__pyx_t_18);
30885 127 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30886 : }
30887 127 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 652, __pyx_L1_error)
30888 127 : __Pyx_GOTREF(__pyx_t_11);
30889 127 : __pyx_t_20 = PyNumber_Add(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 652, __pyx_L1_error)
30890 127 : __Pyx_GOTREF(__pyx_t_20);
30891 127 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
30892 127 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
30893 127 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 652, __pyx_L1_error)
30894 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30895 127 : __pyx_v_kpiv = __pyx_t_23;
30896 :
30897 : /* "scipy/linalg/_decomp_interpolative.pyx":653
30898 : * if k < n-1:
30899 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
30900 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
30901 : *
30902 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
30903 : */
30904 127 : __pyx_t_20 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 653, __pyx_L1_error)
30905 127 : __Pyx_GOTREF(__pyx_t_20);
30906 127 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 653, __pyx_L1_error)
30907 127 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
30908 : __pyx_v_ssmax = __pyx_t_14;
30909 :
30910 : /* "scipy/linalg/_decomp_interpolative.pyx":651
30911 : * ssmax = 0
30912 : * kpiv = k+1
30913 : * if k < n-1: # <<<<<<<<<<<<<<
30914 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
30915 : * ssmax = col_norms[kpiv]
30916 : */
30917 : }
30918 :
30919 : /* "scipy/linalg/_decomp_interpolative.pyx":655
30920 : * ssmax = col_norms[kpiv]
30921 : *
30922 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
30923 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
30924 : * nupdate += 1
30925 : */
30926 128 : __pyx_t_24 = (__pyx_v_ssmax < ((1000.0 * __pyx_v_feps) * __pyx_v_ssmaxin));
30927 128 : if (!__pyx_t_24) {
30928 77 : goto __pyx_L12_next_or;
30929 : } else {
30930 51 : }
30931 51 : __pyx_t_24 = (__pyx_v_nupdate == 0);
30932 51 : if (!__pyx_t_24) {
30933 : } else {
30934 9 : __pyx_t_15 = __pyx_t_24;
30935 9 : goto __pyx_L11_bool_binop_done;
30936 : }
30937 119 : __pyx_L12_next_or:;
30938 :
30939 : /* "scipy/linalg/_decomp_interpolative.pyx":656
30940 : *
30941 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
30942 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))): # <<<<<<<<<<<<<<
30943 : * nupdate += 1
30944 : * ssmax = 0
30945 : */
30946 119 : __pyx_t_24 = (__pyx_v_ssmax < (pow((1000.0 * __pyx_v_feps), 2.0) * __pyx_v_ssmaxin));
30947 119 : if (__pyx_t_24) {
30948 0 : } else {
30949 119 : __pyx_t_15 = __pyx_t_24;
30950 119 : goto __pyx_L11_bool_binop_done;
30951 : }
30952 0 : __pyx_t_24 = (__pyx_v_nupdate == 1);
30953 0 : __pyx_t_15 = __pyx_t_24;
30954 128 : __pyx_L11_bool_binop_done:;
30955 :
30956 : /* "scipy/linalg/_decomp_interpolative.pyx":655
30957 : * ssmax = col_norms[kpiv]
30958 : *
30959 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
30960 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
30961 : * nupdate += 1
30962 : */
30963 128 : if (__pyx_t_15) {
30964 :
30965 : /* "scipy/linalg/_decomp_interpolative.pyx":657
30966 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
30967 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
30968 : * nupdate += 1 # <<<<<<<<<<<<<<
30969 : * ssmax = 0
30970 : * kpiv = k+1
30971 : */
30972 9 : __pyx_v_nupdate = (__pyx_v_nupdate + 1);
30973 :
30974 : /* "scipy/linalg/_decomp_interpolative.pyx":658
30975 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
30976 : * nupdate += 1
30977 : * ssmax = 0 # <<<<<<<<<<<<<<
30978 : * kpiv = k+1
30979 : *
30980 : */
30981 9 : __pyx_v_ssmax = 0.0;
30982 :
30983 : /* "scipy/linalg/_decomp_interpolative.pyx":659
30984 : * nupdate += 1
30985 : * ssmax = 0
30986 : * kpiv = k+1 # <<<<<<<<<<<<<<
30987 : *
30988 : * if k < n-1:
30989 : */
30990 9 : __pyx_v_kpiv = (__pyx_v_k + 1);
30991 :
30992 : /* "scipy/linalg/_decomp_interpolative.pyx":661
30993 : * kpiv = k+1
30994 : *
30995 : * if k < n-1: # <<<<<<<<<<<<<<
30996 : * for i in range(k+1, n):
30997 : * tmp_int = m-k-1
30998 : */
30999 9 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
31000 9 : if (__pyx_t_15) {
31001 :
31002 : /* "scipy/linalg/_decomp_interpolative.pyx":662
31003 : *
31004 : * if k < n-1:
31005 : * for i in range(k+1, n): # <<<<<<<<<<<<<<
31006 : * tmp_int = m-k-1
31007 : * col_norms[i] = dnrm2(&tmp_int, &a[k+1, i], &n)**2
31008 : */
31009 1740 : __pyx_t_23 = __pyx_v_n;
31010 : __pyx_t_25 = __pyx_t_23;
31011 1740 : for (__pyx_t_26 = (__pyx_v_k + 1); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
31012 1732 : __pyx_v_i = __pyx_t_26;
31013 :
31014 : /* "scipy/linalg/_decomp_interpolative.pyx":663
31015 : * if k < n-1:
31016 : * for i in range(k+1, n):
31017 : * tmp_int = m-k-1 # <<<<<<<<<<<<<<
31018 : * col_norms[i] = dnrm2(&tmp_int, &a[k+1, i], &n)**2
31019 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
31020 : */
31021 1732 : __pyx_v_tmp_int = ((__pyx_v_m - __pyx_v_k) - 1);
31022 :
31023 : /* "scipy/linalg/_decomp_interpolative.pyx":664
31024 : * for i in range(k+1, n):
31025 : * tmp_int = m-k-1
31026 : * col_norms[i] = dnrm2(&tmp_int, &a[k+1, i], &n)**2 # <<<<<<<<<<<<<<
31027 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
31028 : * ssmax = col_norms[kpiv]
31029 : */
31030 1732 : __pyx_t_17 = (__pyx_v_k + 1);
31031 1732 : __pyx_t_10 = __pyx_v_i;
31032 1732 : __pyx_t_20 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_tmp_int), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 664, __pyx_L1_error)
31033 1732 : __Pyx_GOTREF(__pyx_t_20);
31034 1732 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_20, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 664, __pyx_L1_error)
31035 3464 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
31036 : }
31037 :
31038 : /* "scipy/linalg/_decomp_interpolative.pyx":665
31039 : * tmp_int = m-k-1
31040 : * col_norms[i] = dnrm2(&tmp_int, &a[k+1, i], &n)**2
31041 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1) # <<<<<<<<<<<<<<
31042 : * ssmax = col_norms[kpiv]
31043 : * if (ssmax <= (eps**2)*ssmaxin):
31044 : */
31045 8 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L1_error)
31046 8 : __Pyx_GOTREF(__pyx_t_11);
31047 8 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argmax); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 665, __pyx_L1_error)
31048 8 : __Pyx_GOTREF(__pyx_t_18);
31049 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
31050 8 : __pyx_t_11 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_k + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L1_error)
31051 8 : __Pyx_GOTREF(__pyx_t_11);
31052 8 : __pyx_t_2 = NULL;
31053 8 : __pyx_t_13 = 0;
31054 : #if CYTHON_UNPACK_METHODS
31055 8 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
31056 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18);
31057 0 : if (likely(__pyx_t_2)) {
31058 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
31059 0 : __Pyx_INCREF(__pyx_t_2);
31060 0 : __Pyx_INCREF(function);
31061 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
31062 : __pyx_t_13 = 1;
31063 : }
31064 : }
31065 : #endif
31066 : {
31067 8 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
31068 8 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
31069 8 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
31070 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
31071 8 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 665, __pyx_L1_error)
31072 8 : __Pyx_GOTREF(__pyx_t_20);
31073 8 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
31074 : }
31075 8 : __pyx_t_18 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 665, __pyx_L1_error)
31076 8 : __Pyx_GOTREF(__pyx_t_18);
31077 8 : __pyx_t_11 = PyNumber_Add(__pyx_t_20, __pyx_t_18); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 665, __pyx_L1_error)
31078 8 : __Pyx_GOTREF(__pyx_t_11);
31079 8 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
31080 8 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
31081 8 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
31082 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
31083 8 : __pyx_v_kpiv = __pyx_t_23;
31084 :
31085 : /* "scipy/linalg/_decomp_interpolative.pyx":666
31086 : * col_norms[i] = dnrm2(&tmp_int, &a[k+1, i], &n)**2
31087 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
31088 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
31089 : * if (ssmax <= (eps**2)*ssmaxin):
31090 : * break
31091 : */
31092 8 : __pyx_t_11 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 666, __pyx_L1_error)
31093 8 : __Pyx_GOTREF(__pyx_t_11);
31094 8 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error)
31095 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
31096 : __pyx_v_ssmax = __pyx_t_14;
31097 :
31098 : /* "scipy/linalg/_decomp_interpolative.pyx":661
31099 : * kpiv = k+1
31100 : *
31101 : * if k < n-1: # <<<<<<<<<<<<<<
31102 : * for i in range(k+1, n):
31103 : * tmp_int = m-k-1
31104 : */
31105 : }
31106 :
31107 : /* "scipy/linalg/_decomp_interpolative.pyx":655
31108 : * ssmax = col_norms[kpiv]
31109 : *
31110 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
31111 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
31112 : * nupdate += 1
31113 : */
31114 : }
31115 :
31116 : /* "scipy/linalg/_decomp_interpolative.pyx":629
31117 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]]
31118 : *
31119 : * if k < m-1: # <<<<<<<<<<<<<<
31120 : * # Compute the householder reflector for column k
31121 : * tmp_sca = a[k, k]
31122 : */
31123 : }
31124 :
31125 : /* "scipy/linalg/_decomp_interpolative.pyx":667
31126 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
31127 : * ssmax = col_norms[kpiv]
31128 : * if (ssmax <= (eps**2)*ssmaxin): # <<<<<<<<<<<<<<
31129 : * break
31130 : * # a is overwritten; return numerical rank and pivots
31131 : */
31132 128 : __pyx_t_15 = (__pyx_v_ssmax <= (pow(__pyx_v_eps, 2.0) * __pyx_v_ssmaxin));
31133 128 : if (__pyx_t_15) {
31134 :
31135 : /* "scipy/linalg/_decomp_interpolative.pyx":668
31136 : * ssmax = col_norms[kpiv]
31137 : * if (ssmax <= (eps**2)*ssmaxin):
31138 : * break # <<<<<<<<<<<<<<
31139 : * # a is overwritten; return numerical rank and pivots
31140 : * return k + 1, taus, ind
31141 : */
31142 9 : goto __pyx_L6_break;
31143 :
31144 : /* "scipy/linalg/_decomp_interpolative.pyx":667
31145 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
31146 : * ssmax = col_norms[kpiv]
31147 : * if (ssmax <= (eps**2)*ssmaxin): # <<<<<<<<<<<<<<
31148 : * break
31149 : * # a is overwritten; return numerical rank and pivots
31150 : */
31151 : }
31152 : }
31153 0 : __pyx_L6_break:;
31154 :
31155 : /* "scipy/linalg/_decomp_interpolative.pyx":670
31156 : * break
31157 : * # a is overwritten; return numerical rank and pivots
31158 : * return k + 1, taus, ind # <<<<<<<<<<<<<<
31159 : *
31160 : *
31161 : */
31162 9 : __Pyx_XDECREF(__pyx_r);
31163 9 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 670, __pyx_L1_error)
31164 9 : __Pyx_GOTREF(__pyx_t_11);
31165 9 : __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 670, __pyx_L1_error)
31166 9 : __Pyx_GOTREF(__pyx_t_18);
31167 9 : __Pyx_GIVEREF(__pyx_t_11);
31168 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_11)) __PYX_ERR(0, 670, __pyx_L1_error);
31169 9 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
31170 9 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
31171 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 670, __pyx_L1_error);
31172 9 : __Pyx_INCREF((PyObject *)__pyx_v_ind);
31173 9 : __Pyx_GIVEREF((PyObject *)__pyx_v_ind);
31174 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 2, ((PyObject *)__pyx_v_ind))) __PYX_ERR(0, 670, __pyx_L1_error);
31175 9 : __pyx_t_11 = 0;
31176 9 : __pyx_r = __pyx_t_18;
31177 9 : __pyx_t_18 = 0;
31178 9 : goto __pyx_L0;
31179 :
31180 : /* "scipy/linalg/_decomp_interpolative.pyx":593
31181 : *
31182 : *
31183 : * def iddp_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
31184 : * """
31185 : * This is a minimal version of ?GEQP3 from LAPACK with an
31186 : */
31187 :
31188 : /* function exit code */
31189 0 : __pyx_L1_error:;
31190 0 : __Pyx_XDECREF(__pyx_t_2);
31191 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
31192 0 : __Pyx_XDECREF(__pyx_t_11);
31193 0 : __Pyx_XDECREF(__pyx_t_12);
31194 0 : __Pyx_XDECREF(__pyx_t_16);
31195 0 : __Pyx_XDECREF(__pyx_t_18);
31196 0 : __Pyx_XDECREF(__pyx_t_19);
31197 0 : __Pyx_XDECREF(__pyx_t_20);
31198 0 : __Pyx_XDECREF(__pyx_t_21);
31199 0 : __Pyx_XDECREF(__pyx_t_22);
31200 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
31201 0 : __Pyx_PyThreadState_declare
31202 0 : __Pyx_PyThreadState_assign
31203 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
31204 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
31205 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
31206 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
31207 0 : __pyx_r = NULL;
31208 0 : goto __pyx_L2;
31209 9 : __pyx_L0:;
31210 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
31211 9 : __pyx_L2:;
31212 9 : __Pyx_XDECREF((PyObject *)__pyx_v_col_norms);
31213 9 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
31214 9 : __Pyx_XDECREF((PyObject *)__pyx_v_ind);
31215 9 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_taus_v, 1);
31216 9 : __Pyx_XGIVEREF(__pyx_r);
31217 9 : __Pyx_RefNannyFinishContext();
31218 9 : return __pyx_r;
31219 : }
31220 :
31221 : /* "scipy/linalg/_decomp_interpolative.pyx":673
31222 : *
31223 : *
31224 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
31225 : * _, ret = idd_findrank(A, eps, rng=rng)
31226 : * return iddp_id(ret, eps)
31227 : */
31228 :
31229 : /* Python wrapper */
31230 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_21iddp_rid(PyObject *__pyx_self,
31231 : #if CYTHON_METH_FASTCALL
31232 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
31233 : #else
31234 : PyObject *__pyx_args, PyObject *__pyx_kwds
31235 : #endif
31236 : ); /*proto*/
31237 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_21iddp_rid = {"iddp_rid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_21iddp_rid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
31238 2 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_21iddp_rid(PyObject *__pyx_self,
31239 : #if CYTHON_METH_FASTCALL
31240 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
31241 : #else
31242 : PyObject *__pyx_args, PyObject *__pyx_kwds
31243 : #endif
31244 : ) {
31245 2 : PyObject *__pyx_v_A = 0;
31246 2 : __pyx_t_5numpy_float64_t __pyx_v_eps;
31247 2 : PyObject *__pyx_v_rng = 0;
31248 : #if !CYTHON_METH_FASTCALL
31249 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
31250 : #endif
31251 2 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
31252 2 : PyObject* values[3] = {0,0,0};
31253 2 : int __pyx_lineno = 0;
31254 2 : const char *__pyx_filename = NULL;
31255 2 : int __pyx_clineno = 0;
31256 2 : PyObject *__pyx_r = 0;
31257 : __Pyx_RefNannyDeclarations
31258 2 : __Pyx_RefNannySetupContext("iddp_rid (wrapper)", 0);
31259 : #if !CYTHON_METH_FASTCALL
31260 : #if CYTHON_ASSUME_SAFE_MACROS
31261 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
31262 : #else
31263 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
31264 : #endif
31265 : #endif
31266 2 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
31267 : {
31268 2 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
31269 2 : if (likely(__pyx_kwds)) {
31270 2 : Py_ssize_t kw_args;
31271 2 : switch (__pyx_nargs) {
31272 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
31273 2 : CYTHON_FALLTHROUGH;
31274 2 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
31275 2 : CYTHON_FALLTHROUGH;
31276 2 : case 0: break;
31277 0 : default: goto __pyx_L5_argtuple_error;
31278 : }
31279 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
31280 2 : switch (__pyx_nargs) {
31281 : case 0:
31282 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
31283 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
31284 0 : kw_args--;
31285 : }
31286 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L3_error)
31287 0 : else goto __pyx_L5_argtuple_error;
31288 0 : CYTHON_FALLTHROUGH;
31289 : case 1:
31290 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
31291 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
31292 0 : kw_args--;
31293 : }
31294 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L3_error)
31295 : else {
31296 0 : __Pyx_RaiseArgtupleInvalid("iddp_rid", 1, 2, 2, 1); __PYX_ERR(0, 673, __pyx_L3_error)
31297 : }
31298 2 : CYTHON_FALLTHROUGH;
31299 : case 2:
31300 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
31301 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
31302 2 : kw_args--;
31303 : }
31304 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L3_error)
31305 : else {
31306 0 : __Pyx_RaiseKeywordRequired("iddp_rid", __pyx_n_s_rng); __PYX_ERR(0, 673, __pyx_L3_error)
31307 : }
31308 : }
31309 2 : if (unlikely(kw_args > 0)) {
31310 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
31311 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_rid") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
31312 : }
31313 0 : } else if (unlikely(__pyx_nargs != 2)) {
31314 0 : goto __pyx_L5_argtuple_error;
31315 : } else {
31316 0 : __Pyx_RaiseKeywordRequired("iddp_rid", __pyx_n_s_rng); __PYX_ERR(0, 673, __pyx_L3_error)
31317 : }
31318 2 : __pyx_v_A = values[0];
31319 2 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 673, __pyx_L3_error)
31320 2 : __pyx_v_rng = values[2];
31321 : }
31322 2 : goto __pyx_L6_skip;
31323 0 : __pyx_L5_argtuple_error:;
31324 0 : __Pyx_RaiseArgtupleInvalid("iddp_rid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 673, __pyx_L3_error)
31325 2 : __pyx_L6_skip:;
31326 2 : goto __pyx_L4_argument_unpacking_done;
31327 0 : __pyx_L3_error:;
31328 : {
31329 0 : Py_ssize_t __pyx_temp;
31330 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
31331 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
31332 : }
31333 : }
31334 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
31335 0 : __Pyx_RefNannyFinishContext();
31336 0 : return NULL;
31337 2 : __pyx_L4_argument_unpacking_done:;
31338 2 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_20iddp_rid(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
31339 :
31340 : /* function exit code */
31341 : {
31342 2 : Py_ssize_t __pyx_temp;
31343 2 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
31344 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
31345 : }
31346 : }
31347 : __Pyx_RefNannyFinishContext();
31348 : return __pyx_r;
31349 : }
31350 :
31351 2 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_20iddp_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
31352 2 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
31353 2 : PyObject *__pyx_v_ret = NULL;
31354 2 : PyObject *__pyx_r = NULL;
31355 : __Pyx_RefNannyDeclarations
31356 2 : PyObject *__pyx_t_1 = NULL;
31357 2 : PyObject *__pyx_t_2 = NULL;
31358 2 : PyObject *__pyx_t_3 = NULL;
31359 2 : PyObject *__pyx_t_4 = NULL;
31360 2 : PyObject *(*__pyx_t_5)(PyObject *);
31361 2 : unsigned int __pyx_t_6;
31362 2 : int __pyx_lineno = 0;
31363 2 : const char *__pyx_filename = NULL;
31364 2 : int __pyx_clineno = 0;
31365 2 : __Pyx_RefNannySetupContext("iddp_rid", 1);
31366 :
31367 : /* "scipy/linalg/_decomp_interpolative.pyx":674
31368 : *
31369 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng):
31370 : * _, ret = idd_findrank(A, eps, rng=rng) # <<<<<<<<<<<<<<
31371 : * return iddp_id(ret, eps)
31372 : *
31373 : */
31374 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idd_findrank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
31375 2 : __Pyx_GOTREF(__pyx_t_1);
31376 2 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
31377 2 : __Pyx_GOTREF(__pyx_t_2);
31378 2 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
31379 2 : __Pyx_GOTREF(__pyx_t_3);
31380 2 : __Pyx_INCREF(__pyx_v_A);
31381 2 : __Pyx_GIVEREF(__pyx_v_A);
31382 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_A)) __PYX_ERR(0, 674, __pyx_L1_error);
31383 2 : __Pyx_GIVEREF(__pyx_t_2);
31384 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error);
31385 2 : __pyx_t_2 = 0;
31386 2 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
31387 2 : __Pyx_GOTREF(__pyx_t_2);
31388 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
31389 2 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
31390 2 : __Pyx_GOTREF(__pyx_t_4);
31391 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31392 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31393 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31394 2 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
31395 2 : PyObject* sequence = __pyx_t_4;
31396 2 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
31397 2 : if (unlikely(size != 2)) {
31398 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
31399 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
31400 0 : __PYX_ERR(0, 674, __pyx_L1_error)
31401 : }
31402 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31403 2 : if (likely(PyTuple_CheckExact(sequence))) {
31404 2 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
31405 2 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
31406 : } else {
31407 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
31408 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
31409 : }
31410 2 : __Pyx_INCREF(__pyx_t_2);
31411 2 : __Pyx_INCREF(__pyx_t_3);
31412 : #else
31413 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
31414 : __Pyx_GOTREF(__pyx_t_2);
31415 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
31416 : __Pyx_GOTREF(__pyx_t_3);
31417 : #endif
31418 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31419 : } else {
31420 0 : Py_ssize_t index = -1;
31421 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
31422 0 : __Pyx_GOTREF(__pyx_t_1);
31423 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31424 0 : __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
31425 0 : index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
31426 0 : __Pyx_GOTREF(__pyx_t_2);
31427 0 : index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
31428 0 : __Pyx_GOTREF(__pyx_t_3);
31429 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
31430 0 : __pyx_t_5 = NULL;
31431 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31432 0 : goto __pyx_L4_unpacking_done;
31433 0 : __pyx_L3_unpacking_failed:;
31434 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31435 0 : __pyx_t_5 = NULL;
31436 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
31437 0 : __PYX_ERR(0, 674, __pyx_L1_error)
31438 0 : __pyx_L4_unpacking_done:;
31439 : }
31440 2 : __pyx_v__ = __pyx_t_2;
31441 2 : __pyx_t_2 = 0;
31442 2 : __pyx_v_ret = __pyx_t_3;
31443 2 : __pyx_t_3 = 0;
31444 :
31445 : /* "scipy/linalg/_decomp_interpolative.pyx":675
31446 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng):
31447 : * _, ret = idd_findrank(A, eps, rng=rng)
31448 : * return iddp_id(ret, eps) # <<<<<<<<<<<<<<
31449 : *
31450 : *
31451 : */
31452 2 : __Pyx_XDECREF(__pyx_r);
31453 2 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iddp_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
31454 2 : __Pyx_GOTREF(__pyx_t_3);
31455 2 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
31456 2 : __Pyx_GOTREF(__pyx_t_2);
31457 2 : __pyx_t_1 = NULL;
31458 2 : __pyx_t_6 = 0;
31459 : #if CYTHON_UNPACK_METHODS
31460 2 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
31461 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
31462 0 : if (likely(__pyx_t_1)) {
31463 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
31464 0 : __Pyx_INCREF(__pyx_t_1);
31465 0 : __Pyx_INCREF(function);
31466 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
31467 : __pyx_t_6 = 1;
31468 : }
31469 : }
31470 : #endif
31471 : {
31472 2 : PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_ret, __pyx_t_2};
31473 2 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
31474 2 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
31475 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31476 2 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
31477 2 : __Pyx_GOTREF(__pyx_t_4);
31478 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31479 : }
31480 2 : __pyx_r = __pyx_t_4;
31481 2 : __pyx_t_4 = 0;
31482 2 : goto __pyx_L0;
31483 :
31484 : /* "scipy/linalg/_decomp_interpolative.pyx":673
31485 : *
31486 : *
31487 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
31488 : * _, ret = idd_findrank(A, eps, rng=rng)
31489 : * return iddp_id(ret, eps)
31490 : */
31491 :
31492 : /* function exit code */
31493 0 : __pyx_L1_error:;
31494 0 : __Pyx_XDECREF(__pyx_t_1);
31495 0 : __Pyx_XDECREF(__pyx_t_2);
31496 0 : __Pyx_XDECREF(__pyx_t_3);
31497 0 : __Pyx_XDECREF(__pyx_t_4);
31498 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
31499 0 : __pyx_r = NULL;
31500 2 : __pyx_L0:;
31501 2 : __Pyx_XDECREF(__pyx_v__);
31502 2 : __Pyx_XDECREF(__pyx_v_ret);
31503 2 : __Pyx_XGIVEREF(__pyx_r);
31504 2 : __Pyx_RefNannyFinishContext();
31505 2 : return __pyx_r;
31506 : }
31507 :
31508 : /* "scipy/linalg/_decomp_interpolative.pyx":678
31509 : *
31510 : *
31511 : * def iddp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
31512 : * cdef int n = A.shape[1]
31513 : * cdef int krank, j
31514 : */
31515 :
31516 : /* Python wrapper */
31517 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_23iddp_rsvd(PyObject *__pyx_self,
31518 : #if CYTHON_METH_FASTCALL
31519 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
31520 : #else
31521 : PyObject *__pyx_args, PyObject *__pyx_kwds
31522 : #endif
31523 : ); /*proto*/
31524 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_23iddp_rsvd = {"iddp_rsvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_23iddp_rsvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
31525 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_23iddp_rsvd(PyObject *__pyx_self,
31526 : #if CYTHON_METH_FASTCALL
31527 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
31528 : #else
31529 : PyObject *__pyx_args, PyObject *__pyx_kwds
31530 : #endif
31531 : ) {
31532 1 : PyObject *__pyx_v_A = 0;
31533 1 : __pyx_t_5numpy_float64_t __pyx_v_eps;
31534 1 : PyObject *__pyx_v_rng = 0;
31535 : #if !CYTHON_METH_FASTCALL
31536 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
31537 : #endif
31538 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
31539 1 : PyObject* values[3] = {0,0,0};
31540 1 : int __pyx_lineno = 0;
31541 1 : const char *__pyx_filename = NULL;
31542 1 : int __pyx_clineno = 0;
31543 1 : PyObject *__pyx_r = 0;
31544 : __Pyx_RefNannyDeclarations
31545 1 : __Pyx_RefNannySetupContext("iddp_rsvd (wrapper)", 0);
31546 : #if !CYTHON_METH_FASTCALL
31547 : #if CYTHON_ASSUME_SAFE_MACROS
31548 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
31549 : #else
31550 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
31551 : #endif
31552 : #endif
31553 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
31554 : {
31555 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
31556 1 : if (likely(__pyx_kwds)) {
31557 1 : Py_ssize_t kw_args;
31558 1 : switch (__pyx_nargs) {
31559 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
31560 1 : CYTHON_FALLTHROUGH;
31561 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
31562 1 : CYTHON_FALLTHROUGH;
31563 1 : case 0: break;
31564 0 : default: goto __pyx_L5_argtuple_error;
31565 : }
31566 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
31567 1 : switch (__pyx_nargs) {
31568 : case 0:
31569 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
31570 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
31571 0 : kw_args--;
31572 : }
31573 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L3_error)
31574 0 : else goto __pyx_L5_argtuple_error;
31575 0 : CYTHON_FALLTHROUGH;
31576 : case 1:
31577 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
31578 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
31579 0 : kw_args--;
31580 : }
31581 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L3_error)
31582 : else {
31583 0 : __Pyx_RaiseArgtupleInvalid("iddp_rsvd", 1, 2, 2, 1); __PYX_ERR(0, 678, __pyx_L3_error)
31584 : }
31585 1 : CYTHON_FALLTHROUGH;
31586 : case 2:
31587 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
31588 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
31589 1 : kw_args--;
31590 : }
31591 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L3_error)
31592 : else {
31593 0 : __Pyx_RaiseKeywordRequired("iddp_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 678, __pyx_L3_error)
31594 : }
31595 : }
31596 1 : if (unlikely(kw_args > 0)) {
31597 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
31598 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_rsvd") < 0)) __PYX_ERR(0, 678, __pyx_L3_error)
31599 : }
31600 0 : } else if (unlikely(__pyx_nargs != 2)) {
31601 0 : goto __pyx_L5_argtuple_error;
31602 : } else {
31603 0 : __Pyx_RaiseKeywordRequired("iddp_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 678, __pyx_L3_error)
31604 : }
31605 1 : __pyx_v_A = values[0];
31606 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L3_error)
31607 1 : __pyx_v_rng = values[2];
31608 : }
31609 1 : goto __pyx_L6_skip;
31610 0 : __pyx_L5_argtuple_error:;
31611 0 : __Pyx_RaiseArgtupleInvalid("iddp_rsvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 678, __pyx_L3_error)
31612 1 : __pyx_L6_skip:;
31613 1 : goto __pyx_L4_argument_unpacking_done;
31614 0 : __pyx_L3_error:;
31615 : {
31616 0 : Py_ssize_t __pyx_temp;
31617 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
31618 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
31619 : }
31620 : }
31621 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
31622 0 : __Pyx_RefNannyFinishContext();
31623 0 : return NULL;
31624 1 : __pyx_L4_argument_unpacking_done:;
31625 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_22iddp_rsvd(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
31626 :
31627 : /* function exit code */
31628 : {
31629 1 : Py_ssize_t __pyx_temp;
31630 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
31631 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
31632 : }
31633 : }
31634 : __Pyx_RefNannyFinishContext();
31635 : return __pyx_r;
31636 : }
31637 :
31638 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_22iddp_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
31639 1 : int __pyx_v_n;
31640 1 : int __pyx_v_krank;
31641 1 : int __pyx_v_j;
31642 1 : PyArrayObject *__pyx_v_perms = 0;
31643 1 : PyArrayObject *__pyx_v_proj = 0;
31644 1 : PyArrayObject *__pyx_v_col = 0;
31645 1 : PyArrayObject *__pyx_v_x = 0;
31646 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
31647 1 : __Pyx_Buffer __pyx_pybuffer_col;
31648 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
31649 1 : __Pyx_Buffer __pyx_pybuffer_perms;
31650 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
31651 1 : __Pyx_Buffer __pyx_pybuffer_proj;
31652 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
31653 1 : __Pyx_Buffer __pyx_pybuffer_x;
31654 1 : PyObject *__pyx_r = NULL;
31655 : __Pyx_RefNannyDeclarations
31656 1 : PyObject *__pyx_t_1 = NULL;
31657 1 : PyObject *__pyx_t_2 = NULL;
31658 1 : int __pyx_t_3;
31659 1 : PyObject *__pyx_t_4 = NULL;
31660 1 : PyObject *__pyx_t_5 = NULL;
31661 1 : PyObject *__pyx_t_6 = NULL;
31662 1 : PyObject *(*__pyx_t_7)(PyObject *);
31663 1 : PyArrayObject *__pyx_t_8 = NULL;
31664 1 : PyObject *__pyx_t_9 = NULL;
31665 1 : PyObject *__pyx_t_10 = NULL;
31666 1 : PyObject *__pyx_t_11 = NULL;
31667 1 : PyArrayObject *__pyx_t_12 = NULL;
31668 1 : int __pyx_t_13;
31669 1 : npy_intp __pyx_t_14[2];
31670 1 : PyArrayObject *__pyx_t_15 = NULL;
31671 1 : npy_intp __pyx_t_16[1];
31672 1 : PyArrayObject *__pyx_t_17 = NULL;
31673 1 : int __pyx_t_18;
31674 1 : int __pyx_t_19;
31675 1 : Py_ssize_t __pyx_t_20;
31676 1 : __pyx_t_5numpy_int64_t __pyx_t_21;
31677 1 : unsigned int __pyx_t_22;
31678 1 : int __pyx_lineno = 0;
31679 1 : const char *__pyx_filename = NULL;
31680 1 : int __pyx_clineno = 0;
31681 1 : __Pyx_RefNannySetupContext("iddp_rsvd", 1);
31682 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
31683 1 : __pyx_pybuffer_perms.refcount = 0;
31684 1 : __pyx_pybuffernd_perms.data = NULL;
31685 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
31686 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
31687 1 : __pyx_pybuffer_proj.refcount = 0;
31688 1 : __pyx_pybuffernd_proj.data = NULL;
31689 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
31690 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
31691 1 : __pyx_pybuffer_col.refcount = 0;
31692 1 : __pyx_pybuffernd_col.data = NULL;
31693 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
31694 1 : __pyx_pybuffer_x.pybuffer.buf = NULL;
31695 1 : __pyx_pybuffer_x.refcount = 0;
31696 1 : __pyx_pybuffernd_x.data = NULL;
31697 1 : __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
31698 :
31699 : /* "scipy/linalg/_decomp_interpolative.pyx":679
31700 : *
31701 : * def iddp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng):
31702 : * cdef int n = A.shape[1] # <<<<<<<<<<<<<<
31703 : * cdef int krank, j
31704 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
31705 : */
31706 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
31707 1 : __Pyx_GOTREF(__pyx_t_1);
31708 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
31709 1 : __Pyx_GOTREF(__pyx_t_2);
31710 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31711 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
31712 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31713 1 : __pyx_v_n = __pyx_t_3;
31714 :
31715 : /* "scipy/linalg/_decomp_interpolative.pyx":686
31716 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] x
31717 : *
31718 : * krank, perms, proj = iddp_rid(A, eps, rng=rng) # <<<<<<<<<<<<<<
31719 : * if krank > 0:
31720 : * # idd_getcols
31721 : */
31722 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddp_rid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
31723 1 : __Pyx_GOTREF(__pyx_t_2);
31724 1 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
31725 1 : __Pyx_GOTREF(__pyx_t_1);
31726 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
31727 1 : __Pyx_GOTREF(__pyx_t_4);
31728 1 : __Pyx_INCREF(__pyx_v_A);
31729 1 : __Pyx_GIVEREF(__pyx_v_A);
31730 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 686, __pyx_L1_error);
31731 1 : __Pyx_GIVEREF(__pyx_t_1);
31732 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error);
31733 1 : __pyx_t_1 = 0;
31734 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
31735 1 : __Pyx_GOTREF(__pyx_t_1);
31736 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
31737 1 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
31738 1 : __Pyx_GOTREF(__pyx_t_5);
31739 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31740 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31741 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31742 1 : if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
31743 1 : PyObject* sequence = __pyx_t_5;
31744 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
31745 1 : if (unlikely(size != 3)) {
31746 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
31747 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
31748 0 : __PYX_ERR(0, 686, __pyx_L1_error)
31749 : }
31750 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31751 1 : if (likely(PyTuple_CheckExact(sequence))) {
31752 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
31753 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
31754 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
31755 : } else {
31756 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
31757 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
31758 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
31759 : }
31760 1 : __Pyx_INCREF(__pyx_t_1);
31761 1 : __Pyx_INCREF(__pyx_t_4);
31762 1 : __Pyx_INCREF(__pyx_t_2);
31763 : #else
31764 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
31765 : __Pyx_GOTREF(__pyx_t_1);
31766 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
31767 : __Pyx_GOTREF(__pyx_t_4);
31768 : __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
31769 : __Pyx_GOTREF(__pyx_t_2);
31770 : #endif
31771 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31772 : } else {
31773 0 : Py_ssize_t index = -1;
31774 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L1_error)
31775 0 : __Pyx_GOTREF(__pyx_t_6);
31776 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31777 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
31778 0 : index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
31779 0 : __Pyx_GOTREF(__pyx_t_1);
31780 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
31781 0 : __Pyx_GOTREF(__pyx_t_4);
31782 0 : index = 2; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
31783 0 : __Pyx_GOTREF(__pyx_t_2);
31784 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
31785 0 : __pyx_t_7 = NULL;
31786 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31787 0 : goto __pyx_L4_unpacking_done;
31788 0 : __pyx_L3_unpacking_failed:;
31789 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31790 0 : __pyx_t_7 = NULL;
31791 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
31792 0 : __PYX_ERR(0, 686, __pyx_L1_error)
31793 0 : __pyx_L4_unpacking_done:;
31794 : }
31795 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L1_error)
31796 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31797 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 686, __pyx_L1_error)
31798 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 686, __pyx_L1_error)
31799 1 : __pyx_v_krank = __pyx_t_3;
31800 1 : __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
31801 : {
31802 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
31803 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
31804 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
31805 1 : if (unlikely(__pyx_t_3 < 0)) {
31806 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
31807 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
31808 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
31809 : __Pyx_RaiseBufferFallbackError();
31810 : } else {
31811 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
31812 : }
31813 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
31814 : }
31815 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
31816 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
31817 : }
31818 1 : __pyx_t_8 = 0;
31819 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_4);
31820 1 : __pyx_t_4 = 0;
31821 1 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
31822 : {
31823 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
31824 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
31825 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
31826 1 : if (unlikely(__pyx_t_3 < 0)) {
31827 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
31828 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
31829 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
31830 : __Pyx_RaiseBufferFallbackError();
31831 : } else {
31832 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
31833 : }
31834 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
31835 : }
31836 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
31837 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 686, __pyx_L1_error)
31838 : }
31839 1 : __pyx_t_12 = 0;
31840 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_2);
31841 1 : __pyx_t_2 = 0;
31842 :
31843 : /* "scipy/linalg/_decomp_interpolative.pyx":687
31844 : *
31845 : * krank, perms, proj = iddp_rid(A, eps, rng=rng)
31846 : * if krank > 0: # <<<<<<<<<<<<<<
31847 : * # idd_getcols
31848 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
31849 : */
31850 1 : __pyx_t_13 = (__pyx_v_krank > 0);
31851 1 : if (__pyx_t_13) {
31852 :
31853 : /* "scipy/linalg/_decomp_interpolative.pyx":689
31854 : * if krank > 0:
31855 : * # idd_getcols
31856 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
31857 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
31858 : *
31859 : */
31860 1 : __pyx_t_14[0] = __pyx_v_n;
31861 1 : __pyx_t_14[1] = __pyx_v_krank;
31862 1 : __pyx_t_5 = PyArray_EMPTY(2, __pyx_t_14, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error)
31863 1 : __Pyx_GOTREF(__pyx_t_5);
31864 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 689, __pyx_L1_error)
31865 1 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_5);
31866 : {
31867 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
31868 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
31869 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
31870 1 : if (unlikely(__pyx_t_3 < 0)) {
31871 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
31872 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
31873 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
31874 : __Pyx_RaiseBufferFallbackError();
31875 : } else {
31876 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
31877 : }
31878 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
31879 : }
31880 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
31881 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 689, __pyx_L1_error)
31882 : }
31883 1 : __pyx_t_15 = 0;
31884 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_5);
31885 1 : __pyx_t_5 = 0;
31886 :
31887 : /* "scipy/linalg/_decomp_interpolative.pyx":690
31888 : * # idd_getcols
31889 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
31890 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
31891 : *
31892 : * for j in range(krank):
31893 : */
31894 1 : __pyx_t_16[0] = __pyx_v_n;
31895 1 : __pyx_t_5 = PyArray_ZEROS(1, __pyx_t_16, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 690, __pyx_L1_error)
31896 1 : __Pyx_GOTREF(__pyx_t_5);
31897 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 690, __pyx_L1_error)
31898 1 : __pyx_t_17 = ((PyArrayObject *)__pyx_t_5);
31899 : {
31900 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
31901 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
31902 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
31903 1 : if (unlikely(__pyx_t_3 < 0)) {
31904 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
31905 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
31906 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
31907 : __Pyx_RaiseBufferFallbackError();
31908 : } else {
31909 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
31910 : }
31911 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
31912 : }
31913 1 : __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
31914 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
31915 : }
31916 1 : __pyx_t_17 = 0;
31917 1 : __pyx_v_x = ((PyArrayObject *)__pyx_t_5);
31918 1 : __pyx_t_5 = 0;
31919 :
31920 : /* "scipy/linalg/_decomp_interpolative.pyx":692
31921 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
31922 : *
31923 : * for j in range(krank): # <<<<<<<<<<<<<<
31924 : * x[perms[j]] = 1.
31925 : * col[:, j] = A.matvec(x)
31926 : */
31927 1 : __pyx_t_3 = __pyx_v_krank;
31928 1 : __pyx_t_18 = __pyx_t_3;
31929 19 : for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
31930 18 : __pyx_v_j = __pyx_t_19;
31931 :
31932 : /* "scipy/linalg/_decomp_interpolative.pyx":693
31933 : *
31934 : * for j in range(krank):
31935 : * x[perms[j]] = 1. # <<<<<<<<<<<<<<
31936 : * col[:, j] = A.matvec(x)
31937 : * x[perms[j]] = 0.
31938 : */
31939 18 : __pyx_t_20 = __pyx_v_j;
31940 18 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_perms.diminfo[0].strides));
31941 18 : *__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides) = 1.;
31942 :
31943 : /* "scipy/linalg/_decomp_interpolative.pyx":694
31944 : * for j in range(krank):
31945 : * x[perms[j]] = 1.
31946 : * col[:, j] = A.matvec(x) # <<<<<<<<<<<<<<
31947 : * x[perms[j]] = 0.
31948 : *
31949 : */
31950 18 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
31951 18 : __Pyx_GOTREF(__pyx_t_2);
31952 18 : __pyx_t_4 = NULL;
31953 18 : __pyx_t_22 = 0;
31954 : #if CYTHON_UNPACK_METHODS
31955 18 : if (likely(PyMethod_Check(__pyx_t_2))) {
31956 18 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
31957 18 : if (likely(__pyx_t_4)) {
31958 18 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
31959 18 : __Pyx_INCREF(__pyx_t_4);
31960 18 : __Pyx_INCREF(function);
31961 18 : __Pyx_DECREF_SET(__pyx_t_2, function);
31962 : __pyx_t_22 = 1;
31963 : }
31964 : }
31965 : #endif
31966 : {
31967 18 : PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x)};
31968 18 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_22, 1+__pyx_t_22);
31969 18 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31970 18 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
31971 18 : __Pyx_GOTREF(__pyx_t_5);
31972 18 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31973 : }
31974 18 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
31975 18 : __Pyx_GOTREF(__pyx_t_2);
31976 18 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
31977 18 : __Pyx_GOTREF(__pyx_t_4);
31978 18 : __Pyx_INCREF(__pyx_slice__5);
31979 18 : __Pyx_GIVEREF(__pyx_slice__5);
31980 18 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 694, __pyx_L1_error);
31981 18 : __Pyx_GIVEREF(__pyx_t_2);
31982 18 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error);
31983 18 : __pyx_t_2 = 0;
31984 18 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col), __pyx_t_4, __pyx_t_5) < 0))) __PYX_ERR(0, 694, __pyx_L1_error)
31985 18 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31986 18 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31987 :
31988 : /* "scipy/linalg/_decomp_interpolative.pyx":695
31989 : * x[perms[j]] = 1.
31990 : * col[:, j] = A.matvec(x)
31991 : * x[perms[j]] = 0. # <<<<<<<<<<<<<<
31992 : *
31993 : * return idd_id2svd(cols=col, perms=perms, proj=proj)
31994 : */
31995 18 : __pyx_t_20 = __pyx_v_j;
31996 18 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_perms.diminfo[0].strides));
31997 18 : *__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides) = 0.;
31998 : }
31999 :
32000 : /* "scipy/linalg/_decomp_interpolative.pyx":697
32001 : * x[perms[j]] = 0.
32002 : *
32003 : * return idd_id2svd(cols=col, perms=perms, proj=proj) # <<<<<<<<<<<<<<
32004 : *
32005 : * # TODO: figure out empty return
32006 : */
32007 1 : __Pyx_XDECREF(__pyx_r);
32008 1 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idd_id2svd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
32009 1 : __Pyx_GOTREF(__pyx_t_5);
32010 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
32011 1 : __Pyx_GOTREF(__pyx_t_4);
32012 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cols, ((PyObject *)__pyx_v_col)) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
32013 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_perms, ((PyObject *)__pyx_v_perms)) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
32014 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_proj, ((PyObject *)__pyx_v_proj)) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
32015 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
32016 1 : __Pyx_GOTREF(__pyx_t_2);
32017 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
32018 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32019 1 : __pyx_r = __pyx_t_2;
32020 1 : __pyx_t_2 = 0;
32021 1 : goto __pyx_L0;
32022 :
32023 : /* "scipy/linalg/_decomp_interpolative.pyx":687
32024 : *
32025 : * krank, perms, proj = iddp_rid(A, eps, rng=rng)
32026 : * if krank > 0: # <<<<<<<<<<<<<<
32027 : * # idd_getcols
32028 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
32029 : */
32030 : }
32031 :
32032 : /* "scipy/linalg/_decomp_interpolative.pyx":700
32033 : *
32034 : * # TODO: figure out empty return
32035 : * return None # <<<<<<<<<<<<<<
32036 : *
32037 : *
32038 : */
32039 0 : __Pyx_XDECREF(__pyx_r);
32040 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32041 0 : goto __pyx_L0;
32042 :
32043 : /* "scipy/linalg/_decomp_interpolative.pyx":678
32044 : *
32045 : *
32046 : * def iddp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
32047 : * cdef int n = A.shape[1]
32048 : * cdef int krank, j
32049 : */
32050 :
32051 : /* function exit code */
32052 0 : __pyx_L1_error:;
32053 0 : __Pyx_XDECREF(__pyx_t_1);
32054 0 : __Pyx_XDECREF(__pyx_t_2);
32055 0 : __Pyx_XDECREF(__pyx_t_4);
32056 0 : __Pyx_XDECREF(__pyx_t_5);
32057 0 : __Pyx_XDECREF(__pyx_t_6);
32058 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
32059 0 : __Pyx_PyThreadState_declare
32060 0 : __Pyx_PyThreadState_assign
32061 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
32062 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
32063 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
32064 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
32065 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
32066 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
32067 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
32068 0 : __pyx_r = NULL;
32069 0 : goto __pyx_L2;
32070 1 : __pyx_L0:;
32071 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
32072 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
32073 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
32074 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
32075 1 : __pyx_L2:;
32076 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
32077 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
32078 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
32079 1 : __Pyx_XDECREF((PyObject *)__pyx_v_x);
32080 1 : __Pyx_XGIVEREF(__pyx_r);
32081 1 : __Pyx_RefNannyFinishContext();
32082 1 : return __pyx_r;
32083 : }
32084 :
32085 : /* "scipy/linalg/_decomp_interpolative.pyx":703
32086 : *
32087 : *
32088 : * def iddp_svd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
32089 : * """a is overwritten"""
32090 : * cdef int m = a.shape[0], krank, info
32091 : */
32092 :
32093 : /* Python wrapper */
32094 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_25iddp_svd(PyObject *__pyx_self,
32095 : #if CYTHON_METH_FASTCALL
32096 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32097 : #else
32098 : PyObject *__pyx_args, PyObject *__pyx_kwds
32099 : #endif
32100 : ); /*proto*/
32101 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_21_decomp_interpolative_24iddp_svd, "a is overwritten");
32102 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_25iddp_svd = {"iddp_svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_25iddp_svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_21_decomp_interpolative_24iddp_svd};
32103 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_25iddp_svd(PyObject *__pyx_self,
32104 : #if CYTHON_METH_FASTCALL
32105 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32106 : #else
32107 : PyObject *__pyx_args, PyObject *__pyx_kwds
32108 : #endif
32109 : ) {
32110 1 : PyArrayObject *__pyx_v_a = 0;
32111 1 : double __pyx_v_eps;
32112 : #if !CYTHON_METH_FASTCALL
32113 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
32114 : #endif
32115 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
32116 1 : PyObject* values[2] = {0,0};
32117 1 : int __pyx_lineno = 0;
32118 1 : const char *__pyx_filename = NULL;
32119 1 : int __pyx_clineno = 0;
32120 1 : PyObject *__pyx_r = 0;
32121 : __Pyx_RefNannyDeclarations
32122 1 : __Pyx_RefNannySetupContext("iddp_svd (wrapper)", 0);
32123 : #if !CYTHON_METH_FASTCALL
32124 : #if CYTHON_ASSUME_SAFE_MACROS
32125 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
32126 : #else
32127 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
32128 : #endif
32129 : #endif
32130 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
32131 : {
32132 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
32133 1 : if (__pyx_kwds) {
32134 0 : Py_ssize_t kw_args;
32135 0 : switch (__pyx_nargs) {
32136 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
32137 0 : CYTHON_FALLTHROUGH;
32138 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
32139 0 : CYTHON_FALLTHROUGH;
32140 0 : case 0: break;
32141 0 : default: goto __pyx_L5_argtuple_error;
32142 : }
32143 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
32144 0 : switch (__pyx_nargs) {
32145 : case 0:
32146 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
32147 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
32148 0 : kw_args--;
32149 : }
32150 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
32151 0 : else goto __pyx_L5_argtuple_error;
32152 0 : CYTHON_FALLTHROUGH;
32153 : case 1:
32154 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
32155 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
32156 0 : kw_args--;
32157 : }
32158 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
32159 : else {
32160 0 : __Pyx_RaiseArgtupleInvalid("iddp_svd", 1, 2, 2, 1); __PYX_ERR(0, 703, __pyx_L3_error)
32161 : }
32162 : }
32163 0 : if (unlikely(kw_args > 0)) {
32164 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
32165 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddp_svd") < 0)) __PYX_ERR(0, 703, __pyx_L3_error)
32166 : }
32167 1 : } else if (unlikely(__pyx_nargs != 2)) {
32168 0 : goto __pyx_L5_argtuple_error;
32169 : } else {
32170 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
32171 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
32172 : }
32173 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
32174 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L3_error)
32175 : }
32176 1 : goto __pyx_L6_skip;
32177 0 : __pyx_L5_argtuple_error:;
32178 0 : __Pyx_RaiseArgtupleInvalid("iddp_svd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 703, __pyx_L3_error)
32179 1 : __pyx_L6_skip:;
32180 1 : goto __pyx_L4_argument_unpacking_done;
32181 0 : __pyx_L3_error:;
32182 : {
32183 0 : Py_ssize_t __pyx_temp;
32184 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
32185 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
32186 : }
32187 : }
32188 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
32189 0 : __Pyx_RefNannyFinishContext();
32190 0 : return NULL;
32191 1 : __pyx_L4_argument_unpacking_done:;
32192 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 703, __pyx_L1_error)
32193 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_24iddp_svd(__pyx_self, __pyx_v_a, __pyx_v_eps);
32194 :
32195 : /* function exit code */
32196 1 : goto __pyx_L0;
32197 0 : __pyx_L1_error:;
32198 0 : __pyx_r = NULL;
32199 1 : __pyx_L0:;
32200 : {
32201 1 : Py_ssize_t __pyx_temp;
32202 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
32203 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
32204 : }
32205 : }
32206 : __Pyx_RefNannyFinishContext();
32207 : return __pyx_r;
32208 : }
32209 :
32210 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_24iddp_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps) {
32211 1 : int __pyx_v_m;
32212 1 : int __pyx_v_krank;
32213 1 : int __pyx_v_info;
32214 1 : PyArrayObject *__pyx_v_taus = 0;
32215 1 : PyArrayObject *__pyx_v_UU = 0;
32216 1 : PyArrayObject *__pyx_v_C = 0;
32217 1 : PyObject *__pyx_v_inds = NULL;
32218 1 : PyObject *__pyx_v_r = NULL;
32219 1 : long __pyx_v_p;
32220 1 : PyObject *__pyx_v_U = NULL;
32221 1 : PyObject *__pyx_v_S = NULL;
32222 1 : PyObject *__pyx_v_V = NULL;
32223 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
32224 1 : __Pyx_Buffer __pyx_pybuffer_C;
32225 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
32226 1 : __Pyx_Buffer __pyx_pybuffer_UU;
32227 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
32228 1 : __Pyx_Buffer __pyx_pybuffer_a;
32229 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_taus;
32230 1 : __Pyx_Buffer __pyx_pybuffer_taus;
32231 1 : PyObject *__pyx_r = NULL;
32232 : __Pyx_RefNannyDeclarations
32233 1 : PyObject *__pyx_t_1 = NULL;
32234 1 : PyObject *__pyx_t_2 = NULL;
32235 1 : PyObject *__pyx_t_3 = NULL;
32236 1 : PyObject *__pyx_t_4 = NULL;
32237 1 : unsigned int __pyx_t_5;
32238 1 : PyObject *__pyx_t_6 = NULL;
32239 1 : PyObject *(*__pyx_t_7)(PyObject *);
32240 1 : int __pyx_t_8;
32241 1 : PyArrayObject *__pyx_t_9 = NULL;
32242 1 : PyObject *__pyx_t_10 = NULL;
32243 1 : PyObject *__pyx_t_11 = NULL;
32244 1 : PyObject *__pyx_t_12 = NULL;
32245 1 : int __pyx_t_13;
32246 1 : long __pyx_t_14;
32247 1 : PyArrayObject *__pyx_t_15 = NULL;
32248 1 : PyArrayObject *__pyx_t_16 = NULL;
32249 1 : Py_ssize_t __pyx_t_17;
32250 1 : Py_ssize_t __pyx_t_18;
32251 1 : Py_ssize_t __pyx_t_19;
32252 1 : Py_ssize_t __pyx_t_20;
32253 1 : Py_ssize_t __pyx_t_21;
32254 1 : Py_ssize_t __pyx_t_22;
32255 1 : Py_ssize_t __pyx_t_23;
32256 1 : int __pyx_lineno = 0;
32257 1 : const char *__pyx_filename = NULL;
32258 1 : int __pyx_clineno = 0;
32259 1 : __Pyx_RefNannySetupContext("iddp_svd", 1);
32260 1 : __pyx_pybuffer_taus.pybuffer.buf = NULL;
32261 1 : __pyx_pybuffer_taus.refcount = 0;
32262 1 : __pyx_pybuffernd_taus.data = NULL;
32263 1 : __pyx_pybuffernd_taus.rcbuffer = &__pyx_pybuffer_taus;
32264 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
32265 1 : __pyx_pybuffer_UU.refcount = 0;
32266 1 : __pyx_pybuffernd_UU.data = NULL;
32267 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
32268 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
32269 1 : __pyx_pybuffer_C.refcount = 0;
32270 1 : __pyx_pybuffernd_C.data = NULL;
32271 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
32272 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
32273 1 : __pyx_pybuffer_a.refcount = 0;
32274 1 : __pyx_pybuffernd_a.data = NULL;
32275 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
32276 : {
32277 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
32278 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 703, __pyx_L1_error)
32279 : }
32280 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
32281 :
32282 : /* "scipy/linalg/_decomp_interpolative.pyx":705
32283 : * def iddp_svd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float):
32284 : * """a is overwritten"""
32285 : * cdef int m = a.shape[0], krank, info # <<<<<<<<<<<<<<
32286 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
32287 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] UU
32288 : */
32289 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
32290 :
32291 : /* "scipy/linalg/_decomp_interpolative.pyx":711
32292 : *
32293 : * # Get the pivoted QR
32294 : * krank, taus, inds = iddp_qrpiv(a, eps) # <<<<<<<<<<<<<<
32295 : *
32296 : * if krank > 0:
32297 : */
32298 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddp_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
32299 1 : __Pyx_GOTREF(__pyx_t_2);
32300 1 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error)
32301 1 : __Pyx_GOTREF(__pyx_t_3);
32302 1 : __pyx_t_4 = NULL;
32303 1 : __pyx_t_5 = 0;
32304 : #if CYTHON_UNPACK_METHODS
32305 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
32306 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
32307 0 : if (likely(__pyx_t_4)) {
32308 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
32309 0 : __Pyx_INCREF(__pyx_t_4);
32310 0 : __Pyx_INCREF(function);
32311 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
32312 : __pyx_t_5 = 1;
32313 : }
32314 : }
32315 : #endif
32316 : {
32317 1 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
32318 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
32319 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
32320 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32321 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
32322 1 : __Pyx_GOTREF(__pyx_t_1);
32323 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32324 : }
32325 1 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
32326 1 : PyObject* sequence = __pyx_t_1;
32327 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
32328 1 : if (unlikely(size != 3)) {
32329 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
32330 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
32331 0 : __PYX_ERR(0, 711, __pyx_L1_error)
32332 : }
32333 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32334 1 : if (likely(PyTuple_CheckExact(sequence))) {
32335 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
32336 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
32337 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
32338 : } else {
32339 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
32340 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
32341 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
32342 : }
32343 1 : __Pyx_INCREF(__pyx_t_2);
32344 1 : __Pyx_INCREF(__pyx_t_3);
32345 1 : __Pyx_INCREF(__pyx_t_4);
32346 : #else
32347 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
32348 : __Pyx_GOTREF(__pyx_t_2);
32349 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error)
32350 : __Pyx_GOTREF(__pyx_t_3);
32351 : __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error)
32352 : __Pyx_GOTREF(__pyx_t_4);
32353 : #endif
32354 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32355 : } else {
32356 0 : Py_ssize_t index = -1;
32357 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 711, __pyx_L1_error)
32358 0 : __Pyx_GOTREF(__pyx_t_6);
32359 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32360 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
32361 0 : index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
32362 0 : __Pyx_GOTREF(__pyx_t_2);
32363 0 : index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
32364 0 : __Pyx_GOTREF(__pyx_t_3);
32365 0 : index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
32366 0 : __Pyx_GOTREF(__pyx_t_4);
32367 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 711, __pyx_L1_error)
32368 0 : __pyx_t_7 = NULL;
32369 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32370 0 : goto __pyx_L4_unpacking_done;
32371 0 : __pyx_L3_unpacking_failed:;
32372 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32373 0 : __pyx_t_7 = NULL;
32374 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
32375 0 : __PYX_ERR(0, 711, __pyx_L1_error)
32376 0 : __pyx_L4_unpacking_done:;
32377 : }
32378 1 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
32379 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32380 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 711, __pyx_L1_error)
32381 1 : __pyx_v_krank = __pyx_t_8;
32382 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
32383 : {
32384 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
32385 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
32386 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
32387 1 : if (unlikely(__pyx_t_8 < 0)) {
32388 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
32389 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_v_taus, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
32390 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
32391 : __Pyx_RaiseBufferFallbackError();
32392 : } else {
32393 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
32394 : }
32395 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
32396 : }
32397 1 : __pyx_pybuffernd_taus.diminfo[0].strides = __pyx_pybuffernd_taus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_taus.diminfo[0].shape = __pyx_pybuffernd_taus.rcbuffer->pybuffer.shape[0];
32398 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 711, __pyx_L1_error)
32399 : }
32400 1 : __pyx_t_9 = 0;
32401 1 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_3);
32402 1 : __pyx_t_3 = 0;
32403 1 : __pyx_v_inds = __pyx_t_4;
32404 1 : __pyx_t_4 = 0;
32405 :
32406 : /* "scipy/linalg/_decomp_interpolative.pyx":713
32407 : * krank, taus, inds = iddp_qrpiv(a, eps)
32408 : *
32409 : * if krank > 0: # <<<<<<<<<<<<<<
32410 : * r = np.triu(a[:krank, :])
32411 : * # Apply pivots in reverse
32412 : */
32413 1 : __pyx_t_13 = (__pyx_v_krank > 0);
32414 1 : if (__pyx_t_13) {
32415 :
32416 : /* "scipy/linalg/_decomp_interpolative.pyx":714
32417 : *
32418 : * if krank > 0:
32419 : * r = np.triu(a[:krank, :]) # <<<<<<<<<<<<<<
32420 : * # Apply pivots in reverse
32421 : * for p in range(krank-1, -1, -1):
32422 : */
32423 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error)
32424 1 : __Pyx_GOTREF(__pyx_t_4);
32425 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_triu); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
32426 1 : __Pyx_GOTREF(__pyx_t_3);
32427 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32428 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error)
32429 1 : __Pyx_GOTREF(__pyx_t_4);
32430 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
32431 1 : __Pyx_GOTREF(__pyx_t_2);
32432 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32433 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error)
32434 1 : __Pyx_GOTREF(__pyx_t_4);
32435 1 : __Pyx_GIVEREF(__pyx_t_2);
32436 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error);
32437 1 : __Pyx_INCREF(__pyx_slice__5);
32438 1 : __Pyx_GIVEREF(__pyx_slice__5);
32439 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 714, __pyx_L1_error);
32440 1 : __pyx_t_2 = 0;
32441 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
32442 1 : __Pyx_GOTREF(__pyx_t_2);
32443 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32444 1 : __pyx_t_4 = NULL;
32445 1 : __pyx_t_5 = 0;
32446 : #if CYTHON_UNPACK_METHODS
32447 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
32448 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
32449 0 : if (likely(__pyx_t_4)) {
32450 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
32451 0 : __Pyx_INCREF(__pyx_t_4);
32452 0 : __Pyx_INCREF(function);
32453 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
32454 : __pyx_t_5 = 1;
32455 : }
32456 : }
32457 : #endif
32458 : {
32459 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
32460 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
32461 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
32462 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32463 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
32464 1 : __Pyx_GOTREF(__pyx_t_1);
32465 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32466 : }
32467 1 : __pyx_v_r = __pyx_t_1;
32468 1 : __pyx_t_1 = 0;
32469 :
32470 : /* "scipy/linalg/_decomp_interpolative.pyx":716
32471 : * r = np.triu(a[:krank, :])
32472 : * # Apply pivots in reverse
32473 : * for p in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
32474 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]]
32475 : *
32476 : */
32477 20 : for (__pyx_t_14 = (__pyx_v_krank - 1); __pyx_t_14 > -1L; __pyx_t_14-=1) {
32478 19 : __pyx_v_p = __pyx_t_14;
32479 :
32480 : /* "scipy/linalg/_decomp_interpolative.pyx":717
32481 : * # Apply pivots in reverse
32482 : * for p in range(krank-1, -1, -1):
32483 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]] # <<<<<<<<<<<<<<
32484 : *
32485 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
32486 : */
32487 19 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
32488 19 : __Pyx_GOTREF(__pyx_t_1);
32489 19 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
32490 19 : __Pyx_GOTREF(__pyx_t_3);
32491 19 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
32492 19 : __Pyx_GOTREF(__pyx_t_2);
32493 19 : __Pyx_GIVEREF(__pyx_t_1);
32494 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error);
32495 19 : __Pyx_GIVEREF(__pyx_t_3);
32496 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error);
32497 19 : __pyx_t_1 = 0;
32498 19 : __pyx_t_3 = 0;
32499 19 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
32500 19 : __Pyx_GOTREF(__pyx_t_3);
32501 19 : __Pyx_INCREF(__pyx_slice__5);
32502 19 : __Pyx_GIVEREF(__pyx_slice__5);
32503 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 717, __pyx_L1_error);
32504 19 : __Pyx_GIVEREF(__pyx_t_2);
32505 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error);
32506 19 : __pyx_t_2 = 0;
32507 19 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
32508 19 : __Pyx_GOTREF(__pyx_t_2);
32509 19 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32510 19 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
32511 19 : __Pyx_GOTREF(__pyx_t_3);
32512 19 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
32513 19 : __Pyx_GOTREF(__pyx_t_1);
32514 19 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error)
32515 19 : __Pyx_GOTREF(__pyx_t_4);
32516 19 : __Pyx_GIVEREF(__pyx_t_3);
32517 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error);
32518 19 : __Pyx_GIVEREF(__pyx_t_1);
32519 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error);
32520 19 : __pyx_t_3 = 0;
32521 19 : __pyx_t_1 = 0;
32522 19 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
32523 19 : __Pyx_GOTREF(__pyx_t_1);
32524 19 : __Pyx_INCREF(__pyx_slice__5);
32525 19 : __Pyx_GIVEREF(__pyx_slice__5);
32526 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 717, __pyx_L1_error);
32527 19 : __Pyx_GIVEREF(__pyx_t_4);
32528 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error);
32529 19 : __pyx_t_4 = 0;
32530 19 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 717, __pyx_L1_error)
32531 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32532 38 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32533 : }
32534 :
32535 : /* "scipy/linalg/_decomp_interpolative.pyx":721
32536 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
32537 : * # dgesvd(<char*>'S', <char*>'O', &krank, &n)
32538 : * U, S, V = la.svd(r, full_matrices=False) # <<<<<<<<<<<<<<
32539 : *
32540 : * # Apply Q to U via dorm2r
32541 : */
32542 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_la); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
32543 1 : __Pyx_GOTREF(__pyx_t_2);
32544 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
32545 1 : __Pyx_GOTREF(__pyx_t_1);
32546 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32547 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
32548 1 : __Pyx_GOTREF(__pyx_t_2);
32549 1 : __Pyx_INCREF(__pyx_v_r);
32550 1 : __Pyx_GIVEREF(__pyx_v_r);
32551 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_r)) __PYX_ERR(0, 721, __pyx_L1_error);
32552 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
32553 1 : __Pyx_GOTREF(__pyx_t_4);
32554 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 721, __pyx_L1_error)
32555 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
32556 1 : __Pyx_GOTREF(__pyx_t_3);
32557 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32558 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32559 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32560 1 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
32561 1 : PyObject* sequence = __pyx_t_3;
32562 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
32563 1 : if (unlikely(size != 3)) {
32564 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
32565 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
32566 0 : __PYX_ERR(0, 721, __pyx_L1_error)
32567 : }
32568 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32569 1 : if (likely(PyTuple_CheckExact(sequence))) {
32570 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
32571 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
32572 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
32573 : } else {
32574 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
32575 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
32576 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
32577 : }
32578 1 : __Pyx_INCREF(__pyx_t_4);
32579 1 : __Pyx_INCREF(__pyx_t_2);
32580 1 : __Pyx_INCREF(__pyx_t_1);
32581 : #else
32582 : __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
32583 : __Pyx_GOTREF(__pyx_t_4);
32584 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
32585 : __Pyx_GOTREF(__pyx_t_2);
32586 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
32587 : __Pyx_GOTREF(__pyx_t_1);
32588 : #endif
32589 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32590 : } else {
32591 0 : Py_ssize_t index = -1;
32592 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 721, __pyx_L1_error)
32593 0 : __Pyx_GOTREF(__pyx_t_6);
32594 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32595 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
32596 0 : index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
32597 0 : __Pyx_GOTREF(__pyx_t_4);
32598 0 : index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
32599 0 : __Pyx_GOTREF(__pyx_t_2);
32600 0 : index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
32601 0 : __Pyx_GOTREF(__pyx_t_1);
32602 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 721, __pyx_L1_error)
32603 0 : __pyx_t_7 = NULL;
32604 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32605 0 : goto __pyx_L9_unpacking_done;
32606 0 : __pyx_L8_unpacking_failed:;
32607 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32608 0 : __pyx_t_7 = NULL;
32609 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
32610 0 : __PYX_ERR(0, 721, __pyx_L1_error)
32611 0 : __pyx_L9_unpacking_done:;
32612 : }
32613 1 : __pyx_v_U = __pyx_t_4;
32614 1 : __pyx_t_4 = 0;
32615 1 : __pyx_v_S = __pyx_t_2;
32616 1 : __pyx_t_2 = 0;
32617 1 : __pyx_v_V = __pyx_t_1;
32618 1 : __pyx_t_1 = 0;
32619 :
32620 : /* "scipy/linalg/_decomp_interpolative.pyx":725
32621 : * # Apply Q to U via dorm2r
32622 : * # Possibly U is shorter than Q
32623 : * UU = np.zeros([m, krank], dtype=a.dtype) # <<<<<<<<<<<<<<
32624 : * UU[:krank, :krank] = U
32625 : * # Do the transpose dance for C-layout, use a for scratch
32626 : */
32627 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
32628 1 : __Pyx_GOTREF(__pyx_t_3);
32629 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
32630 1 : __Pyx_GOTREF(__pyx_t_1);
32631 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32632 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
32633 1 : __Pyx_GOTREF(__pyx_t_3);
32634 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
32635 1 : __Pyx_GOTREF(__pyx_t_2);
32636 1 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
32637 1 : __Pyx_GOTREF(__pyx_t_4);
32638 1 : __Pyx_GIVEREF(__pyx_t_3);
32639 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error);
32640 1 : __Pyx_GIVEREF(__pyx_t_2);
32641 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error);
32642 1 : __pyx_t_3 = 0;
32643 1 : __pyx_t_2 = 0;
32644 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
32645 1 : __Pyx_GOTREF(__pyx_t_2);
32646 1 : __Pyx_GIVEREF(__pyx_t_4);
32647 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error);
32648 1 : __pyx_t_4 = 0;
32649 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
32650 1 : __Pyx_GOTREF(__pyx_t_4);
32651 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
32652 1 : __Pyx_GOTREF(__pyx_t_3);
32653 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
32654 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32655 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
32656 1 : __Pyx_GOTREF(__pyx_t_3);
32657 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32658 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32659 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32660 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 725, __pyx_L1_error)
32661 1 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_3);
32662 : {
32663 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
32664 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
32665 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
32666 1 : if (unlikely(__pyx_t_8 < 0)) {
32667 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
32668 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
32669 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
32670 : __Pyx_RaiseBufferFallbackError();
32671 : } else {
32672 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
32673 : }
32674 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
32675 : }
32676 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
32677 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 725, __pyx_L1_error)
32678 : }
32679 1 : __pyx_t_15 = 0;
32680 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_3);
32681 1 : __pyx_t_3 = 0;
32682 :
32683 : /* "scipy/linalg/_decomp_interpolative.pyx":726
32684 : * # Possibly U is shorter than Q
32685 : * UU = np.zeros([m, krank], dtype=a.dtype)
32686 : * UU[:krank, :krank] = U # <<<<<<<<<<<<<<
32687 : * # Do the transpose dance for C-layout, use a for scratch
32688 : * C = a[:, :krank].copy(order='F')
32689 : */
32690 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
32691 1 : __Pyx_GOTREF(__pyx_t_3);
32692 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
32693 1 : __Pyx_GOTREF(__pyx_t_4);
32694 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32695 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
32696 1 : __Pyx_GOTREF(__pyx_t_3);
32697 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
32698 1 : __Pyx_GOTREF(__pyx_t_2);
32699 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32700 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error)
32701 1 : __Pyx_GOTREF(__pyx_t_3);
32702 1 : __Pyx_GIVEREF(__pyx_t_4);
32703 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error);
32704 1 : __Pyx_GIVEREF(__pyx_t_2);
32705 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error);
32706 1 : __pyx_t_4 = 0;
32707 1 : __pyx_t_2 = 0;
32708 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_3, __pyx_v_U) < 0))) __PYX_ERR(0, 726, __pyx_L1_error)
32709 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32710 :
32711 : /* "scipy/linalg/_decomp_interpolative.pyx":728
32712 : * UU[:krank, :krank] = U
32713 : * # Do the transpose dance for C-layout, use a for scratch
32714 : * C = a[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
32715 : * dorm2r(<char*>'R', <char*>'T',
32716 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
32717 : */
32718 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L1_error)
32719 1 : __Pyx_GOTREF(__pyx_t_3);
32720 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
32721 1 : __Pyx_GOTREF(__pyx_t_2);
32722 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32723 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L1_error)
32724 1 : __Pyx_GOTREF(__pyx_t_3);
32725 1 : __Pyx_INCREF(__pyx_slice__5);
32726 1 : __Pyx_GIVEREF(__pyx_slice__5);
32727 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 728, __pyx_L1_error);
32728 1 : __Pyx_GIVEREF(__pyx_t_2);
32729 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error);
32730 1 : __pyx_t_2 = 0;
32731 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
32732 1 : __Pyx_GOTREF(__pyx_t_2);
32733 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32734 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L1_error)
32735 1 : __Pyx_GOTREF(__pyx_t_3);
32736 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32737 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
32738 1 : __Pyx_GOTREF(__pyx_t_2);
32739 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
32740 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
32741 1 : __Pyx_GOTREF(__pyx_t_4);
32742 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32743 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32744 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 728, __pyx_L1_error)
32745 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
32746 : {
32747 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
32748 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
32749 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
32750 1 : if (unlikely(__pyx_t_8 < 0)) {
32751 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
32752 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
32753 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
32754 : __Pyx_RaiseBufferFallbackError();
32755 : } else {
32756 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
32757 : }
32758 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
32759 : }
32760 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
32761 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 728, __pyx_L1_error)
32762 : }
32763 1 : __pyx_t_16 = 0;
32764 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_4);
32765 1 : __pyx_t_4 = 0;
32766 :
32767 : /* "scipy/linalg/_decomp_interpolative.pyx":730
32768 : * C = a[:, :krank].copy(order='F')
32769 : * dorm2r(<char*>'R', <char*>'T',
32770 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0], # <<<<<<<<<<<<<<
32771 : * &UU[0,0], &krank, &a[0, 0], &info)
32772 : *
32773 : */
32774 1 : __pyx_t_17 = 0;
32775 1 : __pyx_t_18 = 0;
32776 1 : __pyx_t_19 = 0;
32777 :
32778 : /* "scipy/linalg/_decomp_interpolative.pyx":731
32779 : * dorm2r(<char*>'R', <char*>'T',
32780 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
32781 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
32782 : *
32783 : * return UU, S, V
32784 : */
32785 1 : __pyx_t_20 = 0;
32786 1 : __pyx_t_21 = 0;
32787 1 : __pyx_t_22 = 0;
32788 1 : __pyx_t_23 = 0;
32789 :
32790 : /* "scipy/linalg/_decomp_interpolative.pyx":729
32791 : * # Do the transpose dance for C-layout, use a for scratch
32792 : * C = a[:, :krank].copy(order='F')
32793 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
32794 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
32795 : * &UU[0,0], &krank, &a[0, 0], &info)
32796 : */
32797 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_taus.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_taus.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
32798 :
32799 : /* "scipy/linalg/_decomp_interpolative.pyx":713
32800 : * krank, taus, inds = iddp_qrpiv(a, eps)
32801 : *
32802 : * if krank > 0: # <<<<<<<<<<<<<<
32803 : * r = np.triu(a[:krank, :])
32804 : * # Apply pivots in reverse
32805 : */
32806 : }
32807 :
32808 : /* "scipy/linalg/_decomp_interpolative.pyx":733
32809 : * &UU[0,0], &krank, &a[0, 0], &info)
32810 : *
32811 : * return UU, S, V # <<<<<<<<<<<<<<
32812 : *
32813 : *
32814 : */
32815 1 : __Pyx_XDECREF(__pyx_r);
32816 1 : if (unlikely(!__pyx_v_S)) { __Pyx_RaiseUnboundLocalError("S"); __PYX_ERR(0, 733, __pyx_L1_error) }
32817 1 : if (unlikely(!__pyx_v_V)) { __Pyx_RaiseUnboundLocalError("V"); __PYX_ERR(0, 733, __pyx_L1_error) }
32818 1 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error)
32819 1 : __Pyx_GOTREF(__pyx_t_4);
32820 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
32821 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
32822 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 733, __pyx_L1_error);
32823 1 : __Pyx_INCREF(__pyx_v_S);
32824 1 : __Pyx_GIVEREF(__pyx_v_S);
32825 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_S)) __PYX_ERR(0, 733, __pyx_L1_error);
32826 1 : __Pyx_INCREF(__pyx_v_V);
32827 1 : __Pyx_GIVEREF(__pyx_v_V);
32828 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_V)) __PYX_ERR(0, 733, __pyx_L1_error);
32829 1 : __pyx_r = __pyx_t_4;
32830 1 : __pyx_t_4 = 0;
32831 1 : goto __pyx_L0;
32832 :
32833 : /* "scipy/linalg/_decomp_interpolative.pyx":703
32834 : *
32835 : *
32836 : * def iddp_svd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
32837 : * """a is overwritten"""
32838 : * cdef int m = a.shape[0], krank, info
32839 : */
32840 :
32841 : /* function exit code */
32842 0 : __pyx_L1_error:;
32843 0 : __Pyx_XDECREF(__pyx_t_1);
32844 0 : __Pyx_XDECREF(__pyx_t_2);
32845 0 : __Pyx_XDECREF(__pyx_t_3);
32846 0 : __Pyx_XDECREF(__pyx_t_4);
32847 0 : __Pyx_XDECREF(__pyx_t_6);
32848 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
32849 0 : __Pyx_PyThreadState_declare
32850 0 : __Pyx_PyThreadState_assign
32851 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
32852 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
32853 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
32854 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
32855 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
32856 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
32857 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddp_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
32858 0 : __pyx_r = NULL;
32859 0 : goto __pyx_L2;
32860 1 : __pyx_L0:;
32861 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
32862 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
32863 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
32864 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
32865 1 : __pyx_L2:;
32866 1 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
32867 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
32868 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
32869 1 : __Pyx_XDECREF(__pyx_v_inds);
32870 1 : __Pyx_XDECREF(__pyx_v_r);
32871 1 : __Pyx_XDECREF(__pyx_v_U);
32872 1 : __Pyx_XDECREF(__pyx_v_S);
32873 1 : __Pyx_XDECREF(__pyx_v_V);
32874 1 : __Pyx_XGIVEREF(__pyx_r);
32875 1 : __Pyx_RefNannyFinishContext();
32876 1 : return __pyx_r;
32877 : }
32878 :
32879 : /* "scipy/linalg/_decomp_interpolative.pyx":736
32880 : *
32881 : *
32882 : * def iddr_aid(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
32883 : * rng):
32884 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, L
32885 : */
32886 :
32887 : /* Python wrapper */
32888 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_27iddr_aid(PyObject *__pyx_self,
32889 : #if CYTHON_METH_FASTCALL
32890 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32891 : #else
32892 : PyObject *__pyx_args, PyObject *__pyx_kwds
32893 : #endif
32894 : ); /*proto*/
32895 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_27iddr_aid = {"iddr_aid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_27iddr_aid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
32896 25 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_27iddr_aid(PyObject *__pyx_self,
32897 : #if CYTHON_METH_FASTCALL
32898 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32899 : #else
32900 : PyObject *__pyx_args, PyObject *__pyx_kwds
32901 : #endif
32902 : ) {
32903 25 : PyArrayObject *__pyx_v_a = 0;
32904 25 : int __pyx_v_krank;
32905 25 : PyObject *__pyx_v_rng = 0;
32906 : #if !CYTHON_METH_FASTCALL
32907 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
32908 : #endif
32909 25 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
32910 25 : PyObject* values[3] = {0,0,0};
32911 25 : int __pyx_lineno = 0;
32912 25 : const char *__pyx_filename = NULL;
32913 25 : int __pyx_clineno = 0;
32914 25 : PyObject *__pyx_r = 0;
32915 : __Pyx_RefNannyDeclarations
32916 25 : __Pyx_RefNannySetupContext("iddr_aid (wrapper)", 0);
32917 : #if !CYTHON_METH_FASTCALL
32918 : #if CYTHON_ASSUME_SAFE_MACROS
32919 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
32920 : #else
32921 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
32922 : #endif
32923 : #endif
32924 25 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
32925 : {
32926 25 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
32927 25 : if (likely(__pyx_kwds)) {
32928 25 : Py_ssize_t kw_args;
32929 25 : switch (__pyx_nargs) {
32930 24 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
32931 25 : CYTHON_FALLTHROUGH;
32932 25 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
32933 25 : CYTHON_FALLTHROUGH;
32934 25 : case 0: break;
32935 0 : default: goto __pyx_L5_argtuple_error;
32936 : }
32937 25 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
32938 25 : switch (__pyx_nargs) {
32939 : case 0:
32940 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
32941 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
32942 0 : kw_args--;
32943 : }
32944 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L3_error)
32945 0 : else goto __pyx_L5_argtuple_error;
32946 1 : CYTHON_FALLTHROUGH;
32947 : case 1:
32948 1 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
32949 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
32950 1 : kw_args--;
32951 : }
32952 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L3_error)
32953 : else {
32954 0 : __Pyx_RaiseArgtupleInvalid("iddr_aid", 1, 2, 2, 1); __PYX_ERR(0, 736, __pyx_L3_error)
32955 : }
32956 25 : CYTHON_FALLTHROUGH;
32957 : case 2:
32958 25 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
32959 25 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
32960 25 : kw_args--;
32961 : }
32962 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L3_error)
32963 : else {
32964 0 : __Pyx_RaiseKeywordRequired("iddr_aid", __pyx_n_s_rng); __PYX_ERR(0, 736, __pyx_L3_error)
32965 : }
32966 : }
32967 25 : if (unlikely(kw_args > 0)) {
32968 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
32969 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_aid") < 0)) __PYX_ERR(0, 736, __pyx_L3_error)
32970 : }
32971 0 : } else if (unlikely(__pyx_nargs != 2)) {
32972 0 : goto __pyx_L5_argtuple_error;
32973 : } else {
32974 0 : __Pyx_RaiseKeywordRequired("iddr_aid", __pyx_n_s_rng); __PYX_ERR(0, 736, __pyx_L3_error)
32975 : }
32976 25 : __pyx_v_a = ((PyArrayObject *)values[0]);
32977 25 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L3_error)
32978 25 : __pyx_v_rng = values[2];
32979 : }
32980 25 : goto __pyx_L6_skip;
32981 0 : __pyx_L5_argtuple_error:;
32982 0 : __Pyx_RaiseArgtupleInvalid("iddr_aid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 736, __pyx_L3_error)
32983 25 : __pyx_L6_skip:;
32984 25 : goto __pyx_L4_argument_unpacking_done;
32985 0 : __pyx_L3_error:;
32986 : {
32987 0 : Py_ssize_t __pyx_temp;
32988 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
32989 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
32990 : }
32991 : }
32992 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
32993 0 : __Pyx_RefNannyFinishContext();
32994 0 : return NULL;
32995 25 : __pyx_L4_argument_unpacking_done:;
32996 25 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 736, __pyx_L1_error)
32997 25 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_26iddr_aid(__pyx_self, __pyx_v_a, __pyx_v_krank, __pyx_v_rng);
32998 :
32999 : /* function exit code */
33000 25 : goto __pyx_L0;
33001 0 : __pyx_L1_error:;
33002 0 : __pyx_r = NULL;
33003 25 : __pyx_L0:;
33004 : {
33005 25 : Py_ssize_t __pyx_temp;
33006 25 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
33007 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
33008 : }
33009 : }
33010 : __Pyx_RefNannyFinishContext();
33011 : return __pyx_r;
33012 : }
33013 :
33014 25 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_26iddr_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng) {
33015 25 : int __pyx_v_m;
33016 25 : int __pyx_v_n;
33017 25 : int __pyx_v_n2;
33018 25 : int __pyx_v_nsteps;
33019 25 : int __pyx_v_row;
33020 25 : int __pyx_v_r;
33021 25 : int __pyx_v_nstep;
33022 25 : int __pyx_v_L;
33023 25 : __pyx_t_5numpy_float64_t __pyx_v_h;
33024 25 : __pyx_t_5numpy_float64_t __pyx_v_alpha;
33025 25 : __pyx_t_5numpy_float64_t __pyx_v_beta;
33026 25 : PyArrayObject *__pyx_v_albetas = 0;
33027 25 : PyArrayObject *__pyx_v_subselect = 0;
33028 25 : __pyx_t_5numpy_float64_t *__pyx_v_aa;
33029 25 : PyArrayObject *__pyx_v_giv2x2 = 0;
33030 25 : PyArrayObject *__pyx_v_rta = 0;
33031 25 : PyArrayObject *__pyx_v_marker = 0;
33032 25 : PyObject *__pyx_v_inds = NULL;
33033 25 : PyObject *__pyx_v_proj = NULL;
33034 25 : PyObject *__pyx_v_ind = NULL;
33035 25 : PyObject *__pyx_v_ind2 = NULL;
33036 25 : PyObject *__pyx_v_k = NULL;
33037 25 : PyObject *__pyx_v_l2 = NULL;
33038 25 : PyObject *__pyx_v_twopi = NULL;
33039 25 : PyObject *__pyx_v_twopii = NULL;
33040 25 : PyObject *__pyx_v_nblock = NULL;
33041 25 : PyObject *__pyx_v_fact = NULL;
33042 25 : PyObject *__pyx_v_wsave = NULL;
33043 25 : PyObject *__pyx_v_j = NULL;
33044 25 : PyObject *__pyx_v_i = NULL;
33045 25 : PyObject *__pyx_v_idivm = NULL;
33046 25 : PyObject *__pyx_v_imodm = NULL;
33047 25 : PyObject *__pyx_v_F = NULL;
33048 25 : PyObject *__pyx_v_csum = NULL;
33049 25 : PyObject *__pyx_v_rsum = NULL;
33050 25 : PyObject *__pyx_v_perms = NULL;
33051 25 : PyObject *__pyx_7genexpr__pyx_v_x = NULL;
33052 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
33053 25 : __Pyx_Buffer __pyx_pybuffer_a;
33054 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_albetas;
33055 25 : __Pyx_Buffer __pyx_pybuffer_albetas;
33056 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_giv2x2;
33057 25 : __Pyx_Buffer __pyx_pybuffer_giv2x2;
33058 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_marker;
33059 25 : __Pyx_Buffer __pyx_pybuffer_marker;
33060 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rta;
33061 25 : __Pyx_Buffer __pyx_pybuffer_rta;
33062 25 : __Pyx_LocalBuf_ND __pyx_pybuffernd_subselect;
33063 25 : __Pyx_Buffer __pyx_pybuffer_subselect;
33064 25 : PyObject *__pyx_r = NULL;
33065 : __Pyx_RefNannyDeclarations
33066 25 : int __pyx_t_1;
33067 25 : int __pyx_t_2;
33068 25 : PyObject *__pyx_t_3 = NULL;
33069 25 : PyObject *__pyx_t_4 = NULL;
33070 25 : PyObject *__pyx_t_5 = NULL;
33071 25 : PyObject *__pyx_t_6 = NULL;
33072 25 : unsigned int __pyx_t_7;
33073 25 : PyObject *(*__pyx_t_8)(PyObject *);
33074 25 : npy_intp __pyx_t_9[1];
33075 25 : npy_intp __pyx_t_10[1];
33076 25 : PyArrayObject *__pyx_t_11 = NULL;
33077 25 : int __pyx_t_12;
33078 25 : PyObject *__pyx_t_13 = NULL;
33079 25 : PyObject *__pyx_t_14 = NULL;
33080 25 : PyObject *__pyx_t_15 = NULL;
33081 25 : Py_ssize_t __pyx_t_16;
33082 25 : PyObject *(*__pyx_t_17)(PyObject *);
33083 25 : long __pyx_t_18;
33084 25 : long __pyx_t_19;
33085 25 : Py_ssize_t __pyx_t_20;
33086 25 : PyObject *__pyx_t_21 = NULL;
33087 25 : PyArrayObject *__pyx_t_22 = NULL;
33088 25 : int __pyx_t_23;
33089 25 : long __pyx_t_24;
33090 25 : PyArrayObject *__pyx_t_25 = NULL;
33091 25 : npy_intp __pyx_t_26[2];
33092 25 : PyArrayObject *__pyx_t_27 = NULL;
33093 25 : int __pyx_t_28;
33094 25 : int __pyx_t_29;
33095 25 : Py_ssize_t __pyx_t_30;
33096 25 : Py_ssize_t __pyx_t_31;
33097 25 : __pyx_t_5numpy_float64_t __pyx_t_32;
33098 25 : __pyx_t_5numpy_float64_t __pyx_t_33;
33099 25 : PyObject *__pyx_t_34 = NULL;
33100 25 : PyArrayObject *__pyx_t_35 = NULL;
33101 25 : PyObject *__pyx_t_36 = NULL;
33102 25 : Py_ssize_t __pyx_t_37;
33103 25 : PyObject *(*__pyx_t_38)(PyObject *);
33104 25 : PyObject *__pyx_t_39 = NULL;
33105 25 : int __pyx_lineno = 0;
33106 25 : const char *__pyx_filename = NULL;
33107 25 : int __pyx_clineno = 0;
33108 25 : __Pyx_RefNannySetupContext("iddr_aid", 1);
33109 25 : __pyx_pybuffer_albetas.pybuffer.buf = NULL;
33110 25 : __pyx_pybuffer_albetas.refcount = 0;
33111 25 : __pyx_pybuffernd_albetas.data = NULL;
33112 25 : __pyx_pybuffernd_albetas.rcbuffer = &__pyx_pybuffer_albetas;
33113 25 : __pyx_pybuffer_subselect.pybuffer.buf = NULL;
33114 25 : __pyx_pybuffer_subselect.refcount = 0;
33115 25 : __pyx_pybuffernd_subselect.data = NULL;
33116 25 : __pyx_pybuffernd_subselect.rcbuffer = &__pyx_pybuffer_subselect;
33117 25 : __pyx_pybuffer_giv2x2.pybuffer.buf = NULL;
33118 25 : __pyx_pybuffer_giv2x2.refcount = 0;
33119 25 : __pyx_pybuffernd_giv2x2.data = NULL;
33120 25 : __pyx_pybuffernd_giv2x2.rcbuffer = &__pyx_pybuffer_giv2x2;
33121 25 : __pyx_pybuffer_rta.pybuffer.buf = NULL;
33122 25 : __pyx_pybuffer_rta.refcount = 0;
33123 25 : __pyx_pybuffernd_rta.data = NULL;
33124 25 : __pyx_pybuffernd_rta.rcbuffer = &__pyx_pybuffer_rta;
33125 25 : __pyx_pybuffer_marker.pybuffer.buf = NULL;
33126 25 : __pyx_pybuffer_marker.refcount = 0;
33127 25 : __pyx_pybuffernd_marker.data = NULL;
33128 25 : __pyx_pybuffernd_marker.rcbuffer = &__pyx_pybuffer_marker;
33129 25 : __pyx_pybuffer_a.pybuffer.buf = NULL;
33130 25 : __pyx_pybuffer_a.refcount = 0;
33131 25 : __pyx_pybuffernd_a.data = NULL;
33132 25 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
33133 : {
33134 25 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33135 25 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 736, __pyx_L1_error)
33136 : }
33137 25 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
33138 :
33139 : /* "scipy/linalg/_decomp_interpolative.pyx":738
33140 : * def iddr_aid(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *,
33141 : * rng):
33142 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, L # <<<<<<<<<<<<<<
33143 : * cdef cnp.float64_t h, alpha, beta
33144 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=3] albetas
33145 : */
33146 25 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
33147 25 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
33148 25 : __pyx_v_nsteps = 3;
33149 :
33150 : /* "scipy/linalg/_decomp_interpolative.pyx":748
33151 : *
33152 : * # idd_aidi
33153 : * L = krank + 8 # <<<<<<<<<<<<<<
33154 : * n2 = 0
33155 : * if (L >= n2) or (L > m):
33156 : */
33157 25 : __pyx_v_L = (__pyx_v_krank + 8);
33158 :
33159 : /* "scipy/linalg/_decomp_interpolative.pyx":749
33160 : * # idd_aidi
33161 : * L = krank + 8
33162 : * n2 = 0 # <<<<<<<<<<<<<<
33163 : * if (L >= n2) or (L > m):
33164 : * inds, proj = iddr_id(a, krank)
33165 : */
33166 25 : __pyx_v_n2 = 0;
33167 :
33168 : /* "scipy/linalg/_decomp_interpolative.pyx":750
33169 : * L = krank + 8
33170 : * n2 = 0
33171 : * if (L >= n2) or (L > m): # <<<<<<<<<<<<<<
33172 : * inds, proj = iddr_id(a, krank)
33173 : * return inds, proj
33174 : */
33175 25 : __pyx_t_2 = (__pyx_v_L >= __pyx_v_n2);
33176 25 : if (!__pyx_t_2) {
33177 0 : } else {
33178 25 : __pyx_t_1 = __pyx_t_2;
33179 25 : goto __pyx_L4_bool_binop_done;
33180 : }
33181 0 : __pyx_t_2 = (__pyx_v_L > __pyx_v_m);
33182 0 : __pyx_t_1 = __pyx_t_2;
33183 25 : __pyx_L4_bool_binop_done:;
33184 25 : if (__pyx_t_1) {
33185 :
33186 : /* "scipy/linalg/_decomp_interpolative.pyx":751
33187 : * n2 = 0
33188 : * if (L >= n2) or (L > m):
33189 : * inds, proj = iddr_id(a, krank) # <<<<<<<<<<<<<<
33190 : * return inds, proj
33191 : *
33192 : */
33193 25 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_iddr_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
33194 25 : __Pyx_GOTREF(__pyx_t_4);
33195 25 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
33196 25 : __Pyx_GOTREF(__pyx_t_5);
33197 25 : __pyx_t_6 = NULL;
33198 25 : __pyx_t_7 = 0;
33199 : #if CYTHON_UNPACK_METHODS
33200 25 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
33201 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
33202 0 : if (likely(__pyx_t_6)) {
33203 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
33204 0 : __Pyx_INCREF(__pyx_t_6);
33205 0 : __Pyx_INCREF(function);
33206 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
33207 : __pyx_t_7 = 1;
33208 : }
33209 : }
33210 : #endif
33211 : {
33212 25 : PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_a), __pyx_t_5};
33213 25 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
33214 25 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
33215 25 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33216 25 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
33217 25 : __Pyx_GOTREF(__pyx_t_3);
33218 25 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33219 : }
33220 25 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
33221 25 : PyObject* sequence = __pyx_t_3;
33222 25 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
33223 25 : if (unlikely(size != 2)) {
33224 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
33225 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
33226 0 : __PYX_ERR(0, 751, __pyx_L1_error)
33227 : }
33228 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33229 25 : if (likely(PyTuple_CheckExact(sequence))) {
33230 25 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
33231 25 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
33232 : } else {
33233 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
33234 0 : __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
33235 : }
33236 25 : __Pyx_INCREF(__pyx_t_4);
33237 25 : __Pyx_INCREF(__pyx_t_5);
33238 : #else
33239 : __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
33240 : __Pyx_GOTREF(__pyx_t_4);
33241 : __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
33242 : __Pyx_GOTREF(__pyx_t_5);
33243 : #endif
33244 25 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33245 : } else {
33246 0 : Py_ssize_t index = -1;
33247 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
33248 0 : __Pyx_GOTREF(__pyx_t_6);
33249 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33250 0 : __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
33251 0 : index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
33252 0 : __Pyx_GOTREF(__pyx_t_4);
33253 0 : index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
33254 0 : __Pyx_GOTREF(__pyx_t_5);
33255 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
33256 0 : __pyx_t_8 = NULL;
33257 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33258 0 : goto __pyx_L7_unpacking_done;
33259 0 : __pyx_L6_unpacking_failed:;
33260 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33261 0 : __pyx_t_8 = NULL;
33262 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
33263 0 : __PYX_ERR(0, 751, __pyx_L1_error)
33264 0 : __pyx_L7_unpacking_done:;
33265 : }
33266 25 : __pyx_v_inds = __pyx_t_4;
33267 25 : __pyx_t_4 = 0;
33268 25 : __pyx_v_proj = __pyx_t_5;
33269 25 : __pyx_t_5 = 0;
33270 :
33271 : /* "scipy/linalg/_decomp_interpolative.pyx":752
33272 : * if (L >= n2) or (L > m):
33273 : * inds, proj = iddr_id(a, krank)
33274 : * return inds, proj # <<<<<<<<<<<<<<
33275 : *
33276 : * n2 = idd_poweroftwo(m)
33277 : */
33278 25 : __Pyx_XDECREF(__pyx_r);
33279 25 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error)
33280 25 : __Pyx_GOTREF(__pyx_t_3);
33281 25 : __Pyx_INCREF(__pyx_v_inds);
33282 25 : __Pyx_GIVEREF(__pyx_v_inds);
33283 25 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_inds)) __PYX_ERR(0, 752, __pyx_L1_error);
33284 25 : __Pyx_INCREF(__pyx_v_proj);
33285 25 : __Pyx_GIVEREF(__pyx_v_proj);
33286 25 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_proj)) __PYX_ERR(0, 752, __pyx_L1_error);
33287 25 : __pyx_r = __pyx_t_3;
33288 25 : __pyx_t_3 = 0;
33289 25 : goto __pyx_L0;
33290 :
33291 : /* "scipy/linalg/_decomp_interpolative.pyx":750
33292 : * L = krank + 8
33293 : * n2 = 0
33294 : * if (L >= n2) or (L > m): # <<<<<<<<<<<<<<
33295 : * inds, proj = iddr_id(a, krank)
33296 : * return inds, proj
33297 : */
33298 : }
33299 :
33300 : /* "scipy/linalg/_decomp_interpolative.pyx":754
33301 : * return inds, proj
33302 : *
33303 : * n2 = idd_poweroftwo(m) # <<<<<<<<<<<<<<
33304 : *
33305 : * # idd_sfrmi
33306 : */
33307 0 : __pyx_v_n2 = __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(__pyx_v_m);
33308 :
33309 : /* "scipy/linalg/_decomp_interpolative.pyx":758
33310 : * # idd_sfrmi
33311 : * # idd_pairsamps
33312 : * ind = rng.permutation(n2) # <<<<<<<<<<<<<<
33313 : * ind2 = cnp.PyArray_ZEROS(1, [L], cnp.NPY_INT64, 0)
33314 : *
33315 : */
33316 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
33317 0 : __Pyx_GOTREF(__pyx_t_5);
33318 0 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error)
33319 0 : __Pyx_GOTREF(__pyx_t_4);
33320 0 : __pyx_t_6 = NULL;
33321 0 : __pyx_t_7 = 0;
33322 : #if CYTHON_UNPACK_METHODS
33323 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
33324 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
33325 0 : if (likely(__pyx_t_6)) {
33326 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
33327 0 : __Pyx_INCREF(__pyx_t_6);
33328 0 : __Pyx_INCREF(function);
33329 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
33330 : __pyx_t_7 = 1;
33331 : }
33332 : }
33333 : #endif
33334 : {
33335 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
33336 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
33337 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
33338 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33339 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
33340 0 : __Pyx_GOTREF(__pyx_t_3);
33341 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33342 : }
33343 0 : __pyx_v_ind = __pyx_t_3;
33344 0 : __pyx_t_3 = 0;
33345 :
33346 : /* "scipy/linalg/_decomp_interpolative.pyx":759
33347 : * # idd_pairsamps
33348 : * ind = rng.permutation(n2)
33349 : * ind2 = cnp.PyArray_ZEROS(1, [L], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
33350 : *
33351 : * marker = cnp.PyArray_ZEROS(1, [n2//2], cnp.NPY_INT64, 0)
33352 : */
33353 0 : __pyx_t_9[0] = __pyx_v_L;
33354 0 : __pyx_t_3 = PyArray_ZEROS(1, __pyx_t_9, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
33355 0 : __Pyx_GOTREF(__pyx_t_3);
33356 0 : __pyx_v_ind2 = __pyx_t_3;
33357 0 : __pyx_t_3 = 0;
33358 :
33359 : /* "scipy/linalg/_decomp_interpolative.pyx":761
33360 : * ind2 = cnp.PyArray_ZEROS(1, [L], cnp.NPY_INT64, 0)
33361 : *
33362 : * marker = cnp.PyArray_ZEROS(1, [n2//2], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
33363 : * for k in range(L):
33364 : * marker[(ind[k]+1)//2] = marker[(ind[k]+1)//2]+1
33365 : */
33366 0 : __pyx_t_10[0] = (__pyx_v_n2 / 2);
33367 0 : __pyx_t_3 = PyArray_ZEROS(1, __pyx_t_10, NPY_INT64, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
33368 0 : __Pyx_GOTREF(__pyx_t_3);
33369 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 761, __pyx_L1_error)
33370 0 : __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
33371 : {
33372 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33373 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_marker.rcbuffer->pybuffer);
33374 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_marker.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
33375 0 : if (unlikely(__pyx_t_12 < 0)) {
33376 0 : PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
33377 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_marker.rcbuffer->pybuffer, (PyObject*)__pyx_v_marker, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
33378 : Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
33379 : __Pyx_RaiseBufferFallbackError();
33380 : } else {
33381 0 : PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
33382 : }
33383 0 : __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
33384 : }
33385 0 : __pyx_pybuffernd_marker.diminfo[0].strides = __pyx_pybuffernd_marker.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_marker.diminfo[0].shape = __pyx_pybuffernd_marker.rcbuffer->pybuffer.shape[0];
33386 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 761, __pyx_L1_error)
33387 : }
33388 0 : __pyx_t_11 = 0;
33389 0 : __pyx_v_marker = ((PyArrayObject *)__pyx_t_3);
33390 0 : __pyx_t_3 = 0;
33391 :
33392 : /* "scipy/linalg/_decomp_interpolative.pyx":762
33393 : *
33394 : * marker = cnp.PyArray_ZEROS(1, [n2//2], cnp.NPY_INT64, 0)
33395 : * for k in range(L): # <<<<<<<<<<<<<<
33396 : * marker[(ind[k]+1)//2] = marker[(ind[k]+1)//2]+1
33397 : *
33398 : */
33399 0 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error)
33400 0 : __Pyx_GOTREF(__pyx_t_3);
33401 0 : __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 762, __pyx_L1_error)
33402 0 : __Pyx_GOTREF(__pyx_t_5);
33403 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33404 0 : if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
33405 0 : __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3);
33406 : __pyx_t_16 = 0;
33407 : __pyx_t_17 = NULL;
33408 : } else {
33409 0 : __pyx_t_16 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error)
33410 0 : __Pyx_GOTREF(__pyx_t_3);
33411 0 : __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 762, __pyx_L1_error)
33412 : }
33413 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33414 0 : for (;;) {
33415 0 : if (likely(!__pyx_t_17)) {
33416 0 : if (likely(PyList_CheckExact(__pyx_t_3))) {
33417 : {
33418 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
33419 : #if !CYTHON_ASSUME_SAFE_MACROS
33420 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 762, __pyx_L1_error)
33421 : #endif
33422 0 : if (__pyx_t_16 >= __pyx_temp) break;
33423 : }
33424 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33425 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_5); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 762, __pyx_L1_error)
33426 : #else
33427 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 762, __pyx_L1_error)
33428 : __Pyx_GOTREF(__pyx_t_5);
33429 : #endif
33430 : } else {
33431 : {
33432 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
33433 : #if !CYTHON_ASSUME_SAFE_MACROS
33434 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 762, __pyx_L1_error)
33435 : #endif
33436 0 : if (__pyx_t_16 >= __pyx_temp) break;
33437 : }
33438 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33439 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_5); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 762, __pyx_L1_error)
33440 : #else
33441 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 762, __pyx_L1_error)
33442 : __Pyx_GOTREF(__pyx_t_5);
33443 : #endif
33444 : }
33445 : } else {
33446 0 : __pyx_t_5 = __pyx_t_17(__pyx_t_3);
33447 0 : if (unlikely(!__pyx_t_5)) {
33448 0 : PyObject* exc_type = PyErr_Occurred();
33449 0 : if (exc_type) {
33450 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33451 0 : else __PYX_ERR(0, 762, __pyx_L1_error)
33452 : }
33453 : break;
33454 : }
33455 0 : __Pyx_GOTREF(__pyx_t_5);
33456 : }
33457 0 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
33458 0 : __pyx_t_5 = 0;
33459 :
33460 : /* "scipy/linalg/_decomp_interpolative.pyx":763
33461 : * marker = cnp.PyArray_ZEROS(1, [n2//2], cnp.NPY_INT64, 0)
33462 : * for k in range(L):
33463 : * marker[(ind[k]+1)//2] = marker[(ind[k]+1)//2]+1 # <<<<<<<<<<<<<<
33464 : *
33465 : * for r in range(n2//2):
33466 : */
33467 0 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_ind, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
33468 0 : __Pyx_GOTREF(__pyx_t_5);
33469 0 : __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
33470 0 : __Pyx_GOTREF(__pyx_t_4);
33471 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33472 0 : __pyx_t_5 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_4, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
33473 0 : __Pyx_GOTREF(__pyx_t_5);
33474 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33475 0 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_marker), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
33476 0 : __Pyx_GOTREF(__pyx_t_4);
33477 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33478 0 : __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
33479 0 : __Pyx_GOTREF(__pyx_t_5);
33480 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33481 0 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_ind, __pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
33482 0 : __Pyx_GOTREF(__pyx_t_4);
33483 0 : __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
33484 0 : __Pyx_GOTREF(__pyx_t_6);
33485 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33486 0 : __pyx_t_4 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_6, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
33487 0 : __Pyx_GOTREF(__pyx_t_4);
33488 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33489 0 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_marker), __pyx_t_4, __pyx_t_5) < 0))) __PYX_ERR(0, 763, __pyx_L1_error)
33490 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33491 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33492 :
33493 : /* "scipy/linalg/_decomp_interpolative.pyx":762
33494 : *
33495 : * marker = cnp.PyArray_ZEROS(1, [n2//2], cnp.NPY_INT64, 0)
33496 : * for k in range(L): # <<<<<<<<<<<<<<
33497 : * marker[(ind[k]+1)//2] = marker[(ind[k]+1)//2]+1
33498 : *
33499 : */
33500 : }
33501 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33502 :
33503 : /* "scipy/linalg/_decomp_interpolative.pyx":765
33504 : * marker[(ind[k]+1)//2] = marker[(ind[k]+1)//2]+1
33505 : *
33506 : * for r in range(n2//2): # <<<<<<<<<<<<<<
33507 : * if marker[r] != 0:
33508 : * l2 += 1
33509 : */
33510 0 : __pyx_t_18 = (__pyx_v_n2 / 2);
33511 0 : __pyx_t_19 = __pyx_t_18;
33512 0 : for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_19; __pyx_t_12+=1) {
33513 0 : __pyx_v_r = __pyx_t_12;
33514 :
33515 : /* "scipy/linalg/_decomp_interpolative.pyx":766
33516 : *
33517 : * for r in range(n2//2):
33518 : * if marker[r] != 0: # <<<<<<<<<<<<<<
33519 : * l2 += 1
33520 : * ind2[r] = r
33521 : */
33522 0 : __pyx_t_20 = __pyx_v_r;
33523 0 : __pyx_t_1 = ((*__Pyx_BufPtrCContig1d(npy_int64 *, __pyx_pybuffernd_marker.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_marker.diminfo[0].strides)) != 0);
33524 0 : if (__pyx_t_1) {
33525 :
33526 : /* "scipy/linalg/_decomp_interpolative.pyx":767
33527 : * for r in range(n2//2):
33528 : * if marker[r] != 0:
33529 : * l2 += 1 # <<<<<<<<<<<<<<
33530 : * ind2[r] = r
33531 : *
33532 : */
33533 0 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 767, __pyx_L1_error) }
33534 : __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_l2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
33535 : __Pyx_GOTREF(__pyx_t_3);
33536 : __Pyx_XDECREF_SET(__pyx_v_l2, __pyx_t_3);
33537 : __pyx_t_3 = 0;
33538 :
33539 : /* "scipy/linalg/_decomp_interpolative.pyx":768
33540 : * if marker[r] != 0:
33541 : * l2 += 1
33542 : * ind2[r] = r # <<<<<<<<<<<<<<
33543 : *
33544 : * # Draw (nsteps x m x 2) arrays from [-1, 1) uniformly and scale
33545 : */
33546 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
33547 : __Pyx_GOTREF(__pyx_t_3);
33548 : if (unlikely((__Pyx_SetItemInt(__pyx_v_ind2, __pyx_v_r, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 768, __pyx_L1_error)
33549 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33550 :
33551 : /* "scipy/linalg/_decomp_interpolative.pyx":766
33552 : *
33553 : * for r in range(n2//2):
33554 : * if marker[r] != 0: # <<<<<<<<<<<<<<
33555 : * l2 += 1
33556 : * ind2[r] = r
33557 : */
33558 : }
33559 : }
33560 :
33561 : /* "scipy/linalg/_decomp_interpolative.pyx":772
33562 : * # Draw (nsteps x m x 2) arrays from [-1, 1) uniformly and scale
33563 : * # each 2-element row to unity norm
33564 : * albetas = rng.uniform(low=-1.0, high=1.0, size=[nsteps, m, 2]) # <<<<<<<<<<<<<<
33565 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas)
33566 : * # Walk over every 2D row and normalize
33567 : */
33568 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
33569 0 : __Pyx_GOTREF(__pyx_t_3);
33570 0 : __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
33571 0 : __Pyx_GOTREF(__pyx_t_5);
33572 0 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_low, __pyx_float_neg_1_0) < 0) __PYX_ERR(0, 772, __pyx_L1_error)
33573 0 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_float_1_0) < 0) __PYX_ERR(0, 772, __pyx_L1_error)
33574 0 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
33575 0 : __Pyx_GOTREF(__pyx_t_4);
33576 0 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
33577 0 : __Pyx_GOTREF(__pyx_t_6);
33578 0 : __pyx_t_21 = PyList_New(3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 772, __pyx_L1_error)
33579 0 : __Pyx_GOTREF(__pyx_t_21);
33580 0 : __Pyx_GIVEREF(__pyx_t_4);
33581 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error);
33582 0 : __Pyx_GIVEREF(__pyx_t_6);
33583 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 1, __pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error);
33584 0 : __Pyx_INCREF(__pyx_int_2);
33585 0 : __Pyx_GIVEREF(__pyx_int_2);
33586 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_21, 2, __pyx_int_2)) __PYX_ERR(0, 772, __pyx_L1_error);
33587 0 : __pyx_t_4 = 0;
33588 0 : __pyx_t_6 = 0;
33589 0 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_size, __pyx_t_21) < 0) __PYX_ERR(0, 772, __pyx_L1_error)
33590 0 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33591 0 : __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 772, __pyx_L1_error)
33592 0 : __Pyx_GOTREF(__pyx_t_21);
33593 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33594 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33595 0 : if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 772, __pyx_L1_error)
33596 0 : __pyx_t_22 = ((PyArrayObject *)__pyx_t_21);
33597 : {
33598 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33599 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
33600 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
33601 0 : if (unlikely(__pyx_t_12 < 0)) {
33602 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
33603 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_v_albetas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
33604 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
33605 : __Pyx_RaiseBufferFallbackError();
33606 : } else {
33607 0 : PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
33608 : }
33609 0 : __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
33610 : }
33611 0 : __pyx_pybuffernd_albetas.diminfo[0].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_albetas.diminfo[0].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_albetas.diminfo[1].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_albetas.diminfo[1].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_albetas.diminfo[2].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_albetas.diminfo[2].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[2];
33612 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 772, __pyx_L1_error)
33613 : }
33614 0 : __pyx_t_22 = 0;
33615 0 : __pyx_v_albetas = ((PyArrayObject *)__pyx_t_21);
33616 0 : __pyx_t_21 = 0;
33617 :
33618 : /* "scipy/linalg/_decomp_interpolative.pyx":773
33619 : * # each 2-element row to unity norm
33620 : * albetas = rng.uniform(low=-1.0, high=1.0, size=[nsteps, m, 2])
33621 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas) # <<<<<<<<<<<<<<
33622 : * # Walk over every 2D row and normalize
33623 : * for r in range(0, 2*nsteps*m, 2):
33624 : */
33625 0 : __pyx_v_aa = ((__pyx_t_5numpy_float64_t *)PyArray_DATA(((PyArrayObject *)__pyx_v_albetas)));
33626 :
33627 : /* "scipy/linalg/_decomp_interpolative.pyx":775
33628 : * aa = <cnp.float64_t *>cnp.PyArray_DATA(albetas)
33629 : * # Walk over every 2D row and normalize
33630 : * for r in range(0, 2*nsteps*m, 2): # <<<<<<<<<<<<<<
33631 : * # ignoring the improbable zero generation by rng.uniform
33632 : * h = 1.0/hypot(aa[r], aa[r+1])
33633 : */
33634 0 : __pyx_t_18 = ((2 * __pyx_v_nsteps) * __pyx_v_m);
33635 0 : __pyx_t_19 = __pyx_t_18;
33636 0 : for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_19; __pyx_t_12+=2) {
33637 0 : __pyx_v_r = __pyx_t_12;
33638 :
33639 : /* "scipy/linalg/_decomp_interpolative.pyx":777
33640 : * for r in range(0, 2*nsteps*m, 2):
33641 : * # ignoring the improbable zero generation by rng.uniform
33642 : * h = 1.0/hypot(aa[r], aa[r+1]) # <<<<<<<<<<<<<<
33643 : * aa[r] *= h
33644 : * aa[r+1] *= h
33645 : */
33646 0 : __pyx_v_h = (1.0 / hypot((__pyx_v_aa[__pyx_v_r]), (__pyx_v_aa[(__pyx_v_r + 1)])));
33647 :
33648 : /* "scipy/linalg/_decomp_interpolative.pyx":778
33649 : * # ignoring the improbable zero generation by rng.uniform
33650 : * h = 1.0/hypot(aa[r], aa[r+1])
33651 : * aa[r] *= h # <<<<<<<<<<<<<<
33652 : * aa[r+1] *= h
33653 : *
33654 : */
33655 0 : __pyx_t_23 = __pyx_v_r;
33656 0 : (__pyx_v_aa[__pyx_t_23]) = ((__pyx_v_aa[__pyx_t_23]) * __pyx_v_h);
33657 :
33658 : /* "scipy/linalg/_decomp_interpolative.pyx":779
33659 : * h = 1.0/hypot(aa[r], aa[r+1])
33660 : * aa[r] *= h
33661 : * aa[r+1] *= h # <<<<<<<<<<<<<<
33662 : *
33663 : * # idd_random_transf
33664 : */
33665 0 : __pyx_t_24 = (__pyx_v_r + 1);
33666 0 : (__pyx_v_aa[__pyx_t_24]) = ((__pyx_v_aa[__pyx_t_24]) * __pyx_v_h);
33667 : }
33668 :
33669 : /* "scipy/linalg/_decomp_interpolative.pyx":782
33670 : *
33671 : * # idd_random_transf
33672 : * rta = a.copy() # <<<<<<<<<<<<<<
33673 : *
33674 : * # Rotate and shuffle "a" nsteps-many times
33675 : */
33676 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L1_error)
33677 0 : __Pyx_GOTREF(__pyx_t_5);
33678 0 : __pyx_t_3 = NULL;
33679 0 : __pyx_t_7 = 0;
33680 : #if CYTHON_UNPACK_METHODS
33681 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
33682 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
33683 0 : if (likely(__pyx_t_3)) {
33684 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
33685 0 : __Pyx_INCREF(__pyx_t_3);
33686 0 : __Pyx_INCREF(function);
33687 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
33688 : __pyx_t_7 = 1;
33689 : }
33690 : }
33691 : #endif
33692 : {
33693 0 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
33694 0 : __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
33695 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
33696 0 : if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 782, __pyx_L1_error)
33697 0 : __Pyx_GOTREF(__pyx_t_21);
33698 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33699 : }
33700 0 : if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 782, __pyx_L1_error)
33701 0 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_21);
33702 : {
33703 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33704 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
33705 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
33706 0 : if (unlikely(__pyx_t_12 < 0)) {
33707 0 : PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
33708 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
33709 : Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
33710 : __Pyx_RaiseBufferFallbackError();
33711 : } else {
33712 0 : PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
33713 : }
33714 0 : __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
33715 : }
33716 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
33717 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 782, __pyx_L1_error)
33718 : }
33719 0 : __pyx_t_25 = 0;
33720 0 : __pyx_v_rta = ((PyArrayObject *)__pyx_t_21);
33721 0 : __pyx_t_21 = 0;
33722 :
33723 : /* "scipy/linalg/_decomp_interpolative.pyx":785
33724 : *
33725 : * # Rotate and shuffle "a" nsteps-many times
33726 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
33727 : * for nstep in range(nsteps):
33728 : * for row in range(m-1):
33729 : */
33730 0 : __pyx_t_26[0] = 2;
33731 0 : __pyx_t_26[1] = 2;
33732 0 : __pyx_t_21 = PyArray_ZEROS(2, __pyx_t_26, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 785, __pyx_L1_error)
33733 0 : __Pyx_GOTREF(__pyx_t_21);
33734 0 : if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 785, __pyx_L1_error)
33735 0 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_21);
33736 : {
33737 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33738 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
33739 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
33740 0 : if (unlikely(__pyx_t_12 < 0)) {
33741 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
33742 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_v_giv2x2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
33743 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
33744 : __Pyx_RaiseBufferFallbackError();
33745 : } else {
33746 0 : PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
33747 : }
33748 0 : __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
33749 : }
33750 0 : __pyx_pybuffernd_giv2x2.diminfo[0].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_giv2x2.diminfo[0].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_giv2x2.diminfo[1].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_giv2x2.diminfo[1].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[1];
33751 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 785, __pyx_L1_error)
33752 : }
33753 0 : __pyx_t_27 = 0;
33754 0 : __pyx_v_giv2x2 = ((PyArrayObject *)__pyx_t_21);
33755 0 : __pyx_t_21 = 0;
33756 :
33757 : /* "scipy/linalg/_decomp_interpolative.pyx":786
33758 : * # Rotate and shuffle "a" nsteps-many times
33759 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0)
33760 : * for nstep in range(nsteps): # <<<<<<<<<<<<<<
33761 : * for row in range(m-1):
33762 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
33763 : */
33764 0 : __pyx_t_12 = __pyx_v_nsteps;
33765 0 : __pyx_t_23 = __pyx_t_12;
33766 0 : for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_23; __pyx_t_28+=1) {
33767 0 : __pyx_v_nstep = __pyx_t_28;
33768 :
33769 : /* "scipy/linalg/_decomp_interpolative.pyx":787
33770 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0)
33771 : * for nstep in range(nsteps):
33772 : * for row in range(m-1): # <<<<<<<<<<<<<<
33773 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
33774 : * giv2x2[0, 0] = alpha
33775 : */
33776 0 : __pyx_t_18 = (__pyx_v_m - 1);
33777 0 : __pyx_t_19 = __pyx_t_18;
33778 0 : for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_19; __pyx_t_29+=1) {
33779 0 : __pyx_v_row = __pyx_t_29;
33780 :
33781 : /* "scipy/linalg/_decomp_interpolative.pyx":788
33782 : * for nstep in range(nsteps):
33783 : * for row in range(m-1):
33784 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1] # <<<<<<<<<<<<<<
33785 : * giv2x2[0, 0] = alpha
33786 : * giv2x2[0, 1] = beta
33787 : */
33788 0 : __pyx_t_20 = __pyx_v_nstep;
33789 0 : __pyx_t_30 = __pyx_v_row;
33790 0 : __pyx_t_31 = 0;
33791 0 : __pyx_t_32 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_albetas.diminfo[2].strides));
33792 0 : __pyx_t_31 = __pyx_v_nstep;
33793 0 : __pyx_t_30 = __pyx_v_row;
33794 0 : __pyx_t_20 = 1;
33795 0 : __pyx_t_33 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_albetas.diminfo[2].strides));
33796 0 : __pyx_v_alpha = __pyx_t_32;
33797 0 : __pyx_v_beta = __pyx_t_33;
33798 :
33799 : /* "scipy/linalg/_decomp_interpolative.pyx":789
33800 : * for row in range(m-1):
33801 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
33802 : * giv2x2[0, 0] = alpha # <<<<<<<<<<<<<<
33803 : * giv2x2[0, 1] = beta
33804 : * giv2x2[1, 0] = -beta
33805 : */
33806 0 : __pyx_t_20 = 0;
33807 0 : __pyx_t_30 = 0;
33808 0 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
33809 :
33810 : /* "scipy/linalg/_decomp_interpolative.pyx":790
33811 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
33812 : * giv2x2[0, 0] = alpha
33813 : * giv2x2[0, 1] = beta # <<<<<<<<<<<<<<
33814 : * giv2x2[1, 0] = -beta
33815 : * giv2x2[1, 1] = alpha
33816 : */
33817 0 : __pyx_t_30 = 0;
33818 0 : __pyx_t_20 = 1;
33819 0 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_beta;
33820 :
33821 : /* "scipy/linalg/_decomp_interpolative.pyx":791
33822 : * giv2x2[0, 0] = alpha
33823 : * giv2x2[0, 1] = beta
33824 : * giv2x2[1, 0] = -beta # <<<<<<<<<<<<<<
33825 : * giv2x2[1, 1] = alpha
33826 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
33827 : */
33828 0 : __pyx_t_20 = 1;
33829 0 : __pyx_t_30 = 0;
33830 0 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = (-__pyx_v_beta);
33831 :
33832 : /* "scipy/linalg/_decomp_interpolative.pyx":792
33833 : * giv2x2[0, 1] = beta
33834 : * giv2x2[1, 0] = -beta
33835 : * giv2x2[1, 1] = alpha # <<<<<<<<<<<<<<
33836 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
33837 : *
33838 : */
33839 0 : __pyx_t_30 = 1;
33840 0 : __pyx_t_20 = 1;
33841 0 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
33842 :
33843 : /* "scipy/linalg/_decomp_interpolative.pyx":793
33844 : * giv2x2[1, 0] = -beta
33845 : * giv2x2[1, 1] = alpha
33846 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :]) # <<<<<<<<<<<<<<
33847 : *
33848 : * rta = rta[rng.permutation(m), :]
33849 : */
33850 0 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 793, __pyx_L1_error)
33851 0 : __Pyx_GOTREF(__pyx_t_21);
33852 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_matmul); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
33853 0 : __Pyx_GOTREF(__pyx_t_5);
33854 0 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33855 0 : __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 793, __pyx_L1_error)
33856 0 : __Pyx_GOTREF(__pyx_t_21);
33857 0 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
33858 0 : __Pyx_GOTREF(__pyx_t_3);
33859 0 : __pyx_t_6 = PySlice_New(__pyx_t_21, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
33860 0 : __Pyx_GOTREF(__pyx_t_6);
33861 0 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33862 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33863 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
33864 0 : __Pyx_GOTREF(__pyx_t_3);
33865 0 : __Pyx_GIVEREF(__pyx_t_6);
33866 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error);
33867 0 : __Pyx_INCREF(__pyx_slice__5);
33868 0 : __Pyx_GIVEREF(__pyx_slice__5);
33869 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 793, __pyx_L1_error);
33870 0 : __pyx_t_6 = 0;
33871 0 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
33872 0 : __Pyx_GOTREF(__pyx_t_6);
33873 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33874 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
33875 0 : __Pyx_GOTREF(__pyx_t_3);
33876 0 : __Pyx_INCREF((PyObject *)__pyx_v_giv2x2);
33877 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_giv2x2);
33878 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_giv2x2))) __PYX_ERR(0, 793, __pyx_L1_error);
33879 0 : __Pyx_GIVEREF(__pyx_t_6);
33880 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error);
33881 0 : __pyx_t_6 = 0;
33882 0 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
33883 0 : __Pyx_GOTREF(__pyx_t_6);
33884 0 : __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 793, __pyx_L1_error)
33885 0 : __Pyx_GOTREF(__pyx_t_21);
33886 0 : __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error)
33887 0 : __Pyx_GOTREF(__pyx_t_4);
33888 0 : __pyx_t_34 = PySlice_New(__pyx_t_21, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error)
33889 0 : __Pyx_GOTREF(__pyx_t_34);
33890 0 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33891 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33892 0 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error)
33893 0 : __Pyx_GOTREF(__pyx_t_4);
33894 0 : __Pyx_GIVEREF(__pyx_t_34);
33895 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error);
33896 0 : __Pyx_INCREF(__pyx_slice__5);
33897 0 : __Pyx_GIVEREF(__pyx_slice__5);
33898 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 793, __pyx_L1_error);
33899 0 : __pyx_t_34 = 0;
33900 0 : __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_4); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error)
33901 0 : __Pyx_GOTREF(__pyx_t_34);
33902 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33903 0 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_out, __pyx_t_34) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
33904 0 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
33905 0 : __pyx_t_34 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 793, __pyx_L1_error)
33906 0 : __Pyx_GOTREF(__pyx_t_34);
33907 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33908 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33909 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33910 0 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
33911 : }
33912 :
33913 : /* "scipy/linalg/_decomp_interpolative.pyx":795
33914 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
33915 : *
33916 : * rta = rta[rng.permutation(m), :] # <<<<<<<<<<<<<<
33917 : *
33918 : * # idd_subselect pick randomly n2-many rows
33919 : */
33920 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error)
33921 0 : __Pyx_GOTREF(__pyx_t_6);
33922 0 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
33923 0 : __Pyx_GOTREF(__pyx_t_3);
33924 0 : __pyx_t_5 = NULL;
33925 0 : __pyx_t_7 = 0;
33926 : #if CYTHON_UNPACK_METHODS
33927 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
33928 0 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
33929 0 : if (likely(__pyx_t_5)) {
33930 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
33931 0 : __Pyx_INCREF(__pyx_t_5);
33932 0 : __Pyx_INCREF(function);
33933 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
33934 : __pyx_t_7 = 1;
33935 : }
33936 : }
33937 : #endif
33938 : {
33939 0 : PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
33940 0 : __pyx_t_34 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
33941 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
33942 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33943 0 : if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 795, __pyx_L1_error)
33944 0 : __Pyx_GOTREF(__pyx_t_34);
33945 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33946 : }
33947 0 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error)
33948 0 : __Pyx_GOTREF(__pyx_t_6);
33949 0 : __Pyx_GIVEREF(__pyx_t_34);
33950 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_34)) __PYX_ERR(0, 795, __pyx_L1_error);
33951 0 : __Pyx_INCREF(__pyx_slice__5);
33952 0 : __Pyx_GIVEREF(__pyx_slice__5);
33953 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__5)) __PYX_ERR(0, 795, __pyx_L1_error);
33954 0 : __pyx_t_34 = 0;
33955 0 : __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_6); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 795, __pyx_L1_error)
33956 0 : __Pyx_GOTREF(__pyx_t_34);
33957 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33958 0 : if (!(likely(((__pyx_t_34) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_34, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 795, __pyx_L1_error)
33959 0 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_34);
33960 : {
33961 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
33962 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
33963 0 : __pyx_t_29 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
33964 0 : if (unlikely(__pyx_t_29 < 0)) {
33965 0 : PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
33966 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
33967 0 : Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
33968 0 : __Pyx_RaiseBufferFallbackError();
33969 : } else {
33970 0 : PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
33971 : }
33972 0 : __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
33973 : }
33974 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
33975 0 : if (unlikely((__pyx_t_29 < 0))) __PYX_ERR(0, 795, __pyx_L1_error)
33976 : }
33977 0 : __pyx_t_25 = 0;
33978 0 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_34));
33979 0 : __pyx_t_34 = 0;
33980 : }
33981 :
33982 : /* "scipy/linalg/_decomp_interpolative.pyx":798
33983 : *
33984 : * # idd_subselect pick randomly n2-many rows
33985 : * subselect = rng.choice(m, n2, replace=False) # <<<<<<<<<<<<<<
33986 : * rta = rta[subselect, :]
33987 : *
33988 : */
33989 0 : __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 798, __pyx_L1_error)
33990 0 : __Pyx_GOTREF(__pyx_t_34);
33991 0 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 798, __pyx_L1_error)
33992 0 : __Pyx_GOTREF(__pyx_t_6);
33993 0 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error)
33994 0 : __Pyx_GOTREF(__pyx_t_3);
33995 0 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 798, __pyx_L1_error)
33996 0 : __Pyx_GOTREF(__pyx_t_5);
33997 0 : __Pyx_GIVEREF(__pyx_t_6);
33998 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 798, __pyx_L1_error);
33999 0 : __Pyx_GIVEREF(__pyx_t_3);
34000 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error);
34001 0 : __pyx_t_6 = 0;
34002 0 : __pyx_t_3 = 0;
34003 0 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error)
34004 0 : __Pyx_GOTREF(__pyx_t_3);
34005 0 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
34006 0 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 798, __pyx_L1_error)
34007 0 : __Pyx_GOTREF(__pyx_t_6);
34008 0 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34009 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34010 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34011 0 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 798, __pyx_L1_error)
34012 0 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_6);
34013 : {
34014 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
34015 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
34016 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
34017 0 : if (unlikely(__pyx_t_12 < 0)) {
34018 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
34019 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_v_subselect, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
34020 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
34021 : __Pyx_RaiseBufferFallbackError();
34022 : } else {
34023 0 : PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
34024 : }
34025 0 : __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
34026 : }
34027 0 : __pyx_pybuffernd_subselect.diminfo[0].strides = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_subselect.diminfo[0].shape = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.shape[0];
34028 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 798, __pyx_L1_error)
34029 : }
34030 0 : __pyx_t_35 = 0;
34031 0 : __pyx_v_subselect = ((PyArrayObject *)__pyx_t_6);
34032 0 : __pyx_t_6 = 0;
34033 :
34034 : /* "scipy/linalg/_decomp_interpolative.pyx":799
34035 : * # idd_subselect pick randomly n2-many rows
34036 : * subselect = rng.choice(m, n2, replace=False)
34037 : * rta = rta[subselect, :] # <<<<<<<<<<<<<<
34038 : *
34039 : * # idd_sffti
34040 : */
34041 0 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 799, __pyx_L1_error)
34042 0 : __Pyx_GOTREF(__pyx_t_6);
34043 0 : __Pyx_INCREF((PyObject *)__pyx_v_subselect);
34044 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_subselect);
34045 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_subselect))) __PYX_ERR(0, 799, __pyx_L1_error);
34046 0 : __Pyx_INCREF(__pyx_slice__5);
34047 0 : __Pyx_GIVEREF(__pyx_slice__5);
34048 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__5)) __PYX_ERR(0, 799, __pyx_L1_error);
34049 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error)
34050 0 : __Pyx_GOTREF(__pyx_t_3);
34051 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34052 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 799, __pyx_L1_error)
34053 0 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_3);
34054 : {
34055 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
34056 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
34057 0 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
34058 0 : if (unlikely(__pyx_t_12 < 0)) {
34059 0 : PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
34060 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
34061 0 : Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
34062 0 : __Pyx_RaiseBufferFallbackError();
34063 : } else {
34064 0 : PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
34065 : }
34066 0 : __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
34067 : }
34068 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
34069 0 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 799, __pyx_L1_error)
34070 : }
34071 0 : __pyx_t_25 = 0;
34072 0 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_3));
34073 0 : __pyx_t_3 = 0;
34074 :
34075 : /* "scipy/linalg/_decomp_interpolative.pyx":802
34076 : *
34077 : * # idd_sffti
34078 : * twopi = 2*np.pi # <<<<<<<<<<<<<<
34079 : * twopii = twopi*1.j
34080 : * nblock = idd_ldiv(l2, n2)
34081 : */
34082 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
34083 0 : __Pyx_GOTREF(__pyx_t_3);
34084 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 802, __pyx_L1_error)
34085 0 : __Pyx_GOTREF(__pyx_t_6);
34086 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34087 0 : __pyx_t_3 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_6, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
34088 0 : __Pyx_GOTREF(__pyx_t_3);
34089 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34090 0 : __pyx_v_twopi = __pyx_t_3;
34091 0 : __pyx_t_3 = 0;
34092 :
34093 : /* "scipy/linalg/_decomp_interpolative.pyx":803
34094 : * # idd_sffti
34095 : * twopi = 2*np.pi
34096 : * twopii = twopi*1.j # <<<<<<<<<<<<<<
34097 : * nblock = idd_ldiv(l2, n2)
34098 : * fact = 1/np.sqrt(n2)
34099 : */
34100 0 : __pyx_t_3 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error)
34101 0 : __Pyx_GOTREF(__pyx_t_3);
34102 0 : __pyx_t_6 = PyNumber_Multiply(__pyx_v_twopi, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 803, __pyx_L1_error)
34103 0 : __Pyx_GOTREF(__pyx_t_6);
34104 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34105 0 : __pyx_v_twopii = __pyx_t_6;
34106 0 : __pyx_t_6 = 0;
34107 :
34108 : /* "scipy/linalg/_decomp_interpolative.pyx":804
34109 : * twopi = 2*np.pi
34110 : * twopii = twopi*1.j
34111 : * nblock = idd_ldiv(l2, n2) # <<<<<<<<<<<<<<
34112 : * fact = 1/np.sqrt(n2)
34113 : *
34114 : */
34115 0 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 804, __pyx_L1_error) }
34116 : __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_l2); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
34117 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_ldiv(__pyx_t_12, __pyx_v_n2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 804, __pyx_L1_error)
34118 : __Pyx_GOTREF(__pyx_t_6);
34119 : __pyx_v_nblock = __pyx_t_6;
34120 : __pyx_t_6 = 0;
34121 :
34122 : /* "scipy/linalg/_decomp_interpolative.pyx":805
34123 : * twopii = twopi*1.j
34124 : * nblock = idd_ldiv(l2, n2)
34125 : * fact = 1/np.sqrt(n2) # <<<<<<<<<<<<<<
34126 : *
34127 : * if l2 == 1:
34128 : */
34129 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
34130 : __Pyx_GOTREF(__pyx_t_3);
34131 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
34132 : __Pyx_GOTREF(__pyx_t_5);
34133 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34134 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
34135 : __Pyx_GOTREF(__pyx_t_3);
34136 : __pyx_t_34 = NULL;
34137 : __pyx_t_7 = 0;
34138 : #if CYTHON_UNPACK_METHODS
34139 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
34140 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_5);
34141 : if (likely(__pyx_t_34)) {
34142 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
34143 : __Pyx_INCREF(__pyx_t_34);
34144 : __Pyx_INCREF(function);
34145 : __Pyx_DECREF_SET(__pyx_t_5, function);
34146 : __pyx_t_7 = 1;
34147 : }
34148 : }
34149 : #endif
34150 : {
34151 : PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_3};
34152 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
34153 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
34154 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34155 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error)
34156 : __Pyx_GOTREF(__pyx_t_6);
34157 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34158 : }
34159 : __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
34160 : __Pyx_GOTREF(__pyx_t_5);
34161 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34162 : __pyx_v_fact = __pyx_t_5;
34163 : __pyx_t_5 = 0;
34164 :
34165 : /* "scipy/linalg/_decomp_interpolative.pyx":807
34166 : * fact = 1/np.sqrt(n2)
34167 : *
34168 : * if l2 == 1: # <<<<<<<<<<<<<<
34169 : * wsave = np.exp(-twopii*k*ind2[0]/np.arange(1, n2+1))*fact
34170 : * else:
34171 : */
34172 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 807, __pyx_L1_error) }
34173 : __pyx_t_1 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_l2, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 807, __pyx_L1_error)
34174 : if (__pyx_t_1) {
34175 :
34176 : /* "scipy/linalg/_decomp_interpolative.pyx":808
34177 : *
34178 : * if l2 == 1:
34179 : * wsave = np.exp(-twopii*k*ind2[0]/np.arange(1, n2+1))*fact # <<<<<<<<<<<<<<
34180 : * else:
34181 : * m = n2//nblock
34182 : */
34183 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
34184 : __Pyx_GOTREF(__pyx_t_6);
34185 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
34186 : __Pyx_GOTREF(__pyx_t_3);
34187 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34188 : __pyx_t_6 = PyNumber_Negative(__pyx_v_twopii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
34189 : __Pyx_GOTREF(__pyx_t_6);
34190 : if (unlikely(!__pyx_v_k)) { __Pyx_RaiseUnboundLocalError("k"); __PYX_ERR(0, 808, __pyx_L1_error) }
34191 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 808, __pyx_L1_error)
34192 : __Pyx_GOTREF(__pyx_t_34);
34193 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34194 : __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ind2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
34195 : __Pyx_GOTREF(__pyx_t_6);
34196 : __pyx_t_4 = PyNumber_Multiply(__pyx_t_34, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
34197 : __Pyx_GOTREF(__pyx_t_4);
34198 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34199 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34200 : __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 808, __pyx_L1_error)
34201 : __Pyx_GOTREF(__pyx_t_34);
34202 : __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_arange); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 808, __pyx_L1_error)
34203 : __Pyx_GOTREF(__pyx_t_21);
34204 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34205 : __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_n2 + 1)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 808, __pyx_L1_error)
34206 : __Pyx_GOTREF(__pyx_t_34);
34207 : __pyx_t_36 = NULL;
34208 : __pyx_t_7 = 0;
34209 : #if CYTHON_UNPACK_METHODS
34210 : if (unlikely(PyMethod_Check(__pyx_t_21))) {
34211 : __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_21);
34212 : if (likely(__pyx_t_36)) {
34213 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
34214 : __Pyx_INCREF(__pyx_t_36);
34215 : __Pyx_INCREF(function);
34216 : __Pyx_DECREF_SET(__pyx_t_21, function);
34217 : __pyx_t_7 = 1;
34218 : }
34219 : }
34220 : #endif
34221 : {
34222 : PyObject *__pyx_callargs[3] = {__pyx_t_36, __pyx_int_1, __pyx_t_34};
34223 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
34224 : __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
34225 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34226 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
34227 : __Pyx_GOTREF(__pyx_t_6);
34228 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
34229 : }
34230 : __pyx_t_21 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 808, __pyx_L1_error)
34231 : __Pyx_GOTREF(__pyx_t_21);
34232 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34233 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34234 : __pyx_t_6 = NULL;
34235 : __pyx_t_7 = 0;
34236 : #if CYTHON_UNPACK_METHODS
34237 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
34238 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
34239 : if (likely(__pyx_t_6)) {
34240 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
34241 : __Pyx_INCREF(__pyx_t_6);
34242 : __Pyx_INCREF(function);
34243 : __Pyx_DECREF_SET(__pyx_t_3, function);
34244 : __pyx_t_7 = 1;
34245 : }
34246 : }
34247 : #endif
34248 : {
34249 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_21};
34250 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
34251 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
34252 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
34253 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __pyx_L1_error)
34254 : __Pyx_GOTREF(__pyx_t_5);
34255 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34256 : }
34257 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fact); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
34258 : __Pyx_GOTREF(__pyx_t_3);
34259 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34260 : __pyx_v_wsave = __pyx_t_3;
34261 : __pyx_t_3 = 0;
34262 :
34263 : /* "scipy/linalg/_decomp_interpolative.pyx":807
34264 : * fact = 1/np.sqrt(n2)
34265 : *
34266 : * if l2 == 1: # <<<<<<<<<<<<<<
34267 : * wsave = np.exp(-twopii*k*ind2[0]/np.arange(1, n2+1))*fact
34268 : * else:
34269 : */
34270 : goto __pyx_L20;
34271 : }
34272 :
34273 : /* "scipy/linalg/_decomp_interpolative.pyx":810
34274 : * wsave = np.exp(-twopii*k*ind2[0]/np.arange(1, n2+1))*fact
34275 : * else:
34276 : * m = n2//nblock # <<<<<<<<<<<<<<
34277 : *
34278 : * wsave = np.empty(m*l2, dtype=complex)
34279 : */
34280 : /*else*/ {
34281 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
34282 : __Pyx_GOTREF(__pyx_t_3);
34283 : __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_v_nblock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L1_error)
34284 : __Pyx_GOTREF(__pyx_t_5);
34285 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34286 : __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L1_error)
34287 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34288 : __pyx_v_m = __pyx_t_12;
34289 :
34290 : /* "scipy/linalg/_decomp_interpolative.pyx":812
34291 : * m = n2//nblock
34292 : *
34293 : * wsave = np.empty(m*l2, dtype=complex) # <<<<<<<<<<<<<<
34294 : * for j in range(l2):
34295 : * i = ind2[j]
34296 : */
34297 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
34298 : __Pyx_GOTREF(__pyx_t_5);
34299 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
34300 : __Pyx_GOTREF(__pyx_t_3);
34301 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34302 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
34303 : __Pyx_GOTREF(__pyx_t_5);
34304 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 812, __pyx_L1_error) }
34305 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_5, __pyx_v_l2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 812, __pyx_L1_error)
34306 : __Pyx_GOTREF(__pyx_t_21);
34307 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34308 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
34309 : __Pyx_GOTREF(__pyx_t_5);
34310 : __Pyx_GIVEREF(__pyx_t_21);
34311 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_21)) __PYX_ERR(0, 812, __pyx_L1_error);
34312 : __pyx_t_21 = 0;
34313 : __pyx_t_21 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 812, __pyx_L1_error)
34314 : __Pyx_GOTREF(__pyx_t_21);
34315 : if (PyDict_SetItem(__pyx_t_21, __pyx_n_s_dtype, ((PyObject *)(&PyComplex_Type))) < 0) __PYX_ERR(0, 812, __pyx_L1_error)
34316 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_21); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
34317 : __Pyx_GOTREF(__pyx_t_6);
34318 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34319 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34320 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
34321 : __pyx_v_wsave = __pyx_t_6;
34322 : __pyx_t_6 = 0;
34323 :
34324 : /* "scipy/linalg/_decomp_interpolative.pyx":813
34325 : *
34326 : * wsave = np.empty(m*l2, dtype=complex)
34327 : * for j in range(l2): # <<<<<<<<<<<<<<
34328 : * i = ind2[j]
34329 : * if (i+1) <= (n//2 - m//2):
34330 : */
34331 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 813, __pyx_L1_error) }
34332 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_l2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
34333 : __Pyx_GOTREF(__pyx_t_6);
34334 : if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
34335 : __pyx_t_21 = __pyx_t_6; __Pyx_INCREF(__pyx_t_21);
34336 : __pyx_t_16 = 0;
34337 : __pyx_t_17 = NULL;
34338 : } else {
34339 : __pyx_t_16 = -1; __pyx_t_21 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 813, __pyx_L1_error)
34340 : __Pyx_GOTREF(__pyx_t_21);
34341 : __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 813, __pyx_L1_error)
34342 : }
34343 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34344 : for (;;) {
34345 : if (likely(!__pyx_t_17)) {
34346 : if (likely(PyList_CheckExact(__pyx_t_21))) {
34347 : {
34348 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_21);
34349 : #if !CYTHON_ASSUME_SAFE_MACROS
34350 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 813, __pyx_L1_error)
34351 : #endif
34352 : if (__pyx_t_16 >= __pyx_temp) break;
34353 : }
34354 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34355 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_21, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 813, __pyx_L1_error)
34356 : #else
34357 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_21, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
34358 : __Pyx_GOTREF(__pyx_t_6);
34359 : #endif
34360 : } else {
34361 : {
34362 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_21);
34363 : #if !CYTHON_ASSUME_SAFE_MACROS
34364 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 813, __pyx_L1_error)
34365 : #endif
34366 : if (__pyx_t_16 >= __pyx_temp) break;
34367 : }
34368 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34369 : __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_21, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 813, __pyx_L1_error)
34370 : #else
34371 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_21, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
34372 : __Pyx_GOTREF(__pyx_t_6);
34373 : #endif
34374 : }
34375 : } else {
34376 : __pyx_t_6 = __pyx_t_17(__pyx_t_21);
34377 : if (unlikely(!__pyx_t_6)) {
34378 : PyObject* exc_type = PyErr_Occurred();
34379 : if (exc_type) {
34380 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
34381 : else __PYX_ERR(0, 813, __pyx_L1_error)
34382 : }
34383 : break;
34384 : }
34385 : __Pyx_GOTREF(__pyx_t_6);
34386 : }
34387 : __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_6);
34388 : __pyx_t_6 = 0;
34389 :
34390 : /* "scipy/linalg/_decomp_interpolative.pyx":814
34391 : * wsave = np.empty(m*l2, dtype=complex)
34392 : * for j in range(l2):
34393 : * i = ind2[j] # <<<<<<<<<<<<<<
34394 : * if (i+1) <= (n//2 - m//2):
34395 : * idivm = i // m
34396 : */
34397 : __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_ind2, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 814, __pyx_L1_error)
34398 : __Pyx_GOTREF(__pyx_t_6);
34399 : __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
34400 : __pyx_t_6 = 0;
34401 :
34402 : /* "scipy/linalg/_decomp_interpolative.pyx":815
34403 : * for j in range(l2):
34404 : * i = ind2[j]
34405 : * if (i+1) <= (n//2 - m//2): # <<<<<<<<<<<<<<
34406 : * idivm = i // m
34407 : * imodm = i - m*idivm
34408 : */
34409 : __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error)
34410 : __Pyx_GOTREF(__pyx_t_6);
34411 : __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_n / 2) - (__pyx_v_m / 2))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 815, __pyx_L1_error)
34412 : __Pyx_GOTREF(__pyx_t_5);
34413 : __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error)
34414 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34415 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34416 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 815, __pyx_L1_error)
34417 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34418 : if (__pyx_t_1) {
34419 :
34420 : /* "scipy/linalg/_decomp_interpolative.pyx":816
34421 : * i = ind2[j]
34422 : * if (i+1) <= (n//2 - m//2):
34423 : * idivm = i // m # <<<<<<<<<<<<<<
34424 : * imodm = i - m*idivm
34425 : * for k in range(m):
34426 : */
34427 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
34428 : __Pyx_GOTREF(__pyx_t_3);
34429 : __pyx_t_5 = PyNumber_FloorDivide(__pyx_v_i, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error)
34430 : __Pyx_GOTREF(__pyx_t_5);
34431 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34432 : __Pyx_XDECREF_SET(__pyx_v_idivm, __pyx_t_5);
34433 : __pyx_t_5 = 0;
34434 :
34435 : /* "scipy/linalg/_decomp_interpolative.pyx":817
34436 : * if (i+1) <= (n//2 - m//2):
34437 : * idivm = i // m
34438 : * imodm = i - m*idivm # <<<<<<<<<<<<<<
34439 : * for k in range(m):
34440 : * wsave[m*j+k] = (
34441 : */
34442 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
34443 : __Pyx_GOTREF(__pyx_t_5);
34444 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_idivm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
34445 : __Pyx_GOTREF(__pyx_t_3);
34446 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34447 : __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
34448 : __Pyx_GOTREF(__pyx_t_5);
34449 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34450 : __Pyx_XDECREF_SET(__pyx_v_imodm, __pyx_t_5);
34451 : __pyx_t_5 = 0;
34452 :
34453 : /* "scipy/linalg/_decomp_interpolative.pyx":818
34454 : * idivm = i // m
34455 : * imodm = i - m*idivm
34456 : * for k in range(m): # <<<<<<<<<<<<<<
34457 : * wsave[m*j+k] = (
34458 : * np.exp(-twopii*(k)*imodm/m)*
34459 : */
34460 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error)
34461 : __Pyx_GOTREF(__pyx_t_5);
34462 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
34463 : __Pyx_GOTREF(__pyx_t_3);
34464 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34465 : if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
34466 : __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5);
34467 : __pyx_t_37 = 0;
34468 : __pyx_t_38 = NULL;
34469 : } else {
34470 : __pyx_t_37 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 818, __pyx_L1_error)
34471 : __Pyx_GOTREF(__pyx_t_5);
34472 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 818, __pyx_L1_error)
34473 : }
34474 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34475 : for (;;) {
34476 : if (likely(!__pyx_t_38)) {
34477 : if (likely(PyList_CheckExact(__pyx_t_5))) {
34478 : {
34479 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
34480 : #if !CYTHON_ASSUME_SAFE_MACROS
34481 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error)
34482 : #endif
34483 : if (__pyx_t_37 >= __pyx_temp) break;
34484 : }
34485 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34486 : __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_37); __Pyx_INCREF(__pyx_t_3); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 818, __pyx_L1_error)
34487 : #else
34488 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
34489 : __Pyx_GOTREF(__pyx_t_3);
34490 : #endif
34491 : } else {
34492 : {
34493 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
34494 : #if !CYTHON_ASSUME_SAFE_MACROS
34495 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error)
34496 : #endif
34497 : if (__pyx_t_37 >= __pyx_temp) break;
34498 : }
34499 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34500 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_37); __Pyx_INCREF(__pyx_t_3); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 818, __pyx_L1_error)
34501 : #else
34502 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
34503 : __Pyx_GOTREF(__pyx_t_3);
34504 : #endif
34505 : }
34506 : } else {
34507 : __pyx_t_3 = __pyx_t_38(__pyx_t_5);
34508 : if (unlikely(!__pyx_t_3)) {
34509 : PyObject* exc_type = PyErr_Occurred();
34510 : if (exc_type) {
34511 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
34512 : else __PYX_ERR(0, 818, __pyx_L1_error)
34513 : }
34514 : break;
34515 : }
34516 : __Pyx_GOTREF(__pyx_t_3);
34517 : }
34518 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
34519 : __pyx_t_3 = 0;
34520 :
34521 : /* "scipy/linalg/_decomp_interpolative.pyx":820
34522 : * for k in range(m):
34523 : * wsave[m*j+k] = (
34524 : * np.exp(-twopii*(k)*imodm/m)* # <<<<<<<<<<<<<<
34525 : * np.exp(-twopii*(k)*(idivm+1)/n)*
34526 : * fact
34527 : */
34528 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
34529 : __Pyx_GOTREF(__pyx_t_6);
34530 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error)
34531 : __Pyx_GOTREF(__pyx_t_4);
34532 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34533 : __pyx_t_6 = PyNumber_Negative(__pyx_v_twopii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
34534 : __Pyx_GOTREF(__pyx_t_6);
34535 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_6, __pyx_v_k); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 820, __pyx_L1_error)
34536 : __Pyx_GOTREF(__pyx_t_34);
34537 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34538 : __pyx_t_6 = PyNumber_Multiply(__pyx_t_34, __pyx_v_imodm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
34539 : __Pyx_GOTREF(__pyx_t_6);
34540 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34541 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 820, __pyx_L1_error)
34542 : __Pyx_GOTREF(__pyx_t_34);
34543 : __pyx_t_36 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_34); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 820, __pyx_L1_error)
34544 : __Pyx_GOTREF(__pyx_t_36);
34545 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34546 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34547 : __pyx_t_34 = NULL;
34548 : __pyx_t_7 = 0;
34549 : #if CYTHON_UNPACK_METHODS
34550 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
34551 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4);
34552 : if (likely(__pyx_t_34)) {
34553 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
34554 : __Pyx_INCREF(__pyx_t_34);
34555 : __Pyx_INCREF(function);
34556 : __Pyx_DECREF_SET(__pyx_t_4, function);
34557 : __pyx_t_7 = 1;
34558 : }
34559 : }
34560 : #endif
34561 : {
34562 : PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_36};
34563 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
34564 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
34565 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34566 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
34567 : __Pyx_GOTREF(__pyx_t_3);
34568 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34569 : }
34570 :
34571 : /* "scipy/linalg/_decomp_interpolative.pyx":821
34572 : * wsave[m*j+k] = (
34573 : * np.exp(-twopii*(k)*imodm/m)*
34574 : * np.exp(-twopii*(k)*(idivm+1)/n)* # <<<<<<<<<<<<<<
34575 : * fact
34576 : * )
34577 : */
34578 : __Pyx_GetModuleGlobalName(__pyx_t_36, __pyx_n_s_np); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 821, __pyx_L1_error)
34579 : __Pyx_GOTREF(__pyx_t_36);
34580 : __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_36, __pyx_n_s_exp); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 821, __pyx_L1_error)
34581 : __Pyx_GOTREF(__pyx_t_34);
34582 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34583 : __pyx_t_36 = PyNumber_Negative(__pyx_v_twopii); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 821, __pyx_L1_error)
34584 : __Pyx_GOTREF(__pyx_t_36);
34585 : __pyx_t_6 = PyNumber_Multiply(__pyx_t_36, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
34586 : __Pyx_GOTREF(__pyx_t_6);
34587 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34588 : __pyx_t_36 = __Pyx_PyInt_AddObjC(__pyx_v_idivm, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 821, __pyx_L1_error)
34589 : __Pyx_GOTREF(__pyx_t_36);
34590 : __pyx_t_39 = PyNumber_Multiply(__pyx_t_6, __pyx_t_36); if (unlikely(!__pyx_t_39)) __PYX_ERR(0, 821, __pyx_L1_error)
34591 : __Pyx_GOTREF(__pyx_t_39);
34592 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34593 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34594 : __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 821, __pyx_L1_error)
34595 : __Pyx_GOTREF(__pyx_t_36);
34596 : __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_39, __pyx_t_36); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
34597 : __Pyx_GOTREF(__pyx_t_6);
34598 : __Pyx_DECREF(__pyx_t_39); __pyx_t_39 = 0;
34599 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34600 : __pyx_t_36 = NULL;
34601 : __pyx_t_7 = 0;
34602 : #if CYTHON_UNPACK_METHODS
34603 : if (unlikely(PyMethod_Check(__pyx_t_34))) {
34604 : __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_34);
34605 : if (likely(__pyx_t_36)) {
34606 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_34);
34607 : __Pyx_INCREF(__pyx_t_36);
34608 : __Pyx_INCREF(function);
34609 : __Pyx_DECREF_SET(__pyx_t_34, function);
34610 : __pyx_t_7 = 1;
34611 : }
34612 : }
34613 : #endif
34614 : {
34615 : PyObject *__pyx_callargs[2] = {__pyx_t_36, __pyx_t_6};
34616 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_34, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
34617 : __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
34618 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34619 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error)
34620 : __Pyx_GOTREF(__pyx_t_4);
34621 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34622 : }
34623 :
34624 : /* "scipy/linalg/_decomp_interpolative.pyx":820
34625 : * for k in range(m):
34626 : * wsave[m*j+k] = (
34627 : * np.exp(-twopii*(k)*imodm/m)* # <<<<<<<<<<<<<<
34628 : * np.exp(-twopii*(k)*(idivm+1)/n)*
34629 : * fact
34630 : */
34631 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 820, __pyx_L1_error)
34632 : __Pyx_GOTREF(__pyx_t_34);
34633 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34634 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34635 :
34636 : /* "scipy/linalg/_decomp_interpolative.pyx":821
34637 : * wsave[m*j+k] = (
34638 : * np.exp(-twopii*(k)*imodm/m)*
34639 : * np.exp(-twopii*(k)*(idivm+1)/n)* # <<<<<<<<<<<<<<
34640 : * fact
34641 : * )
34642 : */
34643 : __pyx_t_4 = PyNumber_Multiply(__pyx_t_34, __pyx_v_fact); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error)
34644 : __Pyx_GOTREF(__pyx_t_4);
34645 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34646 :
34647 : /* "scipy/linalg/_decomp_interpolative.pyx":819
34648 : * imodm = i - m*idivm
34649 : * for k in range(m):
34650 : * wsave[m*j+k] = ( # <<<<<<<<<<<<<<
34651 : * np.exp(-twopii*(k)*imodm/m)*
34652 : * np.exp(-twopii*(k)*(idivm+1)/n)*
34653 : */
34654 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 819, __pyx_L1_error)
34655 : __Pyx_GOTREF(__pyx_t_34);
34656 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_34, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
34657 : __Pyx_GOTREF(__pyx_t_3);
34658 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34659 : __pyx_t_34 = PyNumber_Add(__pyx_t_3, __pyx_v_k); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 819, __pyx_L1_error)
34660 : __Pyx_GOTREF(__pyx_t_34);
34661 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34662 : if (unlikely((PyObject_SetItem(__pyx_v_wsave, __pyx_t_34, __pyx_t_4) < 0))) __PYX_ERR(0, 819, __pyx_L1_error)
34663 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34664 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34665 :
34666 : /* "scipy/linalg/_decomp_interpolative.pyx":818
34667 : * idivm = i // m
34668 : * imodm = i - m*idivm
34669 : * for k in range(m): # <<<<<<<<<<<<<<
34670 : * wsave[m*j+k] = (
34671 : * np.exp(-twopii*(k)*imodm/m)*
34672 : */
34673 : }
34674 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34675 :
34676 : /* "scipy/linalg/_decomp_interpolative.pyx":815
34677 : * for j in range(l2):
34678 : * i = ind2[j]
34679 : * if (i+1) <= (n//2 - m//2): # <<<<<<<<<<<<<<
34680 : * idivm = i // m
34681 : * imodm = i - m*idivm
34682 : */
34683 : goto __pyx_L23;
34684 : }
34685 :
34686 : /* "scipy/linalg/_decomp_interpolative.pyx":825
34687 : * )
34688 : * else:
34689 : * idivm = (i+1)//(m//2) # <<<<<<<<<<<<<<
34690 : * imodm = (i+1)-(m//2)*idivm
34691 : * for k in range(m):
34692 : */
34693 : /*else*/ {
34694 : __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
34695 : __Pyx_GOTREF(__pyx_t_5);
34696 : __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_m / 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
34697 : __Pyx_GOTREF(__pyx_t_4);
34698 : __pyx_t_34 = PyNumber_FloorDivide(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 825, __pyx_L1_error)
34699 : __Pyx_GOTREF(__pyx_t_34);
34700 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34701 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34702 : __Pyx_XDECREF_SET(__pyx_v_idivm, __pyx_t_34);
34703 : __pyx_t_34 = 0;
34704 :
34705 : /* "scipy/linalg/_decomp_interpolative.pyx":826
34706 : * else:
34707 : * idivm = (i+1)//(m//2)
34708 : * imodm = (i+1)-(m//2)*idivm # <<<<<<<<<<<<<<
34709 : * for k in range(m):
34710 : * wsave[m*j+k] = np.exp(-twopii*(k-1)*imodm/m)*fact
34711 : */
34712 : __pyx_t_34 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 826, __pyx_L1_error)
34713 : __Pyx_GOTREF(__pyx_t_34);
34714 : __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_m / 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
34715 : __Pyx_GOTREF(__pyx_t_4);
34716 : __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_idivm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
34717 : __Pyx_GOTREF(__pyx_t_5);
34718 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34719 : __pyx_t_4 = PyNumber_Subtract(__pyx_t_34, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
34720 : __Pyx_GOTREF(__pyx_t_4);
34721 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34722 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34723 : __Pyx_XDECREF_SET(__pyx_v_imodm, __pyx_t_4);
34724 : __pyx_t_4 = 0;
34725 :
34726 : /* "scipy/linalg/_decomp_interpolative.pyx":827
34727 : * idivm = (i+1)//(m//2)
34728 : * imodm = (i+1)-(m//2)*idivm
34729 : * for k in range(m): # <<<<<<<<<<<<<<
34730 : * wsave[m*j+k] = np.exp(-twopii*(k-1)*imodm/m)*fact
34731 : *
34732 : */
34733 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
34734 : __Pyx_GOTREF(__pyx_t_4);
34735 : __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
34736 : __Pyx_GOTREF(__pyx_t_5);
34737 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34738 : if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
34739 : __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4);
34740 : __pyx_t_37 = 0;
34741 : __pyx_t_38 = NULL;
34742 : } else {
34743 : __pyx_t_37 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error)
34744 : __Pyx_GOTREF(__pyx_t_4);
34745 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 827, __pyx_L1_error)
34746 : }
34747 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34748 : for (;;) {
34749 : if (likely(!__pyx_t_38)) {
34750 : if (likely(PyList_CheckExact(__pyx_t_4))) {
34751 : {
34752 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
34753 : #if !CYTHON_ASSUME_SAFE_MACROS
34754 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 827, __pyx_L1_error)
34755 : #endif
34756 : if (__pyx_t_37 >= __pyx_temp) break;
34757 : }
34758 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34759 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 827, __pyx_L1_error)
34760 : #else
34761 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
34762 : __Pyx_GOTREF(__pyx_t_5);
34763 : #endif
34764 : } else {
34765 : {
34766 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
34767 : #if !CYTHON_ASSUME_SAFE_MACROS
34768 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 827, __pyx_L1_error)
34769 : #endif
34770 : if (__pyx_t_37 >= __pyx_temp) break;
34771 : }
34772 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34773 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 827, __pyx_L1_error)
34774 : #else
34775 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
34776 : __Pyx_GOTREF(__pyx_t_5);
34777 : #endif
34778 : }
34779 : } else {
34780 : __pyx_t_5 = __pyx_t_38(__pyx_t_4);
34781 : if (unlikely(!__pyx_t_5)) {
34782 : PyObject* exc_type = PyErr_Occurred();
34783 : if (exc_type) {
34784 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
34785 : else __PYX_ERR(0, 827, __pyx_L1_error)
34786 : }
34787 : break;
34788 : }
34789 : __Pyx_GOTREF(__pyx_t_5);
34790 : }
34791 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
34792 : __pyx_t_5 = 0;
34793 :
34794 : /* "scipy/linalg/_decomp_interpolative.pyx":828
34795 : * imodm = (i+1)-(m//2)*idivm
34796 : * for k in range(m):
34797 : * wsave[m*j+k] = np.exp(-twopii*(k-1)*imodm/m)*fact # <<<<<<<<<<<<<<
34798 : *
34799 : * # idd_sfft.f
34800 : */
34801 : __Pyx_GetModuleGlobalName(__pyx_t_34, __pyx_n_s_np); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 828, __pyx_L1_error)
34802 : __Pyx_GOTREF(__pyx_t_34);
34803 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_34, __pyx_n_s_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
34804 : __Pyx_GOTREF(__pyx_t_3);
34805 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34806 : __pyx_t_34 = PyNumber_Negative(__pyx_v_twopii); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 828, __pyx_L1_error)
34807 : __Pyx_GOTREF(__pyx_t_34);
34808 : __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_k, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error)
34809 : __Pyx_GOTREF(__pyx_t_6);
34810 : __pyx_t_36 = PyNumber_Multiply(__pyx_t_34, __pyx_t_6); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 828, __pyx_L1_error)
34811 : __Pyx_GOTREF(__pyx_t_36);
34812 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34813 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34814 : __pyx_t_6 = PyNumber_Multiply(__pyx_t_36, __pyx_v_imodm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error)
34815 : __Pyx_GOTREF(__pyx_t_6);
34816 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34817 : __pyx_t_36 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_36)) __PYX_ERR(0, 828, __pyx_L1_error)
34818 : __Pyx_GOTREF(__pyx_t_36);
34819 : __pyx_t_34 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_36); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 828, __pyx_L1_error)
34820 : __Pyx_GOTREF(__pyx_t_34);
34821 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34822 : __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
34823 : __pyx_t_36 = NULL;
34824 : __pyx_t_7 = 0;
34825 : #if CYTHON_UNPACK_METHODS
34826 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
34827 : __pyx_t_36 = PyMethod_GET_SELF(__pyx_t_3);
34828 : if (likely(__pyx_t_36)) {
34829 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
34830 : __Pyx_INCREF(__pyx_t_36);
34831 : __Pyx_INCREF(function);
34832 : __Pyx_DECREF_SET(__pyx_t_3, function);
34833 : __pyx_t_7 = 1;
34834 : }
34835 : }
34836 : #endif
34837 : {
34838 : PyObject *__pyx_callargs[2] = {__pyx_t_36, __pyx_t_34};
34839 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
34840 : __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
34841 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34842 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
34843 : __Pyx_GOTREF(__pyx_t_5);
34844 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34845 : }
34846 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_fact); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
34847 : __Pyx_GOTREF(__pyx_t_3);
34848 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34849 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
34850 : __Pyx_GOTREF(__pyx_t_5);
34851 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 828, __pyx_L1_error)
34852 : __Pyx_GOTREF(__pyx_t_34);
34853 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34854 : __pyx_t_5 = PyNumber_Add(__pyx_t_34, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
34855 : __Pyx_GOTREF(__pyx_t_5);
34856 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
34857 : if (unlikely((PyObject_SetItem(__pyx_v_wsave, __pyx_t_5, __pyx_t_3) < 0))) __PYX_ERR(0, 828, __pyx_L1_error)
34858 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34859 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34860 :
34861 : /* "scipy/linalg/_decomp_interpolative.pyx":827
34862 : * idivm = (i+1)//(m//2)
34863 : * imodm = (i+1)-(m//2)*idivm
34864 : * for k in range(m): # <<<<<<<<<<<<<<
34865 : * wsave[m*j+k] = np.exp(-twopii*(k-1)*imodm/m)*fact
34866 : *
34867 : */
34868 : }
34869 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34870 : }
34871 : __pyx_L23:;
34872 :
34873 : /* "scipy/linalg/_decomp_interpolative.pyx":813
34874 : *
34875 : * wsave = np.empty(m*l2, dtype=complex)
34876 : * for j in range(l2): # <<<<<<<<<<<<<<
34877 : * i = ind2[j]
34878 : * if (i+1) <= (n//2 - m//2):
34879 : */
34880 : }
34881 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
34882 : }
34883 : __pyx_L20:;
34884 :
34885 : /* "scipy/linalg/_decomp_interpolative.pyx":837
34886 : *
34887 : * # Perform partial FFT to each nblock
34888 : * F = rfft(rta.reshape(nblock, m, -1), order='F', axis=0) # <<<<<<<<<<<<<<
34889 : * # Roll the first entry to the last in the first axis for
34890 : * # the real frequency components. (faster than np.roll)
34891 : */
34892 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_rfft); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 837, __pyx_L1_error)
34893 : __Pyx_GOTREF(__pyx_t_21);
34894 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rta), __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
34895 : __Pyx_GOTREF(__pyx_t_3);
34896 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
34897 : __Pyx_GOTREF(__pyx_t_5);
34898 : __pyx_t_34 = NULL;
34899 : __pyx_t_7 = 0;
34900 : #if CYTHON_UNPACK_METHODS
34901 : if (likely(PyMethod_Check(__pyx_t_3))) {
34902 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_3);
34903 : if (likely(__pyx_t_34)) {
34904 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
34905 : __Pyx_INCREF(__pyx_t_34);
34906 : __Pyx_INCREF(function);
34907 : __Pyx_DECREF_SET(__pyx_t_3, function);
34908 : __pyx_t_7 = 1;
34909 : }
34910 : }
34911 : #endif
34912 : {
34913 : PyObject *__pyx_callargs[4] = {__pyx_t_34, __pyx_v_nblock, __pyx_t_5, __pyx_int_neg_1};
34914 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
34915 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
34916 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34917 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
34918 : __Pyx_GOTREF(__pyx_t_4);
34919 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34920 : }
34921 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
34922 : __Pyx_GOTREF(__pyx_t_3);
34923 : __Pyx_GIVEREF(__pyx_t_4);
34924 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error);
34925 : __pyx_t_4 = 0;
34926 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
34927 : __Pyx_GOTREF(__pyx_t_4);
34928 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
34929 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
34930 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
34931 : __Pyx_GOTREF(__pyx_t_5);
34932 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
34933 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34934 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34935 : __pyx_v_F = __pyx_t_5;
34936 : __pyx_t_5 = 0;
34937 :
34938 : /* "scipy/linalg/_decomp_interpolative.pyx":840
34939 : * # Roll the first entry to the last in the first axis for
34940 : * # the real frequency components. (faster than np.roll)
34941 : * F = F[[x for x in range(1, F.shape[0])] + [0], :, :] # <<<<<<<<<<<<<<
34942 : * # Convert back to 2D array
34943 : * F = F.reshape(F.shape[0]*F.shape[1], -1)
34944 : */
34945 : { /* enter inner scope */
34946 : __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L33_error)
34947 : __Pyx_GOTREF(__pyx_t_5);
34948 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_F, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L33_error)
34949 : __Pyx_GOTREF(__pyx_t_4);
34950 : __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L33_error)
34951 : __Pyx_GOTREF(__pyx_t_3);
34952 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34953 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L33_error)
34954 : __Pyx_GOTREF(__pyx_t_4);
34955 : __Pyx_INCREF(__pyx_int_1);
34956 : __Pyx_GIVEREF(__pyx_int_1);
34957 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_1)) __PYX_ERR(0, 840, __pyx_L33_error);
34958 : __Pyx_GIVEREF(__pyx_t_3);
34959 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 840, __pyx_L33_error);
34960 : __pyx_t_3 = 0;
34961 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L33_error)
34962 : __Pyx_GOTREF(__pyx_t_3);
34963 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34964 : if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
34965 : __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
34966 : __pyx_t_16 = 0;
34967 : __pyx_t_17 = NULL;
34968 : } else {
34969 : __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L33_error)
34970 : __Pyx_GOTREF(__pyx_t_4);
34971 : __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 840, __pyx_L33_error)
34972 : }
34973 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34974 : for (;;) {
34975 : if (likely(!__pyx_t_17)) {
34976 : if (likely(PyList_CheckExact(__pyx_t_4))) {
34977 : {
34978 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
34979 : #if !CYTHON_ASSUME_SAFE_MACROS
34980 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 840, __pyx_L33_error)
34981 : #endif
34982 : if (__pyx_t_16 >= __pyx_temp) break;
34983 : }
34984 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34985 : __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 840, __pyx_L33_error)
34986 : #else
34987 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L33_error)
34988 : __Pyx_GOTREF(__pyx_t_3);
34989 : #endif
34990 : } else {
34991 : {
34992 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
34993 : #if !CYTHON_ASSUME_SAFE_MACROS
34994 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 840, __pyx_L33_error)
34995 : #endif
34996 : if (__pyx_t_16 >= __pyx_temp) break;
34997 : }
34998 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34999 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 840, __pyx_L33_error)
35000 : #else
35001 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L33_error)
35002 : __Pyx_GOTREF(__pyx_t_3);
35003 : #endif
35004 : }
35005 : } else {
35006 : __pyx_t_3 = __pyx_t_17(__pyx_t_4);
35007 : if (unlikely(!__pyx_t_3)) {
35008 : PyObject* exc_type = PyErr_Occurred();
35009 : if (exc_type) {
35010 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35011 : else __PYX_ERR(0, 840, __pyx_L33_error)
35012 : }
35013 : break;
35014 : }
35015 : __Pyx_GOTREF(__pyx_t_3);
35016 : }
35017 : __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_3);
35018 : __pyx_t_3 = 0;
35019 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 840, __pyx_L33_error)
35020 : }
35021 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35022 : __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
35023 : goto __pyx_L37_exit_scope;
35024 : __pyx_L33_error:;
35025 : __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
35026 : goto __pyx_L1_error;
35027 : __pyx_L37_exit_scope:;
35028 : } /* exit inner scope */
35029 : __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
35030 : __Pyx_GOTREF(__pyx_t_4);
35031 : __Pyx_INCREF(__pyx_int_0);
35032 : __Pyx_GIVEREF(__pyx_int_0);
35033 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 840, __pyx_L1_error);
35034 : __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
35035 : __Pyx_GOTREF(__pyx_t_3);
35036 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35037 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35038 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
35039 : __Pyx_GOTREF(__pyx_t_4);
35040 : __Pyx_GIVEREF(__pyx_t_3);
35041 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error);
35042 : __Pyx_INCREF(__pyx_slice__5);
35043 : __Pyx_GIVEREF(__pyx_slice__5);
35044 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 840, __pyx_L1_error);
35045 : __Pyx_INCREF(__pyx_slice__5);
35046 : __Pyx_GIVEREF(__pyx_slice__5);
35047 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_slice__5)) __PYX_ERR(0, 840, __pyx_L1_error);
35048 : __pyx_t_3 = 0;
35049 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error)
35050 : __Pyx_GOTREF(__pyx_t_3);
35051 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35052 : __Pyx_DECREF_SET(__pyx_v_F, __pyx_t_3);
35053 : __pyx_t_3 = 0;
35054 :
35055 : /* "scipy/linalg/_decomp_interpolative.pyx":842
35056 : * F = F[[x for x in range(1, F.shape[0])] + [0], :, :]
35057 : * # Convert back to 2D array
35058 : * F = F.reshape(F.shape[0]*F.shape[1], -1) # <<<<<<<<<<<<<<
35059 : *
35060 : * csum = np.zeros_like(F[0, :])
35061 : */
35062 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_F, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
35063 : __Pyx_GOTREF(__pyx_t_4);
35064 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_F, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
35065 : __Pyx_GOTREF(__pyx_t_5);
35066 : __pyx_t_21 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 842, __pyx_L1_error)
35067 : __Pyx_GOTREF(__pyx_t_21);
35068 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35069 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_F, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
35070 : __Pyx_GOTREF(__pyx_t_5);
35071 : __pyx_t_34 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 842, __pyx_L1_error)
35072 : __Pyx_GOTREF(__pyx_t_34);
35073 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35074 : __pyx_t_5 = PyNumber_Multiply(__pyx_t_21, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
35075 : __Pyx_GOTREF(__pyx_t_5);
35076 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35077 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35078 : __pyx_t_34 = NULL;
35079 : __pyx_t_7 = 0;
35080 : #if CYTHON_UNPACK_METHODS
35081 : if (likely(PyMethod_Check(__pyx_t_4))) {
35082 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4);
35083 : if (likely(__pyx_t_34)) {
35084 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35085 : __Pyx_INCREF(__pyx_t_34);
35086 : __Pyx_INCREF(function);
35087 : __Pyx_DECREF_SET(__pyx_t_4, function);
35088 : __pyx_t_7 = 1;
35089 : }
35090 : }
35091 : #endif
35092 : {
35093 : PyObject *__pyx_callargs[3] = {__pyx_t_34, __pyx_t_5, __pyx_int_neg_1};
35094 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
35095 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
35096 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35097 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error)
35098 : __Pyx_GOTREF(__pyx_t_3);
35099 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35100 : }
35101 : __Pyx_DECREF_SET(__pyx_v_F, __pyx_t_3);
35102 : __pyx_t_3 = 0;
35103 :
35104 : /* "scipy/linalg/_decomp_interpolative.pyx":844
35105 : * F = F.reshape(F.shape[0]*F.shape[1], -1)
35106 : *
35107 : * csum = np.zeros_like(F[0, :]) # <<<<<<<<<<<<<<
35108 : * rsum = np.zeros_like(F[0, :])
35109 : *
35110 : */
35111 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
35112 : __Pyx_GOTREF(__pyx_t_4);
35113 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L1_error)
35114 : __Pyx_GOTREF(__pyx_t_5);
35115 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35116 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_tuple__15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
35117 : __Pyx_GOTREF(__pyx_t_4);
35118 : __pyx_t_34 = NULL;
35119 : __pyx_t_7 = 0;
35120 : #if CYTHON_UNPACK_METHODS
35121 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
35122 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_5);
35123 : if (likely(__pyx_t_34)) {
35124 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
35125 : __Pyx_INCREF(__pyx_t_34);
35126 : __Pyx_INCREF(function);
35127 : __Pyx_DECREF_SET(__pyx_t_5, function);
35128 : __pyx_t_7 = 1;
35129 : }
35130 : }
35131 : #endif
35132 : {
35133 : PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_4};
35134 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
35135 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
35136 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35137 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error)
35138 : __Pyx_GOTREF(__pyx_t_3);
35139 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35140 : }
35141 : __pyx_v_csum = __pyx_t_3;
35142 : __pyx_t_3 = 0;
35143 :
35144 : /* "scipy/linalg/_decomp_interpolative.pyx":845
35145 : *
35146 : * csum = np.zeros_like(F[0, :])
35147 : * rsum = np.zeros_like(F[0, :]) # <<<<<<<<<<<<<<
35148 : *
35149 : * for j in range(l2):
35150 : */
35151 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
35152 : __Pyx_GOTREF(__pyx_t_5);
35153 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error)
35154 : __Pyx_GOTREF(__pyx_t_4);
35155 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35156 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_tuple__15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
35157 : __Pyx_GOTREF(__pyx_t_5);
35158 : __pyx_t_34 = NULL;
35159 : __pyx_t_7 = 0;
35160 : #if CYTHON_UNPACK_METHODS
35161 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
35162 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_4);
35163 : if (likely(__pyx_t_34)) {
35164 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35165 : __Pyx_INCREF(__pyx_t_34);
35166 : __Pyx_INCREF(function);
35167 : __Pyx_DECREF_SET(__pyx_t_4, function);
35168 : __pyx_t_7 = 1;
35169 : }
35170 : }
35171 : #endif
35172 : {
35173 : PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_5};
35174 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
35175 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
35176 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35177 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
35178 : __Pyx_GOTREF(__pyx_t_3);
35179 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35180 : }
35181 : __pyx_v_rsum = __pyx_t_3;
35182 : __pyx_t_3 = 0;
35183 :
35184 : /* "scipy/linalg/_decomp_interpolative.pyx":847
35185 : * rsum = np.zeros_like(F[0, :])
35186 : *
35187 : * for j in range(l2): # <<<<<<<<<<<<<<
35188 : * i = ind2[j]
35189 : * if (i+1) <= (n//2 - m//2):
35190 : */
35191 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 847, __pyx_L1_error) }
35192 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_l2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
35193 : __Pyx_GOTREF(__pyx_t_3);
35194 : if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
35195 : __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
35196 : __pyx_t_16 = 0;
35197 : __pyx_t_17 = NULL;
35198 : } else {
35199 : __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
35200 : __Pyx_GOTREF(__pyx_t_4);
35201 : __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 847, __pyx_L1_error)
35202 : }
35203 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35204 : for (;;) {
35205 : if (likely(!__pyx_t_17)) {
35206 : if (likely(PyList_CheckExact(__pyx_t_4))) {
35207 : {
35208 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
35209 : #if !CYTHON_ASSUME_SAFE_MACROS
35210 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L1_error)
35211 : #endif
35212 : if (__pyx_t_16 >= __pyx_temp) break;
35213 : }
35214 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35215 : __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 847, __pyx_L1_error)
35216 : #else
35217 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
35218 : __Pyx_GOTREF(__pyx_t_3);
35219 : #endif
35220 : } else {
35221 : {
35222 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
35223 : #if !CYTHON_ASSUME_SAFE_MACROS
35224 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 847, __pyx_L1_error)
35225 : #endif
35226 : if (__pyx_t_16 >= __pyx_temp) break;
35227 : }
35228 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35229 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 847, __pyx_L1_error)
35230 : #else
35231 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
35232 : __Pyx_GOTREF(__pyx_t_3);
35233 : #endif
35234 : }
35235 : } else {
35236 : __pyx_t_3 = __pyx_t_17(__pyx_t_4);
35237 : if (unlikely(!__pyx_t_3)) {
35238 : PyObject* exc_type = PyErr_Occurred();
35239 : if (exc_type) {
35240 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35241 : else __PYX_ERR(0, 847, __pyx_L1_error)
35242 : }
35243 : break;
35244 : }
35245 : __Pyx_GOTREF(__pyx_t_3);
35246 : }
35247 : __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
35248 : __pyx_t_3 = 0;
35249 :
35250 : /* "scipy/linalg/_decomp_interpolative.pyx":848
35251 : *
35252 : * for j in range(l2):
35253 : * i = ind2[j] # <<<<<<<<<<<<<<
35254 : * if (i+1) <= (n//2 - m//2):
35255 : * idivm = i // m
35256 : */
35257 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ind2, __pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
35258 : __Pyx_GOTREF(__pyx_t_3);
35259 : __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
35260 : __pyx_t_3 = 0;
35261 :
35262 : /* "scipy/linalg/_decomp_interpolative.pyx":849
35263 : * for j in range(l2):
35264 : * i = ind2[j]
35265 : * if (i+1) <= (n//2 - m//2): # <<<<<<<<<<<<<<
35266 : * idivm = i // m
35267 : * imodm = i - m*idivm
35268 : */
35269 : __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
35270 : __Pyx_GOTREF(__pyx_t_3);
35271 : __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_n / 2) - (__pyx_v_m / 2))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 849, __pyx_L1_error)
35272 : __Pyx_GOTREF(__pyx_t_5);
35273 : __pyx_t_34 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_34); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 849, __pyx_L1_error)
35274 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35275 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35276 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_34); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 849, __pyx_L1_error)
35277 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35278 : if (__pyx_t_1) {
35279 :
35280 : /* "scipy/linalg/_decomp_interpolative.pyx":850
35281 : * i = ind2[j]
35282 : * if (i+1) <= (n//2 - m//2):
35283 : * idivm = i // m # <<<<<<<<<<<<<<
35284 : * imodm = i - m*idivm
35285 : * csum[:] = 0.0
35286 : */
35287 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 850, __pyx_L1_error)
35288 : __Pyx_GOTREF(__pyx_t_34);
35289 : __pyx_t_5 = PyNumber_FloorDivide(__pyx_v_i, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
35290 : __Pyx_GOTREF(__pyx_t_5);
35291 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35292 : __Pyx_XDECREF_SET(__pyx_v_idivm, __pyx_t_5);
35293 : __pyx_t_5 = 0;
35294 :
35295 : /* "scipy/linalg/_decomp_interpolative.pyx":851
35296 : * if (i+1) <= (n//2 - m//2):
35297 : * idivm = i // m
35298 : * imodm = i - m*idivm # <<<<<<<<<<<<<<
35299 : * csum[:] = 0.0
35300 : * for k in range(m):
35301 : */
35302 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error)
35303 : __Pyx_GOTREF(__pyx_t_5);
35304 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_5, __pyx_v_idivm); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 851, __pyx_L1_error)
35305 : __Pyx_GOTREF(__pyx_t_34);
35306 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35307 : __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error)
35308 : __Pyx_GOTREF(__pyx_t_5);
35309 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35310 : __Pyx_XDECREF_SET(__pyx_v_imodm, __pyx_t_5);
35311 : __pyx_t_5 = 0;
35312 :
35313 : /* "scipy/linalg/_decomp_interpolative.pyx":852
35314 : * idivm = i // m
35315 : * imodm = i - m*idivm
35316 : * csum[:] = 0.0 # <<<<<<<<<<<<<<
35317 : * for k in range(m):
35318 : * csum += F[m*idivm+k, :] * wsave[m*j+k]
35319 : */
35320 : if (__Pyx_PyObject_SetSlice(__pyx_v_csum, __pyx_float_0_0, 0, 0, NULL, NULL, &__pyx_slice__5, 0, 0, 0) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
35321 :
35322 : /* "scipy/linalg/_decomp_interpolative.pyx":853
35323 : * imodm = i - m*idivm
35324 : * csum[:] = 0.0
35325 : * for k in range(m): # <<<<<<<<<<<<<<
35326 : * csum += F[m*idivm+k, :] * wsave[m*j+k]
35327 : * rta[2*i, :] = csum.real
35328 : */
35329 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
35330 : __Pyx_GOTREF(__pyx_t_5);
35331 : __pyx_t_34 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 853, __pyx_L1_error)
35332 : __Pyx_GOTREF(__pyx_t_34);
35333 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35334 : if (likely(PyList_CheckExact(__pyx_t_34)) || PyTuple_CheckExact(__pyx_t_34)) {
35335 : __pyx_t_5 = __pyx_t_34; __Pyx_INCREF(__pyx_t_5);
35336 : __pyx_t_37 = 0;
35337 : __pyx_t_38 = NULL;
35338 : } else {
35339 : __pyx_t_37 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
35340 : __Pyx_GOTREF(__pyx_t_5);
35341 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 853, __pyx_L1_error)
35342 : }
35343 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35344 : for (;;) {
35345 : if (likely(!__pyx_t_38)) {
35346 : if (likely(PyList_CheckExact(__pyx_t_5))) {
35347 : {
35348 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
35349 : #if !CYTHON_ASSUME_SAFE_MACROS
35350 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 853, __pyx_L1_error)
35351 : #endif
35352 : if (__pyx_t_37 >= __pyx_temp) break;
35353 : }
35354 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35355 : __pyx_t_34 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_37); __Pyx_INCREF(__pyx_t_34); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 853, __pyx_L1_error)
35356 : #else
35357 : __pyx_t_34 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 853, __pyx_L1_error)
35358 : __Pyx_GOTREF(__pyx_t_34);
35359 : #endif
35360 : } else {
35361 : {
35362 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
35363 : #if !CYTHON_ASSUME_SAFE_MACROS
35364 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 853, __pyx_L1_error)
35365 : #endif
35366 : if (__pyx_t_37 >= __pyx_temp) break;
35367 : }
35368 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35369 : __pyx_t_34 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_37); __Pyx_INCREF(__pyx_t_34); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 853, __pyx_L1_error)
35370 : #else
35371 : __pyx_t_34 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 853, __pyx_L1_error)
35372 : __Pyx_GOTREF(__pyx_t_34);
35373 : #endif
35374 : }
35375 : } else {
35376 : __pyx_t_34 = __pyx_t_38(__pyx_t_5);
35377 : if (unlikely(!__pyx_t_34)) {
35378 : PyObject* exc_type = PyErr_Occurred();
35379 : if (exc_type) {
35380 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35381 : else __PYX_ERR(0, 853, __pyx_L1_error)
35382 : }
35383 : break;
35384 : }
35385 : __Pyx_GOTREF(__pyx_t_34);
35386 : }
35387 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_34);
35388 : __pyx_t_34 = 0;
35389 :
35390 : /* "scipy/linalg/_decomp_interpolative.pyx":854
35391 : * csum[:] = 0.0
35392 : * for k in range(m):
35393 : * csum += F[m*idivm+k, :] * wsave[m*j+k] # <<<<<<<<<<<<<<
35394 : * rta[2*i, :] = csum.real
35395 : * rta[2*i+1, :] = csum.imag
35396 : */
35397 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 854, __pyx_L1_error)
35398 : __Pyx_GOTREF(__pyx_t_34);
35399 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_34, __pyx_v_idivm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
35400 : __Pyx_GOTREF(__pyx_t_3);
35401 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35402 : __pyx_t_34 = PyNumber_Add(__pyx_t_3, __pyx_v_k); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 854, __pyx_L1_error)
35403 : __Pyx_GOTREF(__pyx_t_34);
35404 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35405 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
35406 : __Pyx_GOTREF(__pyx_t_3);
35407 : __Pyx_GIVEREF(__pyx_t_34);
35408 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_34)) __PYX_ERR(0, 854, __pyx_L1_error);
35409 : __Pyx_INCREF(__pyx_slice__5);
35410 : __Pyx_GIVEREF(__pyx_slice__5);
35411 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 854, __pyx_L1_error);
35412 : __pyx_t_34 = 0;
35413 : __pyx_t_34 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_3); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 854, __pyx_L1_error)
35414 : __Pyx_GOTREF(__pyx_t_34);
35415 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35416 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
35417 : __Pyx_GOTREF(__pyx_t_3);
35418 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 854, __pyx_L1_error)
35419 : __Pyx_GOTREF(__pyx_t_21);
35420 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35421 : __pyx_t_3 = PyNumber_Add(__pyx_t_21, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
35422 : __Pyx_GOTREF(__pyx_t_3);
35423 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35424 : __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_v_wsave, __pyx_t_3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 854, __pyx_L1_error)
35425 : __Pyx_GOTREF(__pyx_t_21);
35426 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35427 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_34, __pyx_t_21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
35428 : __Pyx_GOTREF(__pyx_t_3);
35429 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35430 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35431 : __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_v_csum, __pyx_t_3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 854, __pyx_L1_error)
35432 : __Pyx_GOTREF(__pyx_t_21);
35433 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35434 : __Pyx_DECREF_SET(__pyx_v_csum, __pyx_t_21);
35435 : __pyx_t_21 = 0;
35436 :
35437 : /* "scipy/linalg/_decomp_interpolative.pyx":853
35438 : * imodm = i - m*idivm
35439 : * csum[:] = 0.0
35440 : * for k in range(m): # <<<<<<<<<<<<<<
35441 : * csum += F[m*idivm+k, :] * wsave[m*j+k]
35442 : * rta[2*i, :] = csum.real
35443 : */
35444 : }
35445 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35446 :
35447 : /* "scipy/linalg/_decomp_interpolative.pyx":855
35448 : * for k in range(m):
35449 : * csum += F[m*idivm+k, :] * wsave[m*j+k]
35450 : * rta[2*i, :] = csum.real # <<<<<<<<<<<<<<
35451 : * rta[2*i+1, :] = csum.imag
35452 : *
35453 : */
35454 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_csum, __pyx_n_s_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error)
35455 : __Pyx_GOTREF(__pyx_t_5);
35456 : __pyx_t_21 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 855, __pyx_L1_error)
35457 : __Pyx_GOTREF(__pyx_t_21);
35458 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
35459 : __Pyx_GOTREF(__pyx_t_3);
35460 : __Pyx_GIVEREF(__pyx_t_21);
35461 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21)) __PYX_ERR(0, 855, __pyx_L1_error);
35462 : __Pyx_INCREF(__pyx_slice__5);
35463 : __Pyx_GIVEREF(__pyx_slice__5);
35464 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 855, __pyx_L1_error);
35465 : __pyx_t_21 = 0;
35466 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_3, __pyx_t_5) < 0))) __PYX_ERR(0, 855, __pyx_L1_error)
35467 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35468 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35469 :
35470 : /* "scipy/linalg/_decomp_interpolative.pyx":856
35471 : * csum += F[m*idivm+k, :] * wsave[m*j+k]
35472 : * rta[2*i, :] = csum.real
35473 : * rta[2*i+1, :] = csum.imag # <<<<<<<<<<<<<<
35474 : *
35475 : * else:
35476 : */
35477 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_csum, __pyx_n_s_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
35478 : __Pyx_GOTREF(__pyx_t_5);
35479 : __pyx_t_3 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
35480 : __Pyx_GOTREF(__pyx_t_3);
35481 : __pyx_t_21 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 856, __pyx_L1_error)
35482 : __Pyx_GOTREF(__pyx_t_21);
35483 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35484 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
35485 : __Pyx_GOTREF(__pyx_t_3);
35486 : __Pyx_GIVEREF(__pyx_t_21);
35487 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21)) __PYX_ERR(0, 856, __pyx_L1_error);
35488 : __Pyx_INCREF(__pyx_slice__5);
35489 : __Pyx_GIVEREF(__pyx_slice__5);
35490 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 856, __pyx_L1_error);
35491 : __pyx_t_21 = 0;
35492 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_3, __pyx_t_5) < 0))) __PYX_ERR(0, 856, __pyx_L1_error)
35493 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35494 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35495 :
35496 : /* "scipy/linalg/_decomp_interpolative.pyx":849
35497 : * for j in range(l2):
35498 : * i = ind2[j]
35499 : * if (i+1) <= (n//2 - m//2): # <<<<<<<<<<<<<<
35500 : * idivm = i // m
35501 : * imodm = i - m*idivm
35502 : */
35503 : goto __pyx_L40;
35504 : }
35505 :
35506 : /* "scipy/linalg/_decomp_interpolative.pyx":859
35507 : *
35508 : * else:
35509 : * idivm = (i+1)//(m//2) # <<<<<<<<<<<<<<
35510 : * imodm = (i+1)-(m//2)*idivm
35511 : * csum[:] = 0.0
35512 : */
35513 : /*else*/ {
35514 : __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
35515 : __Pyx_GOTREF(__pyx_t_5);
35516 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_m / 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
35517 : __Pyx_GOTREF(__pyx_t_3);
35518 : __pyx_t_21 = PyNumber_FloorDivide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 859, __pyx_L1_error)
35519 : __Pyx_GOTREF(__pyx_t_21);
35520 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35521 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35522 : __Pyx_XDECREF_SET(__pyx_v_idivm, __pyx_t_21);
35523 : __pyx_t_21 = 0;
35524 :
35525 : /* "scipy/linalg/_decomp_interpolative.pyx":860
35526 : * else:
35527 : * idivm = (i+1)//(m//2)
35528 : * imodm = (i+1)-(m//2)*idivm # <<<<<<<<<<<<<<
35529 : * csum[:] = 0.0
35530 : * for k in range(m):
35531 : */
35532 : __pyx_t_21 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 860, __pyx_L1_error)
35533 : __Pyx_GOTREF(__pyx_t_21);
35534 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_m / 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error)
35535 : __Pyx_GOTREF(__pyx_t_3);
35536 : __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_v_idivm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __pyx_L1_error)
35537 : __Pyx_GOTREF(__pyx_t_5);
35538 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35539 : __pyx_t_3 = PyNumber_Subtract(__pyx_t_21, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error)
35540 : __Pyx_GOTREF(__pyx_t_3);
35541 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35542 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35543 : __Pyx_XDECREF_SET(__pyx_v_imodm, __pyx_t_3);
35544 : __pyx_t_3 = 0;
35545 :
35546 : /* "scipy/linalg/_decomp_interpolative.pyx":861
35547 : * idivm = (i+1)//(m//2)
35548 : * imodm = (i+1)-(m//2)*idivm
35549 : * csum[:] = 0.0 # <<<<<<<<<<<<<<
35550 : * for k in range(m):
35551 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k]
35552 : */
35553 : if (__Pyx_PyObject_SetSlice(__pyx_v_csum, __pyx_float_0_0, 0, 0, NULL, NULL, &__pyx_slice__5, 0, 0, 0) < 0) __PYX_ERR(0, 861, __pyx_L1_error)
35554 :
35555 : /* "scipy/linalg/_decomp_interpolative.pyx":862
35556 : * imodm = (i+1)-(m//2)*idivm
35557 : * csum[:] = 0.0
35558 : * for k in range(m): # <<<<<<<<<<<<<<
35559 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k]
35560 : * rta[2*i, :] = csum.real
35561 : */
35562 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
35563 : __Pyx_GOTREF(__pyx_t_3);
35564 : __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
35565 : __Pyx_GOTREF(__pyx_t_5);
35566 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35567 : if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
35568 : __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3);
35569 : __pyx_t_37 = 0;
35570 : __pyx_t_38 = NULL;
35571 : } else {
35572 : __pyx_t_37 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
35573 : __Pyx_GOTREF(__pyx_t_3);
35574 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 862, __pyx_L1_error)
35575 : }
35576 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35577 : for (;;) {
35578 : if (likely(!__pyx_t_38)) {
35579 : if (likely(PyList_CheckExact(__pyx_t_3))) {
35580 : {
35581 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
35582 : #if !CYTHON_ASSUME_SAFE_MACROS
35583 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 862, __pyx_L1_error)
35584 : #endif
35585 : if (__pyx_t_37 >= __pyx_temp) break;
35586 : }
35587 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35588 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 862, __pyx_L1_error)
35589 : #else
35590 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
35591 : __Pyx_GOTREF(__pyx_t_5);
35592 : #endif
35593 : } else {
35594 : {
35595 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
35596 : #if !CYTHON_ASSUME_SAFE_MACROS
35597 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 862, __pyx_L1_error)
35598 : #endif
35599 : if (__pyx_t_37 >= __pyx_temp) break;
35600 : }
35601 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35602 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 862, __pyx_L1_error)
35603 : #else
35604 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
35605 : __Pyx_GOTREF(__pyx_t_5);
35606 : #endif
35607 : }
35608 : } else {
35609 : __pyx_t_5 = __pyx_t_38(__pyx_t_3);
35610 : if (unlikely(!__pyx_t_5)) {
35611 : PyObject* exc_type = PyErr_Occurred();
35612 : if (exc_type) {
35613 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35614 : else __PYX_ERR(0, 862, __pyx_L1_error)
35615 : }
35616 : break;
35617 : }
35618 : __Pyx_GOTREF(__pyx_t_5);
35619 : }
35620 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
35621 : __pyx_t_5 = 0;
35622 :
35623 : /* "scipy/linalg/_decomp_interpolative.pyx":863
35624 : * csum[:] = 0.0
35625 : * for k in range(m):
35626 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k] # <<<<<<<<<<<<<<
35627 : * rta[2*i, :] = csum.real
35628 : * rta[2*i+1, :] = csum.imag
35629 : */
35630 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
35631 : __Pyx_GOTREF(__pyx_t_5);
35632 : __pyx_t_21 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_nblock, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 863, __pyx_L1_error)
35633 : __Pyx_GOTREF(__pyx_t_21);
35634 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_5, __pyx_t_21); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
35635 : __Pyx_GOTREF(__pyx_t_34);
35636 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35637 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35638 : __pyx_t_21 = PyNumber_Add(__pyx_t_34, __pyx_v_k); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 863, __pyx_L1_error)
35639 : __Pyx_GOTREF(__pyx_t_21);
35640 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35641 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
35642 : __Pyx_GOTREF(__pyx_t_34);
35643 : __Pyx_GIVEREF(__pyx_t_21);
35644 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_21)) __PYX_ERR(0, 863, __pyx_L1_error);
35645 : __Pyx_INCREF(__pyx_slice__5);
35646 : __Pyx_GIVEREF(__pyx_slice__5);
35647 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_slice__5)) __PYX_ERR(0, 863, __pyx_L1_error);
35648 : __pyx_t_21 = 0;
35649 : __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_34); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 863, __pyx_L1_error)
35650 : __Pyx_GOTREF(__pyx_t_21);
35651 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35652 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
35653 : __Pyx_GOTREF(__pyx_t_34);
35654 : __pyx_t_5 = PyNumber_Multiply(__pyx_t_34, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
35655 : __Pyx_GOTREF(__pyx_t_5);
35656 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35657 : __pyx_t_34 = PyNumber_Add(__pyx_t_5, __pyx_v_k); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
35658 : __Pyx_GOTREF(__pyx_t_34);
35659 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35660 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_wsave, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
35661 : __Pyx_GOTREF(__pyx_t_5);
35662 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35663 : __pyx_t_34 = PyNumber_Multiply(__pyx_t_21, __pyx_t_5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 863, __pyx_L1_error)
35664 : __Pyx_GOTREF(__pyx_t_34);
35665 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35666 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35667 : __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_csum, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
35668 : __Pyx_GOTREF(__pyx_t_5);
35669 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35670 : __Pyx_DECREF_SET(__pyx_v_csum, __pyx_t_5);
35671 : __pyx_t_5 = 0;
35672 :
35673 : /* "scipy/linalg/_decomp_interpolative.pyx":862
35674 : * imodm = (i+1)-(m//2)*idivm
35675 : * csum[:] = 0.0
35676 : * for k in range(m): # <<<<<<<<<<<<<<
35677 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k]
35678 : * rta[2*i, :] = csum.real
35679 : */
35680 : }
35681 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35682 :
35683 : /* "scipy/linalg/_decomp_interpolative.pyx":864
35684 : * for k in range(m):
35685 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k]
35686 : * rta[2*i, :] = csum.real # <<<<<<<<<<<<<<
35687 : * rta[2*i+1, :] = csum.imag
35688 : * if i == (n//2) - 1:
35689 : */
35690 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_csum, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
35691 : __Pyx_GOTREF(__pyx_t_3);
35692 : __pyx_t_5 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 864, __pyx_L1_error)
35693 : __Pyx_GOTREF(__pyx_t_5);
35694 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 864, __pyx_L1_error)
35695 : __Pyx_GOTREF(__pyx_t_34);
35696 : __Pyx_GIVEREF(__pyx_t_5);
35697 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_5)) __PYX_ERR(0, 864, __pyx_L1_error);
35698 : __Pyx_INCREF(__pyx_slice__5);
35699 : __Pyx_GIVEREF(__pyx_slice__5);
35700 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_slice__5)) __PYX_ERR(0, 864, __pyx_L1_error);
35701 : __pyx_t_5 = 0;
35702 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_34, __pyx_t_3) < 0))) __PYX_ERR(0, 864, __pyx_L1_error)
35703 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35704 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35705 :
35706 : /* "scipy/linalg/_decomp_interpolative.pyx":865
35707 : * csum += F[m*(nblock//2)+k, :] * wsave[m*j+k]
35708 : * rta[2*i, :] = csum.real
35709 : * rta[2*i+1, :] = csum.imag # <<<<<<<<<<<<<<
35710 : * if i == (n//2) - 1:
35711 : * for k in range(m):
35712 : */
35713 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_csum, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
35714 : __Pyx_GOTREF(__pyx_t_3);
35715 : __pyx_t_34 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_i, 2, 0, 0); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 865, __pyx_L1_error)
35716 : __Pyx_GOTREF(__pyx_t_34);
35717 : __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_34, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
35718 : __Pyx_GOTREF(__pyx_t_5);
35719 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35720 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 865, __pyx_L1_error)
35721 : __Pyx_GOTREF(__pyx_t_34);
35722 : __Pyx_GIVEREF(__pyx_t_5);
35723 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error);
35724 : __Pyx_INCREF(__pyx_slice__5);
35725 : __Pyx_GIVEREF(__pyx_slice__5);
35726 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_slice__5)) __PYX_ERR(0, 865, __pyx_L1_error);
35727 : __pyx_t_5 = 0;
35728 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_34, __pyx_t_3) < 0))) __PYX_ERR(0, 865, __pyx_L1_error)
35729 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35730 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35731 :
35732 : /* "scipy/linalg/_decomp_interpolative.pyx":866
35733 : * rta[2*i, :] = csum.real
35734 : * rta[2*i+1, :] = csum.imag
35735 : * if i == (n//2) - 1: # <<<<<<<<<<<<<<
35736 : * for k in range(m):
35737 : * rsum += F[m*(nblock//2)+k, :]
35738 : */
35739 : __pyx_t_3 = __Pyx_PyInt_From_long(((__pyx_v_n / 2) - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
35740 : __Pyx_GOTREF(__pyx_t_3);
35741 : __pyx_t_34 = PyObject_RichCompare(__pyx_v_i, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_34); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 866, __pyx_L1_error)
35742 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35743 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_34); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 866, __pyx_L1_error)
35744 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35745 : if (__pyx_t_1) {
35746 :
35747 : /* "scipy/linalg/_decomp_interpolative.pyx":867
35748 : * rta[2*i+1, :] = csum.imag
35749 : * if i == (n//2) - 1:
35750 : * for k in range(m): # <<<<<<<<<<<<<<
35751 : * rsum += F[m*(nblock//2)+k, :]
35752 : * rta[n-2, :] = rsum
35753 : */
35754 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 867, __pyx_L1_error)
35755 : __Pyx_GOTREF(__pyx_t_34);
35756 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_34); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
35757 : __Pyx_GOTREF(__pyx_t_3);
35758 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35759 : if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
35760 : __pyx_t_34 = __pyx_t_3; __Pyx_INCREF(__pyx_t_34);
35761 : __pyx_t_37 = 0;
35762 : __pyx_t_38 = NULL;
35763 : } else {
35764 : __pyx_t_37 = -1; __pyx_t_34 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 867, __pyx_L1_error)
35765 : __Pyx_GOTREF(__pyx_t_34);
35766 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_34); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 867, __pyx_L1_error)
35767 : }
35768 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35769 : for (;;) {
35770 : if (likely(!__pyx_t_38)) {
35771 : if (likely(PyList_CheckExact(__pyx_t_34))) {
35772 : {
35773 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_34);
35774 : #if !CYTHON_ASSUME_SAFE_MACROS
35775 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 867, __pyx_L1_error)
35776 : #endif
35777 : if (__pyx_t_37 >= __pyx_temp) break;
35778 : }
35779 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35780 : __pyx_t_3 = PyList_GET_ITEM(__pyx_t_34, __pyx_t_37); __Pyx_INCREF(__pyx_t_3); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 867, __pyx_L1_error)
35781 : #else
35782 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_34, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
35783 : __Pyx_GOTREF(__pyx_t_3);
35784 : #endif
35785 : } else {
35786 : {
35787 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_34);
35788 : #if !CYTHON_ASSUME_SAFE_MACROS
35789 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 867, __pyx_L1_error)
35790 : #endif
35791 : if (__pyx_t_37 >= __pyx_temp) break;
35792 : }
35793 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35794 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_34, __pyx_t_37); __Pyx_INCREF(__pyx_t_3); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 867, __pyx_L1_error)
35795 : #else
35796 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_34, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
35797 : __Pyx_GOTREF(__pyx_t_3);
35798 : #endif
35799 : }
35800 : } else {
35801 : __pyx_t_3 = __pyx_t_38(__pyx_t_34);
35802 : if (unlikely(!__pyx_t_3)) {
35803 : PyObject* exc_type = PyErr_Occurred();
35804 : if (exc_type) {
35805 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35806 : else __PYX_ERR(0, 867, __pyx_L1_error)
35807 : }
35808 : break;
35809 : }
35810 : __Pyx_GOTREF(__pyx_t_3);
35811 : }
35812 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
35813 : __pyx_t_3 = 0;
35814 :
35815 : /* "scipy/linalg/_decomp_interpolative.pyx":868
35816 : * if i == (n//2) - 1:
35817 : * for k in range(m):
35818 : * rsum += F[m*(nblock//2)+k, :] # <<<<<<<<<<<<<<
35819 : * rta[n-2, :] = rsum
35820 : * rta[n-2, :] *= fact
35821 : */
35822 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
35823 : __Pyx_GOTREF(__pyx_t_3);
35824 : __pyx_t_5 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_nblock, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
35825 : __Pyx_GOTREF(__pyx_t_5);
35826 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 868, __pyx_L1_error)
35827 : __Pyx_GOTREF(__pyx_t_21);
35828 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35829 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35830 : __pyx_t_5 = PyNumber_Add(__pyx_t_21, __pyx_v_k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
35831 : __Pyx_GOTREF(__pyx_t_5);
35832 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35833 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 868, __pyx_L1_error)
35834 : __Pyx_GOTREF(__pyx_t_21);
35835 : __Pyx_GIVEREF(__pyx_t_5);
35836 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error);
35837 : __Pyx_INCREF(__pyx_slice__5);
35838 : __Pyx_GIVEREF(__pyx_slice__5);
35839 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_slice__5)) __PYX_ERR(0, 868, __pyx_L1_error);
35840 : __pyx_t_5 = 0;
35841 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
35842 : __Pyx_GOTREF(__pyx_t_5);
35843 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35844 : __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_v_rsum, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 868, __pyx_L1_error)
35845 : __Pyx_GOTREF(__pyx_t_21);
35846 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35847 : __Pyx_DECREF_SET(__pyx_v_rsum, __pyx_t_21);
35848 : __pyx_t_21 = 0;
35849 :
35850 : /* "scipy/linalg/_decomp_interpolative.pyx":867
35851 : * rta[2*i+1, :] = csum.imag
35852 : * if i == (n//2) - 1:
35853 : * for k in range(m): # <<<<<<<<<<<<<<
35854 : * rsum += F[m*(nblock//2)+k, :]
35855 : * rta[n-2, :] = rsum
35856 : */
35857 : }
35858 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35859 :
35860 : /* "scipy/linalg/_decomp_interpolative.pyx":869
35861 : * for k in range(m):
35862 : * rsum += F[m*(nblock//2)+k, :]
35863 : * rta[n-2, :] = rsum # <<<<<<<<<<<<<<
35864 : * rta[n-2, :] *= fact
35865 : *
35866 : */
35867 : __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_n - 2)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 869, __pyx_L1_error)
35868 : __Pyx_GOTREF(__pyx_t_34);
35869 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 869, __pyx_L1_error)
35870 : __Pyx_GOTREF(__pyx_t_21);
35871 : __Pyx_GIVEREF(__pyx_t_34);
35872 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_34)) __PYX_ERR(0, 869, __pyx_L1_error);
35873 : __Pyx_INCREF(__pyx_slice__5);
35874 : __Pyx_GIVEREF(__pyx_slice__5);
35875 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_slice__5)) __PYX_ERR(0, 869, __pyx_L1_error);
35876 : __pyx_t_34 = 0;
35877 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_21, __pyx_v_rsum) < 0))) __PYX_ERR(0, 869, __pyx_L1_error)
35878 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35879 :
35880 : /* "scipy/linalg/_decomp_interpolative.pyx":870
35881 : * rsum += F[m*(nblock//2)+k, :]
35882 : * rta[n-2, :] = rsum
35883 : * rta[n-2, :] *= fact # <<<<<<<<<<<<<<
35884 : *
35885 : * rsum[:] = 0.0
35886 : */
35887 : __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_n - 2)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 870, __pyx_L1_error)
35888 : __Pyx_GOTREF(__pyx_t_21);
35889 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 870, __pyx_L1_error)
35890 : __Pyx_GOTREF(__pyx_t_34);
35891 : __Pyx_GIVEREF(__pyx_t_21);
35892 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_21)) __PYX_ERR(0, 870, __pyx_L1_error);
35893 : __Pyx_INCREF(__pyx_slice__5);
35894 : __Pyx_GIVEREF(__pyx_slice__5);
35895 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_slice__5)) __PYX_ERR(0, 870, __pyx_L1_error);
35896 : __pyx_t_21 = 0;
35897 : __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_34); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 870, __pyx_L1_error)
35898 : __Pyx_GOTREF(__pyx_t_21);
35899 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_21, __pyx_v_fact); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 870, __pyx_L1_error)
35900 : __Pyx_GOTREF(__pyx_t_5);
35901 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35902 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_34, __pyx_t_5) < 0))) __PYX_ERR(0, 870, __pyx_L1_error)
35903 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35904 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35905 :
35906 : /* "scipy/linalg/_decomp_interpolative.pyx":872
35907 : * rta[n-2, :] *= fact
35908 : *
35909 : * rsum[:] = 0.0 # <<<<<<<<<<<<<<
35910 : * for k in range(m//2):
35911 : * rsum += F[m*(nblock//2)+2*k-1]
35912 : */
35913 : if (__Pyx_PyObject_SetSlice(__pyx_v_rsum, __pyx_float_0_0, 0, 0, NULL, NULL, &__pyx_slice__5, 0, 0, 0) < 0) __PYX_ERR(0, 872, __pyx_L1_error)
35914 :
35915 : /* "scipy/linalg/_decomp_interpolative.pyx":873
35916 : *
35917 : * rsum[:] = 0.0
35918 : * for k in range(m//2): # <<<<<<<<<<<<<<
35919 : * rsum += F[m*(nblock//2)+2*k-1]
35920 : * rsum -= F[m*(nblock//2)+2*k]
35921 : */
35922 : __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_m / 2)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 873, __pyx_L1_error)
35923 : __Pyx_GOTREF(__pyx_t_34);
35924 : __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error)
35925 : __Pyx_GOTREF(__pyx_t_5);
35926 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
35927 : if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
35928 : __pyx_t_34 = __pyx_t_5; __Pyx_INCREF(__pyx_t_34);
35929 : __pyx_t_37 = 0;
35930 : __pyx_t_38 = NULL;
35931 : } else {
35932 : __pyx_t_37 = -1; __pyx_t_34 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 873, __pyx_L1_error)
35933 : __Pyx_GOTREF(__pyx_t_34);
35934 : __pyx_t_38 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_34); if (unlikely(!__pyx_t_38)) __PYX_ERR(0, 873, __pyx_L1_error)
35935 : }
35936 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35937 : for (;;) {
35938 : if (likely(!__pyx_t_38)) {
35939 : if (likely(PyList_CheckExact(__pyx_t_34))) {
35940 : {
35941 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_34);
35942 : #if !CYTHON_ASSUME_SAFE_MACROS
35943 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
35944 : #endif
35945 : if (__pyx_t_37 >= __pyx_temp) break;
35946 : }
35947 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35948 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_34, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
35949 : #else
35950 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_34, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error)
35951 : __Pyx_GOTREF(__pyx_t_5);
35952 : #endif
35953 : } else {
35954 : {
35955 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_34);
35956 : #if !CYTHON_ASSUME_SAFE_MACROS
35957 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
35958 : #endif
35959 : if (__pyx_t_37 >= __pyx_temp) break;
35960 : }
35961 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35962 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_34, __pyx_t_37); __Pyx_INCREF(__pyx_t_5); __pyx_t_37++; if (unlikely((0 < 0))) __PYX_ERR(0, 873, __pyx_L1_error)
35963 : #else
35964 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_34, __pyx_t_37); __pyx_t_37++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 873, __pyx_L1_error)
35965 : __Pyx_GOTREF(__pyx_t_5);
35966 : #endif
35967 : }
35968 : } else {
35969 : __pyx_t_5 = __pyx_t_38(__pyx_t_34);
35970 : if (unlikely(!__pyx_t_5)) {
35971 : PyObject* exc_type = PyErr_Occurred();
35972 : if (exc_type) {
35973 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
35974 : else __PYX_ERR(0, 873, __pyx_L1_error)
35975 : }
35976 : break;
35977 : }
35978 : __Pyx_GOTREF(__pyx_t_5);
35979 : }
35980 : __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
35981 : __pyx_t_5 = 0;
35982 :
35983 : /* "scipy/linalg/_decomp_interpolative.pyx":874
35984 : * rsum[:] = 0.0
35985 : * for k in range(m//2):
35986 : * rsum += F[m*(nblock//2)+2*k-1] # <<<<<<<<<<<<<<
35987 : * rsum -= F[m*(nblock//2)+2*k]
35988 : * rta[n-1, :] = rsum
35989 : */
35990 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
35991 : __Pyx_GOTREF(__pyx_t_5);
35992 : __pyx_t_21 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_nblock, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 874, __pyx_L1_error)
35993 : __Pyx_GOTREF(__pyx_t_21);
35994 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
35995 : __Pyx_GOTREF(__pyx_t_3);
35996 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35997 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
35998 : __pyx_t_21 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_k, 2, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 874, __pyx_L1_error)
35999 : __Pyx_GOTREF(__pyx_t_21);
36000 : __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
36001 : __Pyx_GOTREF(__pyx_t_5);
36002 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36003 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36004 : __pyx_t_21 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 874, __pyx_L1_error)
36005 : __Pyx_GOTREF(__pyx_t_21);
36006 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36007 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
36008 : __Pyx_GOTREF(__pyx_t_5);
36009 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36010 : __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_v_rsum, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 874, __pyx_L1_error)
36011 : __Pyx_GOTREF(__pyx_t_21);
36012 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36013 : __Pyx_DECREF_SET(__pyx_v_rsum, __pyx_t_21);
36014 : __pyx_t_21 = 0;
36015 :
36016 : /* "scipy/linalg/_decomp_interpolative.pyx":875
36017 : * for k in range(m//2):
36018 : * rsum += F[m*(nblock//2)+2*k-1]
36019 : * rsum -= F[m*(nblock//2)+2*k] # <<<<<<<<<<<<<<
36020 : * rta[n-1, :] = rsum
36021 : * rta[n-1, :] *= fact
36022 : */
36023 : __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 875, __pyx_L1_error)
36024 : __Pyx_GOTREF(__pyx_t_21);
36025 : __pyx_t_5 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_nblock, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
36026 : __Pyx_GOTREF(__pyx_t_5);
36027 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_21, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error)
36028 : __Pyx_GOTREF(__pyx_t_3);
36029 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36030 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36031 : __pyx_t_5 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_k, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
36032 : __Pyx_GOTREF(__pyx_t_5);
36033 : __pyx_t_21 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 875, __pyx_L1_error)
36034 : __Pyx_GOTREF(__pyx_t_21);
36035 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36036 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36037 : __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_F, __pyx_t_21); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 875, __pyx_L1_error)
36038 : __Pyx_GOTREF(__pyx_t_5);
36039 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36040 : __pyx_t_21 = PyNumber_InPlaceSubtract(__pyx_v_rsum, __pyx_t_5); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 875, __pyx_L1_error)
36041 : __Pyx_GOTREF(__pyx_t_21);
36042 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36043 : __Pyx_DECREF_SET(__pyx_v_rsum, __pyx_t_21);
36044 : __pyx_t_21 = 0;
36045 :
36046 : /* "scipy/linalg/_decomp_interpolative.pyx":873
36047 : *
36048 : * rsum[:] = 0.0
36049 : * for k in range(m//2): # <<<<<<<<<<<<<<
36050 : * rsum += F[m*(nblock//2)+2*k-1]
36051 : * rsum -= F[m*(nblock//2)+2*k]
36052 : */
36053 : }
36054 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
36055 :
36056 : /* "scipy/linalg/_decomp_interpolative.pyx":876
36057 : * rsum += F[m*(nblock//2)+2*k-1]
36058 : * rsum -= F[m*(nblock//2)+2*k]
36059 : * rta[n-1, :] = rsum # <<<<<<<<<<<<<<
36060 : * rta[n-1, :] *= fact
36061 : *
36062 : */
36063 : __pyx_t_34 = __Pyx_PyInt_From_long((__pyx_v_n - 1)); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 876, __pyx_L1_error)
36064 : __Pyx_GOTREF(__pyx_t_34);
36065 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 876, __pyx_L1_error)
36066 : __Pyx_GOTREF(__pyx_t_21);
36067 : __Pyx_GIVEREF(__pyx_t_34);
36068 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_34)) __PYX_ERR(0, 876, __pyx_L1_error);
36069 : __Pyx_INCREF(__pyx_slice__5);
36070 : __Pyx_GIVEREF(__pyx_slice__5);
36071 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_slice__5)) __PYX_ERR(0, 876, __pyx_L1_error);
36072 : __pyx_t_34 = 0;
36073 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_21, __pyx_v_rsum) < 0))) __PYX_ERR(0, 876, __pyx_L1_error)
36074 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36075 :
36076 : /* "scipy/linalg/_decomp_interpolative.pyx":877
36077 : * rsum -= F[m*(nblock//2)+2*k]
36078 : * rta[n-1, :] = rsum
36079 : * rta[n-1, :] *= fact # <<<<<<<<<<<<<<
36080 : *
36081 : * # idd_subselect pick randomly l2-many rows
36082 : */
36083 : __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_n - 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 877, __pyx_L1_error)
36084 : __Pyx_GOTREF(__pyx_t_21);
36085 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 877, __pyx_L1_error)
36086 : __Pyx_GOTREF(__pyx_t_34);
36087 : __Pyx_GIVEREF(__pyx_t_21);
36088 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_21)) __PYX_ERR(0, 877, __pyx_L1_error);
36089 : __Pyx_INCREF(__pyx_slice__5);
36090 : __Pyx_GIVEREF(__pyx_slice__5);
36091 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_slice__5)) __PYX_ERR(0, 877, __pyx_L1_error);
36092 : __pyx_t_21 = 0;
36093 : __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_34); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 877, __pyx_L1_error)
36094 : __Pyx_GOTREF(__pyx_t_21);
36095 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_21, __pyx_v_fact); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error)
36096 : __Pyx_GOTREF(__pyx_t_5);
36097 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36098 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rta), __pyx_t_34, __pyx_t_5) < 0))) __PYX_ERR(0, 877, __pyx_L1_error)
36099 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36100 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
36101 :
36102 : /* "scipy/linalg/_decomp_interpolative.pyx":866
36103 : * rta[2*i, :] = csum.real
36104 : * rta[2*i+1, :] = csum.imag
36105 : * if i == (n//2) - 1: # <<<<<<<<<<<<<<
36106 : * for k in range(m):
36107 : * rsum += F[m*(nblock//2)+k, :]
36108 : */
36109 : }
36110 : }
36111 : __pyx_L40:;
36112 :
36113 : /* "scipy/linalg/_decomp_interpolative.pyx":847
36114 : * rsum = np.zeros_like(F[0, :])
36115 : *
36116 : * for j in range(l2): # <<<<<<<<<<<<<<
36117 : * i = ind2[j]
36118 : * if (i+1) <= (n//2 - m//2):
36119 : */
36120 : }
36121 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36122 :
36123 : /* "scipy/linalg/_decomp_interpolative.pyx":880
36124 : *
36125 : * # idd_subselect pick randomly l2-many rows
36126 : * subselect = rng.choice(n2, l2, replace=False) # <<<<<<<<<<<<<<
36127 : * rta = rta[subselect, :]
36128 : *
36129 : */
36130 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error)
36131 : __Pyx_GOTREF(__pyx_t_4);
36132 : __pyx_t_34 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 880, __pyx_L1_error)
36133 : __Pyx_GOTREF(__pyx_t_34);
36134 : if (unlikely(!__pyx_v_l2)) { __Pyx_RaiseUnboundLocalError("l2"); __PYX_ERR(0, 880, __pyx_L1_error) }
36135 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
36136 : __Pyx_GOTREF(__pyx_t_5);
36137 : __Pyx_GIVEREF(__pyx_t_34);
36138 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_34)) __PYX_ERR(0, 880, __pyx_L1_error);
36139 : __Pyx_INCREF(__pyx_v_l2);
36140 : __Pyx_GIVEREF(__pyx_v_l2);
36141 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_l2)) __PYX_ERR(0, 880, __pyx_L1_error);
36142 : __pyx_t_34 = 0;
36143 : __pyx_t_34 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 880, __pyx_L1_error)
36144 : __Pyx_GOTREF(__pyx_t_34);
36145 : if (PyDict_SetItem(__pyx_t_34, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 880, __pyx_L1_error)
36146 : __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_34); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 880, __pyx_L1_error)
36147 : __Pyx_GOTREF(__pyx_t_21);
36148 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36149 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36150 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
36151 : if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 880, __pyx_L1_error)
36152 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_21);
36153 : {
36154 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36155 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
36156 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
36157 : if (unlikely(__pyx_t_12 < 0)) {
36158 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
36159 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_v_subselect, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
36160 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
36161 : __Pyx_RaiseBufferFallbackError();
36162 : } else {
36163 : PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
36164 : }
36165 : __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
36166 : }
36167 : __pyx_pybuffernd_subselect.diminfo[0].strides = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_subselect.diminfo[0].shape = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.shape[0];
36168 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 880, __pyx_L1_error)
36169 : }
36170 : __pyx_t_35 = 0;
36171 : __Pyx_DECREF_SET(__pyx_v_subselect, ((PyArrayObject *)__pyx_t_21));
36172 : __pyx_t_21 = 0;
36173 :
36174 : /* "scipy/linalg/_decomp_interpolative.pyx":881
36175 : * # idd_subselect pick randomly l2-many rows
36176 : * subselect = rng.choice(n2, l2, replace=False)
36177 : * rta = rta[subselect, :] # <<<<<<<<<<<<<<
36178 : *
36179 : * perms, proj = iddr_id(rta, krank)
36180 : */
36181 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 881, __pyx_L1_error)
36182 : __Pyx_GOTREF(__pyx_t_21);
36183 : __Pyx_INCREF((PyObject *)__pyx_v_subselect);
36184 : __Pyx_GIVEREF((PyObject *)__pyx_v_subselect);
36185 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, ((PyObject *)__pyx_v_subselect))) __PYX_ERR(0, 881, __pyx_L1_error);
36186 : __Pyx_INCREF(__pyx_slice__5);
36187 : __Pyx_GIVEREF(__pyx_slice__5);
36188 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_slice__5)) __PYX_ERR(0, 881, __pyx_L1_error);
36189 : __pyx_t_34 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_21); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 881, __pyx_L1_error)
36190 : __Pyx_GOTREF(__pyx_t_34);
36191 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36192 : if (!(likely(((__pyx_t_34) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_34, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 881, __pyx_L1_error)
36193 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_34);
36194 : {
36195 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36196 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
36197 : __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
36198 : if (unlikely(__pyx_t_12 < 0)) {
36199 : PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
36200 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
36201 : Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
36202 : __Pyx_RaiseBufferFallbackError();
36203 : } else {
36204 : PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
36205 : }
36206 : __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
36207 : }
36208 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
36209 : if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 881, __pyx_L1_error)
36210 : }
36211 : __pyx_t_25 = 0;
36212 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_34));
36213 : __pyx_t_34 = 0;
36214 :
36215 : /* "scipy/linalg/_decomp_interpolative.pyx":883
36216 : * rta = rta[subselect, :]
36217 : *
36218 : * perms, proj = iddr_id(rta, krank) # <<<<<<<<<<<<<<
36219 : *
36220 : * return perms, proj
36221 : */
36222 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_iddr_id); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 883, __pyx_L1_error)
36223 : __Pyx_GOTREF(__pyx_t_21);
36224 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __pyx_L1_error)
36225 : __Pyx_GOTREF(__pyx_t_5);
36226 : __pyx_t_4 = NULL;
36227 : __pyx_t_7 = 0;
36228 : #if CYTHON_UNPACK_METHODS
36229 : if (unlikely(PyMethod_Check(__pyx_t_21))) {
36230 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_21);
36231 : if (likely(__pyx_t_4)) {
36232 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
36233 : __Pyx_INCREF(__pyx_t_4);
36234 : __Pyx_INCREF(function);
36235 : __Pyx_DECREF_SET(__pyx_t_21, function);
36236 : __pyx_t_7 = 1;
36237 : }
36238 : }
36239 : #endif
36240 : {
36241 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_rta), __pyx_t_5};
36242 : __pyx_t_34 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
36243 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
36244 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36245 : if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 883, __pyx_L1_error)
36246 : __Pyx_GOTREF(__pyx_t_34);
36247 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
36248 : }
36249 : if ((likely(PyTuple_CheckExact(__pyx_t_34))) || (PyList_CheckExact(__pyx_t_34))) {
36250 : PyObject* sequence = __pyx_t_34;
36251 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36252 : if (unlikely(size != 2)) {
36253 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36254 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36255 : __PYX_ERR(0, 883, __pyx_L1_error)
36256 : }
36257 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36258 : if (likely(PyTuple_CheckExact(sequence))) {
36259 : __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0);
36260 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
36261 : } else {
36262 : __pyx_t_21 = PyList_GET_ITEM(sequence, 0);
36263 : __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
36264 : }
36265 : __Pyx_INCREF(__pyx_t_21);
36266 : __Pyx_INCREF(__pyx_t_5);
36267 : #else
36268 : __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 883, __pyx_L1_error)
36269 : __Pyx_GOTREF(__pyx_t_21);
36270 : __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 883, __pyx_L1_error)
36271 : __Pyx_GOTREF(__pyx_t_5);
36272 : #endif
36273 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
36274 : } else {
36275 : Py_ssize_t index = -1;
36276 : __pyx_t_4 = PyObject_GetIter(__pyx_t_34); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
36277 : __Pyx_GOTREF(__pyx_t_4);
36278 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
36279 : __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
36280 : index = 0; __pyx_t_21 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_21)) goto __pyx_L55_unpacking_failed;
36281 : __Pyx_GOTREF(__pyx_t_21);
36282 : index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L55_unpacking_failed;
36283 : __Pyx_GOTREF(__pyx_t_5);
36284 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) __PYX_ERR(0, 883, __pyx_L1_error)
36285 : __pyx_t_8 = NULL;
36286 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36287 : goto __pyx_L56_unpacking_done;
36288 : __pyx_L55_unpacking_failed:;
36289 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36290 : __pyx_t_8 = NULL;
36291 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
36292 : __PYX_ERR(0, 883, __pyx_L1_error)
36293 : __pyx_L56_unpacking_done:;
36294 : }
36295 : __pyx_v_perms = __pyx_t_21;
36296 : __pyx_t_21 = 0;
36297 : __pyx_v_proj = __pyx_t_5;
36298 : __pyx_t_5 = 0;
36299 :
36300 : /* "scipy/linalg/_decomp_interpolative.pyx":885
36301 : * perms, proj = iddr_id(rta, krank)
36302 : *
36303 : * return perms, proj # <<<<<<<<<<<<<<
36304 : *
36305 : *
36306 : */
36307 : __Pyx_XDECREF(__pyx_r);
36308 : __pyx_t_34 = PyTuple_New(2); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 885, __pyx_L1_error)
36309 : __Pyx_GOTREF(__pyx_t_34);
36310 : __Pyx_INCREF(__pyx_v_perms);
36311 : __Pyx_GIVEREF(__pyx_v_perms);
36312 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_v_perms)) __PYX_ERR(0, 885, __pyx_L1_error);
36313 : __Pyx_INCREF(__pyx_v_proj);
36314 : __Pyx_GIVEREF(__pyx_v_proj);
36315 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_v_proj)) __PYX_ERR(0, 885, __pyx_L1_error);
36316 : __pyx_r = __pyx_t_34;
36317 : __pyx_t_34 = 0;
36318 : goto __pyx_L0;
36319 :
36320 : /* "scipy/linalg/_decomp_interpolative.pyx":736
36321 : *
36322 : *
36323 : * def iddr_aid(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
36324 : * rng):
36325 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, L
36326 : */
36327 :
36328 : /* function exit code */
36329 0 : __pyx_L1_error:;
36330 0 : __Pyx_XDECREF(__pyx_t_3);
36331 0 : __Pyx_XDECREF(__pyx_t_4);
36332 0 : __Pyx_XDECREF(__pyx_t_5);
36333 0 : __Pyx_XDECREF(__pyx_t_6);
36334 0 : __Pyx_XDECREF(__pyx_t_21);
36335 0 : __Pyx_XDECREF(__pyx_t_34);
36336 0 : __Pyx_XDECREF(__pyx_t_36);
36337 0 : __Pyx_XDECREF(__pyx_t_39);
36338 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
36339 0 : __Pyx_PyThreadState_declare
36340 0 : __Pyx_PyThreadState_assign
36341 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
36342 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
36343 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
36344 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
36345 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_marker.rcbuffer->pybuffer);
36346 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
36347 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
36348 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
36349 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
36350 0 : __pyx_r = NULL;
36351 0 : goto __pyx_L2;
36352 25 : __pyx_L0:;
36353 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
36354 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
36355 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
36356 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_marker.rcbuffer->pybuffer);
36357 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
36358 25 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
36359 25 : __pyx_L2:;
36360 25 : __Pyx_XDECREF((PyObject *)__pyx_v_albetas);
36361 25 : __Pyx_XDECREF((PyObject *)__pyx_v_subselect);
36362 25 : __Pyx_XDECREF((PyObject *)__pyx_v_giv2x2);
36363 25 : __Pyx_XDECREF((PyObject *)__pyx_v_rta);
36364 25 : __Pyx_XDECREF((PyObject *)__pyx_v_marker);
36365 25 : __Pyx_XDECREF(__pyx_v_inds);
36366 25 : __Pyx_XDECREF(__pyx_v_proj);
36367 25 : __Pyx_XDECREF(__pyx_v_ind);
36368 25 : __Pyx_XDECREF(__pyx_v_ind2);
36369 25 : __Pyx_XDECREF(__pyx_v_k);
36370 25 : __Pyx_XDECREF(__pyx_v_l2);
36371 25 : __Pyx_XDECREF(__pyx_v_twopi);
36372 25 : __Pyx_XDECREF(__pyx_v_twopii);
36373 25 : __Pyx_XDECREF(__pyx_v_nblock);
36374 25 : __Pyx_XDECREF(__pyx_v_fact);
36375 25 : __Pyx_XDECREF(__pyx_v_wsave);
36376 25 : __Pyx_XDECREF(__pyx_v_j);
36377 25 : __Pyx_XDECREF(__pyx_v_i);
36378 25 : __Pyx_XDECREF(__pyx_v_idivm);
36379 25 : __Pyx_XDECREF(__pyx_v_imodm);
36380 25 : __Pyx_XDECREF(__pyx_v_F);
36381 25 : __Pyx_XDECREF(__pyx_v_csum);
36382 25 : __Pyx_XDECREF(__pyx_v_rsum);
36383 25 : __Pyx_XDECREF(__pyx_v_perms);
36384 25 : __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
36385 25 : __Pyx_XGIVEREF(__pyx_r);
36386 25 : __Pyx_RefNannyFinishContext();
36387 25 : return __pyx_r;
36388 : }
36389 :
36390 : /* "scipy/linalg/_decomp_interpolative.pyx":888
36391 : *
36392 : *
36393 : * def iddr_asvd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
36394 : * rng):
36395 : * cdef int m = a.shape[0], n = a.shape[1]
36396 : */
36397 :
36398 : /* Python wrapper */
36399 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_29iddr_asvd(PyObject *__pyx_self,
36400 : #if CYTHON_METH_FASTCALL
36401 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
36402 : #else
36403 : PyObject *__pyx_args, PyObject *__pyx_kwds
36404 : #endif
36405 : ); /*proto*/
36406 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_29iddr_asvd = {"iddr_asvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_29iddr_asvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
36407 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_29iddr_asvd(PyObject *__pyx_self,
36408 : #if CYTHON_METH_FASTCALL
36409 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
36410 : #else
36411 : PyObject *__pyx_args, PyObject *__pyx_kwds
36412 : #endif
36413 : ) {
36414 1 : PyArrayObject *__pyx_v_a = 0;
36415 1 : int __pyx_v_krank;
36416 1 : PyObject *__pyx_v_rng = 0;
36417 : #if !CYTHON_METH_FASTCALL
36418 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
36419 : #endif
36420 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
36421 1 : PyObject* values[3] = {0,0,0};
36422 1 : int __pyx_lineno = 0;
36423 1 : const char *__pyx_filename = NULL;
36424 1 : int __pyx_clineno = 0;
36425 1 : PyObject *__pyx_r = 0;
36426 : __Pyx_RefNannyDeclarations
36427 1 : __Pyx_RefNannySetupContext("iddr_asvd (wrapper)", 0);
36428 : #if !CYTHON_METH_FASTCALL
36429 : #if CYTHON_ASSUME_SAFE_MACROS
36430 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
36431 : #else
36432 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
36433 : #endif
36434 : #endif
36435 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
36436 : {
36437 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
36438 1 : if (likely(__pyx_kwds)) {
36439 1 : Py_ssize_t kw_args;
36440 1 : switch (__pyx_nargs) {
36441 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
36442 1 : CYTHON_FALLTHROUGH;
36443 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
36444 1 : CYTHON_FALLTHROUGH;
36445 1 : case 0: break;
36446 0 : default: goto __pyx_L5_argtuple_error;
36447 : }
36448 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
36449 1 : switch (__pyx_nargs) {
36450 : case 0:
36451 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
36452 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
36453 0 : kw_args--;
36454 : }
36455 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
36456 0 : else goto __pyx_L5_argtuple_error;
36457 0 : CYTHON_FALLTHROUGH;
36458 : case 1:
36459 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
36460 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
36461 0 : kw_args--;
36462 : }
36463 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
36464 : else {
36465 0 : __Pyx_RaiseArgtupleInvalid("iddr_asvd", 1, 2, 2, 1); __PYX_ERR(0, 888, __pyx_L3_error)
36466 : }
36467 1 : CYTHON_FALLTHROUGH;
36468 : case 2:
36469 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
36470 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
36471 1 : kw_args--;
36472 : }
36473 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
36474 : else {
36475 0 : __Pyx_RaiseKeywordRequired("iddr_asvd", __pyx_n_s_rng); __PYX_ERR(0, 888, __pyx_L3_error)
36476 : }
36477 : }
36478 1 : if (unlikely(kw_args > 0)) {
36479 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
36480 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_asvd") < 0)) __PYX_ERR(0, 888, __pyx_L3_error)
36481 : }
36482 0 : } else if (unlikely(__pyx_nargs != 2)) {
36483 0 : goto __pyx_L5_argtuple_error;
36484 : } else {
36485 0 : __Pyx_RaiseKeywordRequired("iddr_asvd", __pyx_n_s_rng); __PYX_ERR(0, 888, __pyx_L3_error)
36486 : }
36487 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
36488 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
36489 1 : __pyx_v_rng = values[2];
36490 : }
36491 1 : goto __pyx_L6_skip;
36492 0 : __pyx_L5_argtuple_error:;
36493 0 : __Pyx_RaiseArgtupleInvalid("iddr_asvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 888, __pyx_L3_error)
36494 1 : __pyx_L6_skip:;
36495 1 : goto __pyx_L4_argument_unpacking_done;
36496 0 : __pyx_L3_error:;
36497 : {
36498 0 : Py_ssize_t __pyx_temp;
36499 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
36500 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
36501 : }
36502 : }
36503 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
36504 0 : __Pyx_RefNannyFinishContext();
36505 0 : return NULL;
36506 1 : __pyx_L4_argument_unpacking_done:;
36507 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 888, __pyx_L1_error)
36508 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_28iddr_asvd(__pyx_self, __pyx_v_a, __pyx_v_krank, __pyx_v_rng);
36509 :
36510 : /* function exit code */
36511 1 : goto __pyx_L0;
36512 0 : __pyx_L1_error:;
36513 0 : __pyx_r = NULL;
36514 1 : __pyx_L0:;
36515 : {
36516 1 : Py_ssize_t __pyx_temp;
36517 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
36518 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
36519 : }
36520 : }
36521 : __Pyx_RefNannyFinishContext();
36522 : return __pyx_r;
36523 : }
36524 :
36525 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_28iddr_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng) {
36526 1 : int __pyx_v_m;
36527 1 : int __pyx_v_n;
36528 1 : int __pyx_v_info;
36529 1 : int __pyx_v_ci;
36530 1 : PyArrayObject *__pyx_v_C = 0;
36531 1 : PyArrayObject *__pyx_v_tau1 = 0;
36532 1 : PyArrayObject *__pyx_v_tau2 = 0;
36533 1 : PyArrayObject *__pyx_v_UU = 0;
36534 1 : PyArrayObject *__pyx_v_S = 0;
36535 1 : PyArrayObject *__pyx_v_V = 0;
36536 1 : PyArrayObject *__pyx_v_VV = 0;
36537 1 : PyArrayObject *__pyx_v_proj = 0;
36538 1 : PyArrayObject *__pyx_v_perms = 0;
36539 1 : PyArrayObject *__pyx_v_inds1 = 0;
36540 1 : PyArrayObject *__pyx_v_inds2 = 0;
36541 1 : PyArrayObject *__pyx_v_p = 0;
36542 1 : PyArrayObject *__pyx_v_col = 0;
36543 1 : PyObject *__pyx_v_r = NULL;
36544 1 : PyObject *__pyx_v_t = NULL;
36545 1 : PyObject *__pyx_v_r2 = NULL;
36546 1 : PyObject *__pyx_v_r3 = NULL;
36547 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
36548 1 : __Pyx_Buffer __pyx_pybuffer_C;
36549 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
36550 1 : __Pyx_Buffer __pyx_pybuffer_S;
36551 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
36552 1 : __Pyx_Buffer __pyx_pybuffer_UU;
36553 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
36554 1 : __Pyx_Buffer __pyx_pybuffer_V;
36555 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
36556 1 : __Pyx_Buffer __pyx_pybuffer_VV;
36557 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
36558 1 : __Pyx_Buffer __pyx_pybuffer_a;
36559 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
36560 1 : __Pyx_Buffer __pyx_pybuffer_col;
36561 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
36562 1 : __Pyx_Buffer __pyx_pybuffer_inds1;
36563 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
36564 1 : __Pyx_Buffer __pyx_pybuffer_inds2;
36565 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
36566 1 : __Pyx_Buffer __pyx_pybuffer_p;
36567 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
36568 1 : __Pyx_Buffer __pyx_pybuffer_perms;
36569 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
36570 1 : __Pyx_Buffer __pyx_pybuffer_proj;
36571 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
36572 1 : __Pyx_Buffer __pyx_pybuffer_tau1;
36573 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
36574 1 : __Pyx_Buffer __pyx_pybuffer_tau2;
36575 1 : PyObject *__pyx_r = NULL;
36576 : __Pyx_RefNannyDeclarations
36577 1 : PyObject *__pyx_t_1 = NULL;
36578 1 : PyObject *__pyx_t_2 = NULL;
36579 1 : PyObject *__pyx_t_3 = NULL;
36580 1 : PyObject *__pyx_t_4 = NULL;
36581 1 : unsigned int __pyx_t_5;
36582 1 : PyObject *(*__pyx_t_6)(PyObject *);
36583 1 : PyArrayObject *__pyx_t_7 = NULL;
36584 1 : int __pyx_t_8;
36585 1 : PyObject *__pyx_t_9 = NULL;
36586 1 : PyObject *__pyx_t_10 = NULL;
36587 1 : PyObject *__pyx_t_11 = NULL;
36588 1 : PyArrayObject *__pyx_t_12 = NULL;
36589 1 : npy_intp __pyx_t_13[2];
36590 1 : PyArrayObject *__pyx_t_14 = NULL;
36591 1 : npy_intp __pyx_t_15[2];
36592 1 : PyArrayObject *__pyx_t_16 = NULL;
36593 1 : npy_intp __pyx_t_17[2];
36594 1 : PyArrayObject *__pyx_t_18 = NULL;
36595 1 : PyArrayObject *__pyx_t_19 = NULL;
36596 1 : int __pyx_t_20;
36597 1 : int __pyx_t_21;
36598 1 : Py_ssize_t __pyx_t_22;
36599 1 : Py_ssize_t __pyx_t_23;
36600 1 : npy_int64 __pyx_t_24;
36601 1 : PyArrayObject *__pyx_t_25 = NULL;
36602 1 : PyArrayObject *__pyx_t_26 = NULL;
36603 1 : PyArrayObject *__pyx_t_27 = NULL;
36604 1 : PyArrayObject *__pyx_t_28 = NULL;
36605 1 : PyObject *__pyx_t_29 = NULL;
36606 1 : PyObject *__pyx_t_30 = NULL;
36607 1 : PyObject *__pyx_t_31 = NULL;
36608 1 : PyArrayObject *__pyx_t_32 = NULL;
36609 1 : PyArrayObject *__pyx_t_33 = NULL;
36610 1 : PyArrayObject *__pyx_t_34 = NULL;
36611 1 : Py_ssize_t __pyx_t_35;
36612 1 : Py_ssize_t __pyx_t_36;
36613 1 : Py_ssize_t __pyx_t_37;
36614 1 : Py_ssize_t __pyx_t_38;
36615 1 : Py_ssize_t __pyx_t_39;
36616 1 : int __pyx_lineno = 0;
36617 1 : const char *__pyx_filename = NULL;
36618 1 : int __pyx_clineno = 0;
36619 1 : __Pyx_RefNannySetupContext("iddr_asvd", 1);
36620 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
36621 1 : __pyx_pybuffer_C.refcount = 0;
36622 1 : __pyx_pybuffernd_C.data = NULL;
36623 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
36624 1 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
36625 1 : __pyx_pybuffer_tau1.refcount = 0;
36626 1 : __pyx_pybuffernd_tau1.data = NULL;
36627 1 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
36628 1 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
36629 1 : __pyx_pybuffer_tau2.refcount = 0;
36630 1 : __pyx_pybuffernd_tau2.data = NULL;
36631 1 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
36632 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
36633 1 : __pyx_pybuffer_UU.refcount = 0;
36634 1 : __pyx_pybuffernd_UU.data = NULL;
36635 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
36636 1 : __pyx_pybuffer_S.pybuffer.buf = NULL;
36637 1 : __pyx_pybuffer_S.refcount = 0;
36638 1 : __pyx_pybuffernd_S.data = NULL;
36639 1 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
36640 1 : __pyx_pybuffer_V.pybuffer.buf = NULL;
36641 1 : __pyx_pybuffer_V.refcount = 0;
36642 1 : __pyx_pybuffernd_V.data = NULL;
36643 1 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
36644 1 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
36645 1 : __pyx_pybuffer_VV.refcount = 0;
36646 1 : __pyx_pybuffernd_VV.data = NULL;
36647 1 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
36648 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
36649 1 : __pyx_pybuffer_proj.refcount = 0;
36650 1 : __pyx_pybuffernd_proj.data = NULL;
36651 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
36652 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
36653 1 : __pyx_pybuffer_perms.refcount = 0;
36654 1 : __pyx_pybuffernd_perms.data = NULL;
36655 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
36656 1 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
36657 1 : __pyx_pybuffer_inds1.refcount = 0;
36658 1 : __pyx_pybuffernd_inds1.data = NULL;
36659 1 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
36660 1 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
36661 1 : __pyx_pybuffer_inds2.refcount = 0;
36662 1 : __pyx_pybuffernd_inds2.data = NULL;
36663 1 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
36664 1 : __pyx_pybuffer_p.pybuffer.buf = NULL;
36665 1 : __pyx_pybuffer_p.refcount = 0;
36666 1 : __pyx_pybuffernd_p.data = NULL;
36667 1 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
36668 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
36669 1 : __pyx_pybuffer_col.refcount = 0;
36670 1 : __pyx_pybuffernd_col.data = NULL;
36671 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
36672 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
36673 1 : __pyx_pybuffer_a.refcount = 0;
36674 1 : __pyx_pybuffernd_a.data = NULL;
36675 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
36676 : {
36677 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36678 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 888, __pyx_L1_error)
36679 : }
36680 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
36681 :
36682 : /* "scipy/linalg/_decomp_interpolative.pyx":890
36683 : * def iddr_asvd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *,
36684 : * rng):
36685 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
36686 : * cdef int info, ci
36687 : * cdef cnp.ndarray[cnp.float64_t, mode='fortran', ndim=2] C
36688 : */
36689 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
36690 1 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
36691 :
36692 : /* "scipy/linalg/_decomp_interpolative.pyx":906
36693 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] col
36694 : *
36695 : * perms, proj = iddr_aid(a.copy(), krank=krank, rng=rng) # <<<<<<<<<<<<<<
36696 : *
36697 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
36698 : */
36699 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_iddr_aid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
36700 1 : __Pyx_GOTREF(__pyx_t_1);
36701 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
36702 1 : __Pyx_GOTREF(__pyx_t_3);
36703 1 : __pyx_t_4 = NULL;
36704 1 : __pyx_t_5 = 0;
36705 : #if CYTHON_UNPACK_METHODS
36706 1 : if (likely(PyMethod_Check(__pyx_t_3))) {
36707 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
36708 0 : if (likely(__pyx_t_4)) {
36709 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
36710 0 : __Pyx_INCREF(__pyx_t_4);
36711 0 : __Pyx_INCREF(function);
36712 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
36713 : __pyx_t_5 = 1;
36714 : }
36715 : }
36716 : #endif
36717 : {
36718 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
36719 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
36720 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
36721 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
36722 1 : __Pyx_GOTREF(__pyx_t_2);
36723 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36724 : }
36725 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
36726 1 : __Pyx_GOTREF(__pyx_t_3);
36727 1 : __Pyx_GIVEREF(__pyx_t_2);
36728 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error);
36729 1 : __pyx_t_2 = 0;
36730 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
36731 1 : __Pyx_GOTREF(__pyx_t_2);
36732 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
36733 1 : __Pyx_GOTREF(__pyx_t_4);
36734 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_krank, __pyx_t_4) < 0) __PYX_ERR(0, 906, __pyx_L1_error)
36735 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36736 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 906, __pyx_L1_error)
36737 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
36738 1 : __Pyx_GOTREF(__pyx_t_4);
36739 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36740 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36741 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36742 1 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
36743 1 : PyObject* sequence = __pyx_t_4;
36744 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36745 1 : if (unlikely(size != 2)) {
36746 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36747 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36748 0 : __PYX_ERR(0, 906, __pyx_L1_error)
36749 : }
36750 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36751 1 : if (likely(PyTuple_CheckExact(sequence))) {
36752 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
36753 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
36754 : } else {
36755 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
36756 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
36757 : }
36758 1 : __Pyx_INCREF(__pyx_t_2);
36759 1 : __Pyx_INCREF(__pyx_t_3);
36760 : #else
36761 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
36762 : __Pyx_GOTREF(__pyx_t_2);
36763 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
36764 : __Pyx_GOTREF(__pyx_t_3);
36765 : #endif
36766 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36767 : } else {
36768 0 : Py_ssize_t index = -1;
36769 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
36770 0 : __Pyx_GOTREF(__pyx_t_1);
36771 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36772 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
36773 0 : index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
36774 0 : __Pyx_GOTREF(__pyx_t_2);
36775 0 : index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
36776 0 : __Pyx_GOTREF(__pyx_t_3);
36777 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 906, __pyx_L1_error)
36778 0 : __pyx_t_6 = NULL;
36779 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36780 0 : goto __pyx_L4_unpacking_done;
36781 0 : __pyx_L3_unpacking_failed:;
36782 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36783 0 : __pyx_t_6 = NULL;
36784 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
36785 0 : __PYX_ERR(0, 906, __pyx_L1_error)
36786 0 : __pyx_L4_unpacking_done:;
36787 : }
36788 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 906, __pyx_L1_error)
36789 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 906, __pyx_L1_error)
36790 1 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
36791 : {
36792 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36793 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
36794 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
36795 1 : if (unlikely(__pyx_t_8 < 0)) {
36796 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
36797 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
36798 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
36799 : __Pyx_RaiseBufferFallbackError();
36800 : } else {
36801 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
36802 : }
36803 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
36804 : }
36805 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
36806 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 906, __pyx_L1_error)
36807 : }
36808 1 : __pyx_t_7 = 0;
36809 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_2);
36810 1 : __pyx_t_2 = 0;
36811 1 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
36812 : {
36813 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36814 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
36815 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
36816 1 : if (unlikely(__pyx_t_8 < 0)) {
36817 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
36818 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
36819 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
36820 : __Pyx_RaiseBufferFallbackError();
36821 : } else {
36822 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
36823 : }
36824 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
36825 : }
36826 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
36827 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 906, __pyx_L1_error)
36828 : }
36829 1 : __pyx_t_12 = 0;
36830 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_3);
36831 1 : __pyx_t_3 = 0;
36832 :
36833 : /* "scipy/linalg/_decomp_interpolative.pyx":908
36834 : * perms, proj = iddr_aid(a.copy(), krank=krank, rng=rng)
36835 : *
36836 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
36837 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
36838 : *
36839 : */
36840 1 : __pyx_t_13[0] = __pyx_v_m;
36841 1 : __pyx_t_13[1] = __pyx_v_krank;
36842 1 : __pyx_t_4 = PyArray_ZEROS(2, __pyx_t_13, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error)
36843 1 : __Pyx_GOTREF(__pyx_t_4);
36844 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 908, __pyx_L1_error)
36845 1 : __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
36846 : {
36847 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36848 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
36849 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
36850 1 : if (unlikely(__pyx_t_8 < 0)) {
36851 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
36852 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
36853 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
36854 : __Pyx_RaiseBufferFallbackError();
36855 : } else {
36856 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
36857 : }
36858 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
36859 : }
36860 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
36861 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 908, __pyx_L1_error)
36862 : }
36863 1 : __pyx_t_14 = 0;
36864 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_4);
36865 1 : __pyx_t_4 = 0;
36866 :
36867 : /* "scipy/linalg/_decomp_interpolative.pyx":909
36868 : *
36869 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_FLOAT64, 0)
36870 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
36871 : *
36872 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
36873 : */
36874 1 : __pyx_t_15[0] = __pyx_v_n;
36875 1 : __pyx_t_15[1] = __pyx_v_krank;
36876 1 : __pyx_t_4 = PyArray_ZEROS(2, __pyx_t_15, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error)
36877 1 : __Pyx_GOTREF(__pyx_t_4);
36878 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 909, __pyx_L1_error)
36879 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_4);
36880 : {
36881 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36882 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
36883 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
36884 1 : if (unlikely(__pyx_t_8 < 0)) {
36885 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
36886 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
36887 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
36888 : __Pyx_RaiseBufferFallbackError();
36889 : } else {
36890 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
36891 : }
36892 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
36893 : }
36894 1 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
36895 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 909, __pyx_L1_error)
36896 : }
36897 1 : __pyx_t_16 = 0;
36898 1 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_4);
36899 1 : __pyx_t_4 = 0;
36900 :
36901 : /* "scipy/linalg/_decomp_interpolative.pyx":911
36902 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_FLOAT64, 0)
36903 : *
36904 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
36905 : * col = a[:, perms[:krank]].copy()
36906 : *
36907 : */
36908 1 : __pyx_t_17[0] = __pyx_v_krank;
36909 1 : __pyx_t_17[1] = __pyx_v_n;
36910 1 : __pyx_t_4 = PyArray_ZEROS(2, __pyx_t_17, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L1_error)
36911 1 : __Pyx_GOTREF(__pyx_t_4);
36912 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 911, __pyx_L1_error)
36913 1 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_4);
36914 : {
36915 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36916 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
36917 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
36918 1 : if (unlikely(__pyx_t_8 < 0)) {
36919 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
36920 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
36921 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
36922 : __Pyx_RaiseBufferFallbackError();
36923 : } else {
36924 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
36925 : }
36926 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
36927 : }
36928 1 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
36929 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 911, __pyx_L1_error)
36930 : }
36931 1 : __pyx_t_18 = 0;
36932 1 : __pyx_v_p = ((PyArrayObject *)__pyx_t_4);
36933 1 : __pyx_t_4 = 0;
36934 :
36935 : /* "scipy/linalg/_decomp_interpolative.pyx":912
36936 : *
36937 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_FLOAT64, 0)
36938 : * col = a[:, perms[:krank]].copy() # <<<<<<<<<<<<<<
36939 : *
36940 : * # idd_reconint
36941 : */
36942 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
36943 1 : __Pyx_GOTREF(__pyx_t_3);
36944 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
36945 1 : __Pyx_GOTREF(__pyx_t_2);
36946 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36947 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
36948 1 : __Pyx_GOTREF(__pyx_t_3);
36949 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36950 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
36951 1 : __Pyx_GOTREF(__pyx_t_2);
36952 1 : __Pyx_INCREF(__pyx_slice__5);
36953 1 : __Pyx_GIVEREF(__pyx_slice__5);
36954 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 912, __pyx_L1_error);
36955 1 : __Pyx_GIVEREF(__pyx_t_3);
36956 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error);
36957 1 : __pyx_t_3 = 0;
36958 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
36959 1 : __Pyx_GOTREF(__pyx_t_3);
36960 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36961 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
36962 1 : __Pyx_GOTREF(__pyx_t_2);
36963 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36964 1 : __pyx_t_3 = NULL;
36965 1 : __pyx_t_5 = 0;
36966 : #if CYTHON_UNPACK_METHODS
36967 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
36968 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
36969 0 : if (likely(__pyx_t_3)) {
36970 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
36971 0 : __Pyx_INCREF(__pyx_t_3);
36972 0 : __Pyx_INCREF(function);
36973 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
36974 : __pyx_t_5 = 1;
36975 : }
36976 : }
36977 : #endif
36978 : {
36979 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
36980 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
36981 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
36982 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
36983 1 : __Pyx_GOTREF(__pyx_t_4);
36984 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36985 : }
36986 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 912, __pyx_L1_error)
36987 1 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_4);
36988 : {
36989 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
36990 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
36991 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
36992 1 : if (unlikely(__pyx_t_8 < 0)) {
36993 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
36994 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
36995 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
36996 : __Pyx_RaiseBufferFallbackError();
36997 : } else {
36998 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
36999 : }
37000 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
37001 : }
37002 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
37003 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 912, __pyx_L1_error)
37004 : }
37005 1 : __pyx_t_19 = 0;
37006 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_4);
37007 1 : __pyx_t_4 = 0;
37008 :
37009 : /* "scipy/linalg/_decomp_interpolative.pyx":915
37010 : *
37011 : * # idd_reconint
37012 : * for ci in range(krank): # <<<<<<<<<<<<<<
37013 : * p[ci, perms[ci]] = 1.0
37014 : *
37015 : */
37016 1 : __pyx_t_8 = __pyx_v_krank;
37017 1 : __pyx_t_20 = __pyx_t_8;
37018 21 : for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
37019 20 : __pyx_v_ci = __pyx_t_21;
37020 :
37021 : /* "scipy/linalg/_decomp_interpolative.pyx":916
37022 : * # idd_reconint
37023 : * for ci in range(krank):
37024 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
37025 : *
37026 : * p[:, perms[krank:]] = proj[:, :]
37027 : */
37028 20 : __pyx_t_22 = __pyx_v_ci;
37029 20 : __pyx_t_23 = __pyx_v_ci;
37030 20 : __pyx_t_24 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_perms.diminfo[0].strides));
37031 20 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_p.diminfo[1].strides) = 1.0;
37032 : }
37033 :
37034 : /* "scipy/linalg/_decomp_interpolative.pyx":918
37035 : * p[ci, perms[ci]] = 1.0
37036 : *
37037 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
37038 : *
37039 : * inds1, tau1 = iddr_qrpiv(col, krank)
37040 : */
37041 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
37042 1 : __Pyx_GOTREF(__pyx_t_4);
37043 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error)
37044 1 : __Pyx_GOTREF(__pyx_t_2);
37045 1 : __pyx_t_3 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
37046 1 : __Pyx_GOTREF(__pyx_t_3);
37047 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37048 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error)
37049 1 : __Pyx_GOTREF(__pyx_t_2);
37050 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37051 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
37052 1 : __Pyx_GOTREF(__pyx_t_3);
37053 1 : __Pyx_INCREF(__pyx_slice__5);
37054 1 : __Pyx_GIVEREF(__pyx_slice__5);
37055 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 918, __pyx_L1_error);
37056 1 : __Pyx_GIVEREF(__pyx_t_2);
37057 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error);
37058 1 : __pyx_t_2 = 0;
37059 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_3, __pyx_t_4) < 0))) __PYX_ERR(0, 918, __pyx_L1_error)
37060 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37061 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37062 :
37063 : /* "scipy/linalg/_decomp_interpolative.pyx":920
37064 : * p[:, perms[krank:]] = proj[:, :]
37065 : *
37066 : * inds1, tau1 = iddr_qrpiv(col, krank) # <<<<<<<<<<<<<<
37067 : * # idd_rinqr and idd_rearr
37068 : * r = np.triu(col[:krank, :])
37069 : */
37070 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
37071 1 : __Pyx_GOTREF(__pyx_t_3);
37072 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
37073 1 : __Pyx_GOTREF(__pyx_t_2);
37074 1 : __pyx_t_1 = NULL;
37075 1 : __pyx_t_5 = 0;
37076 : #if CYTHON_UNPACK_METHODS
37077 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
37078 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
37079 0 : if (likely(__pyx_t_1)) {
37080 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
37081 0 : __Pyx_INCREF(__pyx_t_1);
37082 0 : __Pyx_INCREF(function);
37083 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
37084 : __pyx_t_5 = 1;
37085 : }
37086 : }
37087 : #endif
37088 : {
37089 1 : PyObject *__pyx_callargs[3] = {__pyx_t_1, ((PyObject *)__pyx_v_col), __pyx_t_2};
37090 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
37091 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
37092 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37093 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 920, __pyx_L1_error)
37094 1 : __Pyx_GOTREF(__pyx_t_4);
37095 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37096 : }
37097 1 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
37098 1 : PyObject* sequence = __pyx_t_4;
37099 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
37100 1 : if (unlikely(size != 2)) {
37101 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
37102 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
37103 0 : __PYX_ERR(0, 920, __pyx_L1_error)
37104 : }
37105 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37106 1 : if (likely(PyTuple_CheckExact(sequence))) {
37107 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
37108 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
37109 : } else {
37110 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
37111 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
37112 : }
37113 1 : __Pyx_INCREF(__pyx_t_3);
37114 1 : __Pyx_INCREF(__pyx_t_2);
37115 : #else
37116 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
37117 : __Pyx_GOTREF(__pyx_t_3);
37118 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
37119 : __Pyx_GOTREF(__pyx_t_2);
37120 : #endif
37121 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37122 : } else {
37123 0 : Py_ssize_t index = -1;
37124 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
37125 0 : __Pyx_GOTREF(__pyx_t_1);
37126 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37127 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
37128 0 : index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
37129 0 : __Pyx_GOTREF(__pyx_t_3);
37130 0 : index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
37131 0 : __Pyx_GOTREF(__pyx_t_2);
37132 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
37133 0 : __pyx_t_6 = NULL;
37134 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37135 0 : goto __pyx_L8_unpacking_done;
37136 0 : __pyx_L7_unpacking_failed:;
37137 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37138 0 : __pyx_t_6 = NULL;
37139 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
37140 0 : __PYX_ERR(0, 920, __pyx_L1_error)
37141 0 : __pyx_L8_unpacking_done:;
37142 : }
37143 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 920, __pyx_L1_error)
37144 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 920, __pyx_L1_error)
37145 1 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_3);
37146 : {
37147 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37148 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
37149 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
37150 1 : if (unlikely(__pyx_t_8 < 0)) {
37151 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
37152 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
37153 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
37154 : __Pyx_RaiseBufferFallbackError();
37155 : } else {
37156 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
37157 : }
37158 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
37159 : }
37160 1 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
37161 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 920, __pyx_L1_error)
37162 : }
37163 1 : __pyx_t_25 = 0;
37164 1 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_3);
37165 1 : __pyx_t_3 = 0;
37166 1 : __pyx_t_26 = ((PyArrayObject *)__pyx_t_2);
37167 : {
37168 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37169 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
37170 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
37171 1 : if (unlikely(__pyx_t_8 < 0)) {
37172 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
37173 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
37174 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
37175 : __Pyx_RaiseBufferFallbackError();
37176 : } else {
37177 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
37178 : }
37179 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
37180 : }
37181 1 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
37182 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 920, __pyx_L1_error)
37183 : }
37184 1 : __pyx_t_26 = 0;
37185 1 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_2);
37186 1 : __pyx_t_2 = 0;
37187 :
37188 : /* "scipy/linalg/_decomp_interpolative.pyx":922
37189 : * inds1, tau1 = iddr_qrpiv(col, krank)
37190 : * # idd_rinqr and idd_rearr
37191 : * r = np.triu(col[:krank, :]) # <<<<<<<<<<<<<<
37192 : * for ci in range(krank-1, -1, -1):
37193 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
37194 : */
37195 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
37196 1 : __Pyx_GOTREF(__pyx_t_2);
37197 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_triu); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error)
37198 1 : __Pyx_GOTREF(__pyx_t_3);
37199 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37200 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
37201 1 : __Pyx_GOTREF(__pyx_t_2);
37202 1 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
37203 1 : __Pyx_GOTREF(__pyx_t_1);
37204 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37205 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
37206 1 : __Pyx_GOTREF(__pyx_t_2);
37207 1 : __Pyx_GIVEREF(__pyx_t_1);
37208 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error);
37209 1 : __Pyx_INCREF(__pyx_slice__5);
37210 1 : __Pyx_GIVEREF(__pyx_slice__5);
37211 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 922, __pyx_L1_error);
37212 1 : __pyx_t_1 = 0;
37213 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
37214 1 : __Pyx_GOTREF(__pyx_t_1);
37215 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37216 1 : __pyx_t_2 = NULL;
37217 1 : __pyx_t_5 = 0;
37218 : #if CYTHON_UNPACK_METHODS
37219 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
37220 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
37221 0 : if (likely(__pyx_t_2)) {
37222 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
37223 0 : __Pyx_INCREF(__pyx_t_2);
37224 0 : __Pyx_INCREF(function);
37225 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
37226 : __pyx_t_5 = 1;
37227 : }
37228 : }
37229 : #endif
37230 : {
37231 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
37232 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
37233 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37234 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37235 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error)
37236 1 : __Pyx_GOTREF(__pyx_t_4);
37237 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37238 : }
37239 1 : __pyx_v_r = __pyx_t_4;
37240 1 : __pyx_t_4 = 0;
37241 :
37242 : /* "scipy/linalg/_decomp_interpolative.pyx":923
37243 : * # idd_rinqr and idd_rearr
37244 : * r = np.triu(col[:krank, :])
37245 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
37246 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
37247 : *
37248 : */
37249 21 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
37250 20 : __pyx_v_ci = __pyx_t_8;
37251 :
37252 : /* "scipy/linalg/_decomp_interpolative.pyx":924
37253 : * r = np.triu(col[:krank, :])
37254 : * for ci in range(krank-1, -1, -1):
37255 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
37256 : *
37257 : * t = p.T.copy()
37258 : */
37259 20 : __pyx_t_22 = __pyx_v_ci;
37260 20 : __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
37261 20 : __Pyx_GOTREF(__pyx_t_4);
37262 20 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
37263 20 : __Pyx_GOTREF(__pyx_t_3);
37264 20 : __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
37265 20 : __Pyx_GOTREF(__pyx_t_1);
37266 20 : __Pyx_GIVEREF(__pyx_t_4);
37267 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error);
37268 20 : __Pyx_GIVEREF(__pyx_t_3);
37269 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error);
37270 20 : __pyx_t_4 = 0;
37271 20 : __pyx_t_3 = 0;
37272 20 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
37273 20 : __Pyx_GOTREF(__pyx_t_3);
37274 20 : __Pyx_INCREF(__pyx_slice__5);
37275 20 : __Pyx_GIVEREF(__pyx_slice__5);
37276 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 924, __pyx_L1_error);
37277 20 : __Pyx_GIVEREF(__pyx_t_1);
37278 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error);
37279 20 : __pyx_t_1 = 0;
37280 20 : __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
37281 20 : __Pyx_GOTREF(__pyx_t_1);
37282 20 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37283 20 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
37284 20 : __Pyx_GOTREF(__pyx_t_3);
37285 20 : __pyx_t_22 = __pyx_v_ci;
37286 20 : __pyx_t_4 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
37287 20 : __Pyx_GOTREF(__pyx_t_4);
37288 20 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
37289 20 : __Pyx_GOTREF(__pyx_t_2);
37290 20 : __Pyx_GIVEREF(__pyx_t_3);
37291 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error);
37292 20 : __Pyx_GIVEREF(__pyx_t_4);
37293 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error);
37294 20 : __pyx_t_3 = 0;
37295 20 : __pyx_t_4 = 0;
37296 20 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error)
37297 20 : __Pyx_GOTREF(__pyx_t_4);
37298 20 : __Pyx_INCREF(__pyx_slice__5);
37299 20 : __Pyx_GIVEREF(__pyx_slice__5);
37300 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 924, __pyx_L1_error);
37301 20 : __Pyx_GIVEREF(__pyx_t_2);
37302 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error);
37303 20 : __pyx_t_2 = 0;
37304 20 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(0, 924, __pyx_L1_error)
37305 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37306 40 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37307 : }
37308 :
37309 : /* "scipy/linalg/_decomp_interpolative.pyx":926
37310 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
37311 : *
37312 : * t = p.T.copy() # <<<<<<<<<<<<<<
37313 : * inds2, tau2 = iddr_qrpiv(t, krank)
37314 : * r2 = np.triu(t[:krank, :])
37315 : */
37316 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error)
37317 1 : __Pyx_GOTREF(__pyx_t_4);
37318 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
37319 1 : __Pyx_GOTREF(__pyx_t_2);
37320 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37321 1 : __pyx_t_4 = NULL;
37322 1 : __pyx_t_5 = 0;
37323 : #if CYTHON_UNPACK_METHODS
37324 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
37325 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
37326 0 : if (likely(__pyx_t_4)) {
37327 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
37328 0 : __Pyx_INCREF(__pyx_t_4);
37329 0 : __Pyx_INCREF(function);
37330 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
37331 : __pyx_t_5 = 1;
37332 : }
37333 : }
37334 : #endif
37335 : {
37336 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
37337 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
37338 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
37339 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
37340 1 : __Pyx_GOTREF(__pyx_t_1);
37341 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37342 : }
37343 1 : __pyx_v_t = __pyx_t_1;
37344 1 : __pyx_t_1 = 0;
37345 :
37346 : /* "scipy/linalg/_decomp_interpolative.pyx":927
37347 : *
37348 : * t = p.T.copy()
37349 : * inds2, tau2 = iddr_qrpiv(t, krank) # <<<<<<<<<<<<<<
37350 : * r2 = np.triu(t[:krank, :])
37351 : * for ci in range(krank-1, -1, -1):
37352 : */
37353 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
37354 1 : __Pyx_GOTREF(__pyx_t_2);
37355 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
37356 1 : __Pyx_GOTREF(__pyx_t_4);
37357 1 : __pyx_t_3 = NULL;
37358 1 : __pyx_t_5 = 0;
37359 : #if CYTHON_UNPACK_METHODS
37360 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
37361 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
37362 0 : if (likely(__pyx_t_3)) {
37363 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
37364 0 : __Pyx_INCREF(__pyx_t_3);
37365 0 : __Pyx_INCREF(function);
37366 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
37367 : __pyx_t_5 = 1;
37368 : }
37369 : }
37370 : #endif
37371 : {
37372 1 : PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_t, __pyx_t_4};
37373 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
37374 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
37375 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37376 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
37377 1 : __Pyx_GOTREF(__pyx_t_1);
37378 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37379 : }
37380 1 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
37381 1 : PyObject* sequence = __pyx_t_1;
37382 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
37383 1 : if (unlikely(size != 2)) {
37384 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
37385 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
37386 0 : __PYX_ERR(0, 927, __pyx_L1_error)
37387 : }
37388 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37389 1 : if (likely(PyTuple_CheckExact(sequence))) {
37390 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
37391 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
37392 : } else {
37393 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
37394 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
37395 : }
37396 1 : __Pyx_INCREF(__pyx_t_2);
37397 1 : __Pyx_INCREF(__pyx_t_4);
37398 : #else
37399 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
37400 : __Pyx_GOTREF(__pyx_t_2);
37401 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
37402 : __Pyx_GOTREF(__pyx_t_4);
37403 : #endif
37404 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37405 : } else {
37406 0 : Py_ssize_t index = -1;
37407 0 : __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L1_error)
37408 0 : __Pyx_GOTREF(__pyx_t_3);
37409 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37410 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
37411 0 : index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
37412 0 : __Pyx_GOTREF(__pyx_t_2);
37413 0 : index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
37414 0 : __Pyx_GOTREF(__pyx_t_4);
37415 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
37416 0 : __pyx_t_6 = NULL;
37417 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37418 0 : goto __pyx_L12_unpacking_done;
37419 0 : __pyx_L11_unpacking_failed:;
37420 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37421 0 : __pyx_t_6 = NULL;
37422 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
37423 0 : __PYX_ERR(0, 927, __pyx_L1_error)
37424 0 : __pyx_L12_unpacking_done:;
37425 : }
37426 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 927, __pyx_L1_error)
37427 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 927, __pyx_L1_error)
37428 1 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_2);
37429 : {
37430 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37431 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
37432 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
37433 1 : if (unlikely(__pyx_t_8 < 0)) {
37434 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
37435 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
37436 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
37437 : __Pyx_RaiseBufferFallbackError();
37438 : } else {
37439 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
37440 : }
37441 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
37442 : }
37443 1 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
37444 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 927, __pyx_L1_error)
37445 : }
37446 1 : __pyx_t_27 = 0;
37447 1 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_2);
37448 1 : __pyx_t_2 = 0;
37449 1 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_4);
37450 : {
37451 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37452 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
37453 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
37454 1 : if (unlikely(__pyx_t_8 < 0)) {
37455 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
37456 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
37457 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
37458 : __Pyx_RaiseBufferFallbackError();
37459 : } else {
37460 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
37461 : }
37462 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
37463 : }
37464 1 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
37465 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 927, __pyx_L1_error)
37466 : }
37467 1 : __pyx_t_28 = 0;
37468 1 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_4);
37469 1 : __pyx_t_4 = 0;
37470 :
37471 : /* "scipy/linalg/_decomp_interpolative.pyx":928
37472 : * t = p.T.copy()
37473 : * inds2, tau2 = iddr_qrpiv(t, krank)
37474 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
37475 : * for ci in range(krank-1, -1, -1):
37476 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
37477 : */
37478 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
37479 1 : __Pyx_GOTREF(__pyx_t_4);
37480 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_triu); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error)
37481 1 : __Pyx_GOTREF(__pyx_t_2);
37482 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37483 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
37484 1 : __Pyx_GOTREF(__pyx_t_4);
37485 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
37486 1 : __Pyx_GOTREF(__pyx_t_3);
37487 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37488 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
37489 1 : __Pyx_GOTREF(__pyx_t_4);
37490 1 : __Pyx_GIVEREF(__pyx_t_3);
37491 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error);
37492 1 : __Pyx_INCREF(__pyx_slice__5);
37493 1 : __Pyx_GIVEREF(__pyx_slice__5);
37494 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 928, __pyx_L1_error);
37495 1 : __pyx_t_3 = 0;
37496 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
37497 1 : __Pyx_GOTREF(__pyx_t_3);
37498 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37499 1 : __pyx_t_4 = NULL;
37500 1 : __pyx_t_5 = 0;
37501 : #if CYTHON_UNPACK_METHODS
37502 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
37503 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
37504 0 : if (likely(__pyx_t_4)) {
37505 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
37506 0 : __Pyx_INCREF(__pyx_t_4);
37507 0 : __Pyx_INCREF(function);
37508 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
37509 : __pyx_t_5 = 1;
37510 : }
37511 : }
37512 : #endif
37513 : {
37514 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
37515 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
37516 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
37517 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37518 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
37519 1 : __Pyx_GOTREF(__pyx_t_1);
37520 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37521 : }
37522 1 : __pyx_v_r2 = __pyx_t_1;
37523 1 : __pyx_t_1 = 0;
37524 :
37525 : /* "scipy/linalg/_decomp_interpolative.pyx":929
37526 : * inds2, tau2 = iddr_qrpiv(t, krank)
37527 : * r2 = np.triu(t[:krank, :])
37528 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
37529 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
37530 : *
37531 : */
37532 21 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
37533 20 : __pyx_v_ci = __pyx_t_8;
37534 :
37535 : /* "scipy/linalg/_decomp_interpolative.pyx":930
37536 : * r2 = np.triu(t[:krank, :])
37537 : * for ci in range(krank-1, -1, -1):
37538 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
37539 : *
37540 : * r3 = r @ r2.T
37541 : */
37542 20 : __pyx_t_22 = __pyx_v_ci;
37543 20 : __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
37544 20 : __Pyx_GOTREF(__pyx_t_1);
37545 20 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
37546 20 : __Pyx_GOTREF(__pyx_t_2);
37547 20 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error)
37548 20 : __Pyx_GOTREF(__pyx_t_3);
37549 20 : __Pyx_GIVEREF(__pyx_t_1);
37550 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error);
37551 20 : __Pyx_GIVEREF(__pyx_t_2);
37552 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error);
37553 20 : __pyx_t_1 = 0;
37554 20 : __pyx_t_2 = 0;
37555 20 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
37556 20 : __Pyx_GOTREF(__pyx_t_2);
37557 20 : __Pyx_INCREF(__pyx_slice__5);
37558 20 : __Pyx_GIVEREF(__pyx_slice__5);
37559 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 930, __pyx_L1_error);
37560 20 : __Pyx_GIVEREF(__pyx_t_3);
37561 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error);
37562 20 : __pyx_t_3 = 0;
37563 20 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error)
37564 20 : __Pyx_GOTREF(__pyx_t_3);
37565 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37566 20 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
37567 20 : __Pyx_GOTREF(__pyx_t_2);
37568 20 : __pyx_t_22 = __pyx_v_ci;
37569 20 : __pyx_t_1 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
37570 20 : __Pyx_GOTREF(__pyx_t_1);
37571 20 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
37572 20 : __Pyx_GOTREF(__pyx_t_4);
37573 20 : __Pyx_GIVEREF(__pyx_t_2);
37574 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error);
37575 20 : __Pyx_GIVEREF(__pyx_t_1);
37576 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error);
37577 20 : __pyx_t_2 = 0;
37578 20 : __pyx_t_1 = 0;
37579 20 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
37580 20 : __Pyx_GOTREF(__pyx_t_1);
37581 20 : __Pyx_INCREF(__pyx_slice__5);
37582 20 : __Pyx_GIVEREF(__pyx_slice__5);
37583 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 930, __pyx_L1_error);
37584 20 : __Pyx_GIVEREF(__pyx_t_4);
37585 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error);
37586 20 : __pyx_t_4 = 0;
37587 20 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_1, __pyx_t_3) < 0))) __PYX_ERR(0, 930, __pyx_L1_error)
37588 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37589 40 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37590 : }
37591 :
37592 : /* "scipy/linalg/_decomp_interpolative.pyx":932
37593 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
37594 : *
37595 : * r3 = r @ r2.T # <<<<<<<<<<<<<<
37596 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False)
37597 : *
37598 : */
37599 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error)
37600 1 : __Pyx_GOTREF(__pyx_t_3);
37601 1 : __pyx_t_1 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
37602 1 : __Pyx_GOTREF(__pyx_t_1);
37603 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37604 1 : __pyx_v_r3 = __pyx_t_1;
37605 1 : __pyx_t_1 = 0;
37606 :
37607 : /* "scipy/linalg/_decomp_interpolative.pyx":933
37608 : *
37609 : * r3 = r @ r2.T
37610 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False) # <<<<<<<<<<<<<<
37611 : *
37612 : * # Apply Q of col to U from the left
37613 : */
37614 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_la); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error)
37615 1 : __Pyx_GOTREF(__pyx_t_1);
37616 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_svd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
37617 1 : __Pyx_GOTREF(__pyx_t_3);
37618 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37619 1 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error)
37620 1 : __Pyx_GOTREF(__pyx_t_1);
37621 1 : __Pyx_INCREF(__pyx_v_r3);
37622 1 : __Pyx_GIVEREF(__pyx_v_r3);
37623 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_r3)) __PYX_ERR(0, 933, __pyx_L1_error);
37624 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
37625 1 : __Pyx_GOTREF(__pyx_t_4);
37626 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 933, __pyx_L1_error)
37627 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error)
37628 1 : __Pyx_GOTREF(__pyx_t_2);
37629 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37630 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37631 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37632 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
37633 1 : PyObject* sequence = __pyx_t_2;
37634 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
37635 1 : if (unlikely(size != 3)) {
37636 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
37637 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
37638 0 : __PYX_ERR(0, 933, __pyx_L1_error)
37639 : }
37640 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37641 1 : if (likely(PyTuple_CheckExact(sequence))) {
37642 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
37643 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
37644 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
37645 : } else {
37646 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
37647 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
37648 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
37649 : }
37650 1 : __Pyx_INCREF(__pyx_t_4);
37651 1 : __Pyx_INCREF(__pyx_t_1);
37652 1 : __Pyx_INCREF(__pyx_t_3);
37653 : #else
37654 : __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
37655 : __Pyx_GOTREF(__pyx_t_4);
37656 : __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error)
37657 : __Pyx_GOTREF(__pyx_t_1);
37658 : __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
37659 : __Pyx_GOTREF(__pyx_t_3);
37660 : #endif
37661 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37662 : } else {
37663 0 : Py_ssize_t index = -1;
37664 0 : __pyx_t_29 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 933, __pyx_L1_error)
37665 0 : __Pyx_GOTREF(__pyx_t_29);
37666 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37667 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_29);
37668 0 : index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_29); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed;
37669 0 : __Pyx_GOTREF(__pyx_t_4);
37670 0 : index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_29); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
37671 0 : __Pyx_GOTREF(__pyx_t_1);
37672 0 : index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_29); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
37673 0 : __Pyx_GOTREF(__pyx_t_3);
37674 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_29), 3) < 0) __PYX_ERR(0, 933, __pyx_L1_error)
37675 0 : __pyx_t_6 = NULL;
37676 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
37677 0 : goto __pyx_L16_unpacking_done;
37678 0 : __pyx_L15_unpacking_failed:;
37679 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
37680 0 : __pyx_t_6 = NULL;
37681 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
37682 0 : __PYX_ERR(0, 933, __pyx_L1_error)
37683 0 : __pyx_L16_unpacking_done:;
37684 : }
37685 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 933, __pyx_L1_error)
37686 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 933, __pyx_L1_error)
37687 1 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 933, __pyx_L1_error)
37688 1 : __Pyx_GOTREF(__pyx_t_29);
37689 1 : __pyx_t_30 = PySlice_New(Py_None, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 933, __pyx_L1_error)
37690 1 : __Pyx_GOTREF(__pyx_t_30);
37691 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
37692 1 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 933, __pyx_L1_error)
37693 1 : __Pyx_GOTREF(__pyx_t_29);
37694 1 : __pyx_t_31 = PySlice_New(Py_None, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 933, __pyx_L1_error)
37695 1 : __Pyx_GOTREF(__pyx_t_31);
37696 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
37697 1 : __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 933, __pyx_L1_error)
37698 1 : __Pyx_GOTREF(__pyx_t_29);
37699 1 : __Pyx_GIVEREF(__pyx_t_30);
37700 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_30)) __PYX_ERR(0, 933, __pyx_L1_error);
37701 1 : __Pyx_GIVEREF(__pyx_t_31);
37702 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_31)) __PYX_ERR(0, 933, __pyx_L1_error);
37703 1 : __pyx_t_30 = 0;
37704 1 : __pyx_t_31 = 0;
37705 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_29, __pyx_t_4) < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
37706 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
37707 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37708 1 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_1);
37709 : {
37710 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37711 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
37712 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
37713 1 : if (unlikely(__pyx_t_8 < 0)) {
37714 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
37715 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
37716 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
37717 : __Pyx_RaiseBufferFallbackError();
37718 : } else {
37719 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
37720 : }
37721 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
37722 : }
37723 1 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
37724 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
37725 : }
37726 1 : __pyx_t_32 = 0;
37727 1 : __pyx_v_S = ((PyArrayObject *)__pyx_t_1);
37728 1 : __pyx_t_1 = 0;
37729 1 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_3);
37730 : {
37731 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37732 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
37733 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
37734 1 : if (unlikely(__pyx_t_8 < 0)) {
37735 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
37736 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
37737 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
37738 : __Pyx_RaiseBufferFallbackError();
37739 : } else {
37740 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
37741 : }
37742 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
37743 : }
37744 1 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
37745 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 933, __pyx_L1_error)
37746 : }
37747 1 : __pyx_t_33 = 0;
37748 1 : __pyx_v_V = ((PyArrayObject *)__pyx_t_3);
37749 1 : __pyx_t_3 = 0;
37750 :
37751 : /* "scipy/linalg/_decomp_interpolative.pyx":936
37752 : *
37753 : * # Apply Q of col to U from the left
37754 : * C = col[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
37755 : * dorm2r(<char*>'R', <char*>'T',
37756 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
37757 : */
37758 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
37759 1 : __Pyx_GOTREF(__pyx_t_2);
37760 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
37761 1 : __Pyx_GOTREF(__pyx_t_3);
37762 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37763 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
37764 1 : __Pyx_GOTREF(__pyx_t_2);
37765 1 : __Pyx_INCREF(__pyx_slice__5);
37766 1 : __Pyx_GIVEREF(__pyx_slice__5);
37767 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 936, __pyx_L1_error);
37768 1 : __Pyx_GIVEREF(__pyx_t_3);
37769 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error);
37770 1 : __pyx_t_3 = 0;
37771 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
37772 1 : __Pyx_GOTREF(__pyx_t_3);
37773 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37774 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
37775 1 : __Pyx_GOTREF(__pyx_t_2);
37776 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37777 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
37778 1 : __Pyx_GOTREF(__pyx_t_3);
37779 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 936, __pyx_L1_error)
37780 1 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
37781 1 : __Pyx_GOTREF(__pyx_t_1);
37782 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37783 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37784 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 936, __pyx_L1_error)
37785 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_1);
37786 : {
37787 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37788 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
37789 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
37790 1 : if (unlikely(__pyx_t_8 < 0)) {
37791 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
37792 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
37793 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
37794 : __Pyx_RaiseBufferFallbackError();
37795 : } else {
37796 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
37797 : }
37798 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
37799 : }
37800 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
37801 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 936, __pyx_L1_error)
37802 : }
37803 1 : __pyx_t_34 = 0;
37804 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_1);
37805 1 : __pyx_t_1 = 0;
37806 :
37807 : /* "scipy/linalg/_decomp_interpolative.pyx":938
37808 : * C = col[:, :krank].copy(order='F')
37809 : * dorm2r(<char*>'R', <char*>'T',
37810 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
37811 : * &UU[0,0], &krank, &a[0, 0], &info)
37812 : *
37813 : */
37814 1 : __pyx_t_22 = 0;
37815 1 : __pyx_t_23 = 0;
37816 1 : __pyx_t_35 = 0;
37817 :
37818 : /* "scipy/linalg/_decomp_interpolative.pyx":939
37819 : * dorm2r(<char*>'R', <char*>'T',
37820 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
37821 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
37822 : *
37823 : * VV[:krank, :krank] = V[:, :].T
37824 : */
37825 1 : __pyx_t_36 = 0;
37826 1 : __pyx_t_37 = 0;
37827 1 : __pyx_t_38 = 0;
37828 1 : __pyx_t_39 = 0;
37829 :
37830 : /* "scipy/linalg/_decomp_interpolative.pyx":937
37831 : * # Apply Q of col to U from the left
37832 : * C = col[:, :krank].copy(order='F')
37833 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
37834 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
37835 : * &UU[0,0], &krank, &a[0, 0], &info)
37836 : */
37837 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
37838 :
37839 : /* "scipy/linalg/_decomp_interpolative.pyx":941
37840 : * &UU[0,0], &krank, &a[0, 0], &info)
37841 : *
37842 : * VV[:krank, :krank] = V[:, :].T # <<<<<<<<<<<<<<
37843 : * # Apply Q of t to V from the left
37844 : * C = t[:, :krank].copy(order='F')
37845 : */
37846 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
37847 1 : __Pyx_GOTREF(__pyx_t_1);
37848 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error)
37849 1 : __Pyx_GOTREF(__pyx_t_3);
37850 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37851 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
37852 1 : __Pyx_GOTREF(__pyx_t_1);
37853 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error)
37854 1 : __Pyx_GOTREF(__pyx_t_2);
37855 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37856 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
37857 1 : __Pyx_GOTREF(__pyx_t_1);
37858 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 941, __pyx_L1_error)
37859 1 : __Pyx_GOTREF(__pyx_t_4);
37860 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37861 1 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
37862 1 : __Pyx_GOTREF(__pyx_t_1);
37863 1 : __Pyx_GIVEREF(__pyx_t_2);
37864 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error);
37865 1 : __Pyx_GIVEREF(__pyx_t_4);
37866 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 941, __pyx_L1_error);
37867 1 : __pyx_t_2 = 0;
37868 1 : __pyx_t_4 = 0;
37869 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_1, __pyx_t_3) < 0))) __PYX_ERR(0, 941, __pyx_L1_error)
37870 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37871 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37872 :
37873 : /* "scipy/linalg/_decomp_interpolative.pyx":943
37874 : * VV[:krank, :krank] = V[:, :].T
37875 : * # Apply Q of t to V from the left
37876 : * C = t[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
37877 : * dorm2r(<char*>'R', <char*>'T',
37878 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
37879 : */
37880 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
37881 1 : __Pyx_GOTREF(__pyx_t_3);
37882 1 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
37883 1 : __Pyx_GOTREF(__pyx_t_1);
37884 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37885 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
37886 1 : __Pyx_GOTREF(__pyx_t_3);
37887 1 : __Pyx_INCREF(__pyx_slice__5);
37888 1 : __Pyx_GIVEREF(__pyx_slice__5);
37889 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 943, __pyx_L1_error);
37890 1 : __Pyx_GIVEREF(__pyx_t_1);
37891 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error);
37892 1 : __pyx_t_1 = 0;
37893 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
37894 1 : __Pyx_GOTREF(__pyx_t_1);
37895 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37896 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
37897 1 : __Pyx_GOTREF(__pyx_t_3);
37898 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37899 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
37900 1 : __Pyx_GOTREF(__pyx_t_1);
37901 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
37902 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error)
37903 1 : __Pyx_GOTREF(__pyx_t_4);
37904 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37905 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37906 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 943, __pyx_L1_error)
37907 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_4);
37908 : {
37909 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
37910 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
37911 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
37912 1 : if (unlikely(__pyx_t_8 < 0)) {
37913 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
37914 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
37915 0 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
37916 0 : __Pyx_RaiseBufferFallbackError();
37917 : } else {
37918 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
37919 : }
37920 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
37921 : }
37922 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
37923 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 943, __pyx_L1_error)
37924 : }
37925 1 : __pyx_t_34 = 0;
37926 1 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_4));
37927 1 : __pyx_t_4 = 0;
37928 :
37929 : /* "scipy/linalg/_decomp_interpolative.pyx":945
37930 : * C = t[:, :krank].copy(order='F')
37931 : * dorm2r(<char*>'R', <char*>'T',
37932 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
37933 : * &VV[0, 0], &krank, &a[0, 0], &info)
37934 : *
37935 : */
37936 1 : __pyx_t_39 = 0;
37937 1 : __pyx_t_38 = 0;
37938 1 : __pyx_t_37 = 0;
37939 :
37940 : /* "scipy/linalg/_decomp_interpolative.pyx":946
37941 : * dorm2r(<char*>'R', <char*>'T',
37942 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
37943 : * &VV[0, 0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
37944 : *
37945 : * return UU, S, VV
37946 : */
37947 1 : __pyx_t_36 = 0;
37948 1 : __pyx_t_35 = 0;
37949 1 : __pyx_t_23 = 0;
37950 1 : __pyx_t_22 = 0;
37951 :
37952 : /* "scipy/linalg/_decomp_interpolative.pyx":944
37953 : * # Apply Q of t to V from the left
37954 : * C = t[:, :krank].copy(order='F')
37955 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
37956 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
37957 : * &VV[0, 0], &krank, &a[0, 0], &info)
37958 : */
37959 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
37960 :
37961 : /* "scipy/linalg/_decomp_interpolative.pyx":948
37962 : * &VV[0, 0], &krank, &a[0, 0], &info)
37963 : *
37964 : * return UU, S, VV # <<<<<<<<<<<<<<
37965 : *
37966 : *
37967 : */
37968 1 : __Pyx_XDECREF(__pyx_r);
37969 1 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error)
37970 1 : __Pyx_GOTREF(__pyx_t_4);
37971 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
37972 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
37973 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 948, __pyx_L1_error);
37974 1 : __Pyx_INCREF((PyObject *)__pyx_v_S);
37975 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
37976 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 948, __pyx_L1_error);
37977 1 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
37978 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
37979 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 948, __pyx_L1_error);
37980 1 : __pyx_r = __pyx_t_4;
37981 1 : __pyx_t_4 = 0;
37982 1 : goto __pyx_L0;
37983 :
37984 : /* "scipy/linalg/_decomp_interpolative.pyx":888
37985 : *
37986 : *
37987 : * def iddr_asvd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
37988 : * rng):
37989 : * cdef int m = a.shape[0], n = a.shape[1]
37990 : */
37991 :
37992 : /* function exit code */
37993 0 : __pyx_L1_error:;
37994 0 : __Pyx_XDECREF(__pyx_t_1);
37995 0 : __Pyx_XDECREF(__pyx_t_2);
37996 0 : __Pyx_XDECREF(__pyx_t_3);
37997 0 : __Pyx_XDECREF(__pyx_t_4);
37998 0 : __Pyx_XDECREF(__pyx_t_29);
37999 0 : __Pyx_XDECREF(__pyx_t_30);
38000 0 : __Pyx_XDECREF(__pyx_t_31);
38001 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
38002 0 : __Pyx_PyThreadState_declare
38003 0 : __Pyx_PyThreadState_assign
38004 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
38005 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
38006 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
38007 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
38008 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
38009 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
38010 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
38011 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
38012 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
38013 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
38014 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
38015 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
38016 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
38017 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
38018 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
38019 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
38020 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
38021 0 : __pyx_r = NULL;
38022 0 : goto __pyx_L2;
38023 1 : __pyx_L0:;
38024 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
38025 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
38026 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
38027 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
38028 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
38029 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
38030 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
38031 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
38032 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
38033 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
38034 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
38035 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
38036 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
38037 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
38038 1 : __pyx_L2:;
38039 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
38040 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
38041 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
38042 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
38043 1 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
38044 1 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
38045 1 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
38046 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
38047 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
38048 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
38049 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
38050 1 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
38051 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
38052 1 : __Pyx_XDECREF(__pyx_v_r);
38053 1 : __Pyx_XDECREF(__pyx_v_t);
38054 1 : __Pyx_XDECREF(__pyx_v_r2);
38055 1 : __Pyx_XDECREF(__pyx_v_r3);
38056 1 : __Pyx_XGIVEREF(__pyx_r);
38057 1 : __Pyx_RefNannyFinishContext();
38058 1 : return __pyx_r;
38059 : }
38060 :
38061 : /* "scipy/linalg/_decomp_interpolative.pyx":951
38062 : *
38063 : *
38064 : * def iddr_id(cnp.ndarray[cnp.float64_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
38065 : * cdef int n = a.shape[1]
38066 : * cdef int tmp_int
38067 : */
38068 :
38069 : /* Python wrapper */
38070 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_31iddr_id(PyObject *__pyx_self,
38071 : #if CYTHON_METH_FASTCALL
38072 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
38073 : #else
38074 : PyObject *__pyx_args, PyObject *__pyx_kwds
38075 : #endif
38076 : ); /*proto*/
38077 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_31iddr_id = {"iddr_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_31iddr_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
38078 31 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_31iddr_id(PyObject *__pyx_self,
38079 : #if CYTHON_METH_FASTCALL
38080 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
38081 : #else
38082 : PyObject *__pyx_args, PyObject *__pyx_kwds
38083 : #endif
38084 : ) {
38085 31 : PyArrayObject *__pyx_v_a = 0;
38086 31 : int __pyx_v_krank;
38087 : #if !CYTHON_METH_FASTCALL
38088 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
38089 : #endif
38090 31 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
38091 31 : PyObject* values[2] = {0,0};
38092 31 : int __pyx_lineno = 0;
38093 31 : const char *__pyx_filename = NULL;
38094 31 : int __pyx_clineno = 0;
38095 31 : PyObject *__pyx_r = 0;
38096 : __Pyx_RefNannyDeclarations
38097 31 : __Pyx_RefNannySetupContext("iddr_id (wrapper)", 0);
38098 : #if !CYTHON_METH_FASTCALL
38099 : #if CYTHON_ASSUME_SAFE_MACROS
38100 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
38101 : #else
38102 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
38103 : #endif
38104 : #endif
38105 31 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
38106 : {
38107 31 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
38108 31 : if (__pyx_kwds) {
38109 2 : Py_ssize_t kw_args;
38110 2 : switch (__pyx_nargs) {
38111 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
38112 0 : CYTHON_FALLTHROUGH;
38113 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
38114 2 : CYTHON_FALLTHROUGH;
38115 2 : case 0: break;
38116 0 : default: goto __pyx_L5_argtuple_error;
38117 : }
38118 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
38119 0 : switch (__pyx_nargs) {
38120 : case 0:
38121 2 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
38122 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
38123 2 : kw_args--;
38124 : }
38125 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error)
38126 0 : else goto __pyx_L5_argtuple_error;
38127 2 : CYTHON_FALLTHROUGH;
38128 : case 1:
38129 2 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
38130 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
38131 2 : kw_args--;
38132 : }
38133 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error)
38134 : else {
38135 0 : __Pyx_RaiseArgtupleInvalid("iddr_id", 1, 2, 2, 1); __PYX_ERR(0, 951, __pyx_L3_error)
38136 : }
38137 : }
38138 2 : if (unlikely(kw_args > 0)) {
38139 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
38140 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_id") < 0)) __PYX_ERR(0, 951, __pyx_L3_error)
38141 : }
38142 29 : } else if (unlikely(__pyx_nargs != 2)) {
38143 0 : goto __pyx_L5_argtuple_error;
38144 : } else {
38145 29 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
38146 29 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
38147 : }
38148 31 : __pyx_v_a = ((PyArrayObject *)values[0]);
38149 31 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error)
38150 : }
38151 31 : goto __pyx_L6_skip;
38152 0 : __pyx_L5_argtuple_error:;
38153 0 : __Pyx_RaiseArgtupleInvalid("iddr_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 951, __pyx_L3_error)
38154 31 : __pyx_L6_skip:;
38155 31 : goto __pyx_L4_argument_unpacking_done;
38156 0 : __pyx_L3_error:;
38157 : {
38158 0 : Py_ssize_t __pyx_temp;
38159 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
38160 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
38161 : }
38162 : }
38163 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
38164 0 : __Pyx_RefNannyFinishContext();
38165 0 : return NULL;
38166 31 : __pyx_L4_argument_unpacking_done:;
38167 31 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 951, __pyx_L1_error)
38168 31 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_30iddr_id(__pyx_self, __pyx_v_a, __pyx_v_krank);
38169 :
38170 : /* function exit code */
38171 31 : goto __pyx_L0;
38172 0 : __pyx_L1_error:;
38173 0 : __pyx_r = NULL;
38174 31 : __pyx_L0:;
38175 : {
38176 31 : Py_ssize_t __pyx_temp;
38177 31 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
38178 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
38179 : }
38180 : }
38181 : __Pyx_RefNannyFinishContext();
38182 : return __pyx_r;
38183 : }
38184 :
38185 31 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_30iddr_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank) {
38186 31 : int __pyx_v_n;
38187 31 : int __pyx_v_tmp_int;
38188 31 : __pyx_t_5numpy_float64_t __pyx_v_one;
38189 31 : PyArrayObject *__pyx_v_inds = 0;
38190 31 : PyArrayObject *__pyx_v_perms = 0;
38191 31 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
38192 31 : int __pyx_v_p;
38193 31 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
38194 31 : __Pyx_Buffer __pyx_pybuffer_a;
38195 31 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
38196 31 : __Pyx_Buffer __pyx_pybuffer_inds;
38197 31 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
38198 31 : __Pyx_Buffer __pyx_pybuffer_perms;
38199 31 : PyObject *__pyx_r = NULL;
38200 : __Pyx_RefNannyDeclarations
38201 31 : PyObject *__pyx_t_1 = NULL;
38202 31 : PyObject *__pyx_t_2 = NULL;
38203 31 : PyObject *__pyx_t_3 = NULL;
38204 31 : PyObject *__pyx_t_4 = NULL;
38205 31 : unsigned int __pyx_t_5;
38206 31 : PyObject *(*__pyx_t_6)(PyObject *);
38207 31 : PyArrayObject *__pyx_t_7 = NULL;
38208 31 : int __pyx_t_8;
38209 31 : PyObject *__pyx_t_9 = NULL;
38210 31 : PyObject *__pyx_t_10 = NULL;
38211 31 : PyObject *__pyx_t_11 = NULL;
38212 31 : PyArrayObject *__pyx_t_12 = NULL;
38213 31 : int __pyx_t_13;
38214 31 : int __pyx_t_14;
38215 31 : int __pyx_t_15;
38216 31 : Py_ssize_t __pyx_t_16;
38217 31 : npy_int64 __pyx_t_17;
38218 31 : Py_ssize_t __pyx_t_18;
38219 31 : Py_ssize_t __pyx_t_19;
38220 31 : Py_ssize_t __pyx_t_20;
38221 31 : int __pyx_lineno = 0;
38222 31 : const char *__pyx_filename = NULL;
38223 31 : int __pyx_clineno = 0;
38224 31 : __Pyx_RefNannySetupContext("iddr_id", 1);
38225 31 : __pyx_pybuffer_inds.pybuffer.buf = NULL;
38226 31 : __pyx_pybuffer_inds.refcount = 0;
38227 31 : __pyx_pybuffernd_inds.data = NULL;
38228 31 : __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
38229 31 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
38230 31 : __pyx_pybuffer_perms.refcount = 0;
38231 31 : __pyx_pybuffernd_perms.data = NULL;
38232 31 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
38233 31 : __pyx_pybuffer_a.pybuffer.buf = NULL;
38234 31 : __pyx_pybuffer_a.refcount = 0;
38235 31 : __pyx_pybuffernd_a.data = NULL;
38236 31 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
38237 : {
38238 31 : __Pyx_BufFmt_StackElem __pyx_stack[1];
38239 31 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 951, __pyx_L1_error)
38240 : }
38241 31 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
38242 :
38243 : /* "scipy/linalg/_decomp_interpolative.pyx":952
38244 : *
38245 : * def iddr_id(cnp.ndarray[cnp.float64_t, ndim=2] a, int krank):
38246 : * cdef int n = a.shape[1] # <<<<<<<<<<<<<<
38247 : * cdef int tmp_int
38248 : * cdef cnp.float64_t one = 1.0
38249 : */
38250 31 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
38251 :
38252 : /* "scipy/linalg/_decomp_interpolative.pyx":954
38253 : * cdef int n = a.shape[1]
38254 : * cdef int tmp_int
38255 : * cdef cnp.float64_t one = 1.0 # <<<<<<<<<<<<<<
38256 : * cdef cnp.ndarray[cnp.npy_int64, ndim=1] inds
38257 : * cdef cnp.ndarray[cnp.npy_int64, ndim=1] perms
38258 : */
38259 31 : __pyx_v_one = 1.0;
38260 :
38261 : /* "scipy/linalg/_decomp_interpolative.pyx":958
38262 : * cdef cnp.ndarray[cnp.npy_int64, ndim=1] perms
38263 : *
38264 : * inds, _ = iddr_qrpiv(a, krank) # <<<<<<<<<<<<<<
38265 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
38266 : *
38267 : */
38268 31 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
38269 31 : __Pyx_GOTREF(__pyx_t_2);
38270 31 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
38271 31 : __Pyx_GOTREF(__pyx_t_3);
38272 31 : __pyx_t_4 = NULL;
38273 31 : __pyx_t_5 = 0;
38274 : #if CYTHON_UNPACK_METHODS
38275 31 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
38276 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
38277 0 : if (likely(__pyx_t_4)) {
38278 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38279 0 : __Pyx_INCREF(__pyx_t_4);
38280 0 : __Pyx_INCREF(function);
38281 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
38282 : __pyx_t_5 = 1;
38283 : }
38284 : }
38285 : #endif
38286 : {
38287 31 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
38288 31 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
38289 31 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38290 31 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38291 31 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
38292 31 : __Pyx_GOTREF(__pyx_t_1);
38293 31 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38294 : }
38295 31 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
38296 31 : PyObject* sequence = __pyx_t_1;
38297 31 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
38298 31 : if (unlikely(size != 2)) {
38299 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
38300 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
38301 0 : __PYX_ERR(0, 958, __pyx_L1_error)
38302 : }
38303 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38304 31 : if (likely(PyTuple_CheckExact(sequence))) {
38305 31 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
38306 31 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
38307 : } else {
38308 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
38309 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
38310 : }
38311 31 : __Pyx_INCREF(__pyx_t_2);
38312 31 : __Pyx_INCREF(__pyx_t_3);
38313 : #else
38314 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
38315 : __Pyx_GOTREF(__pyx_t_2);
38316 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
38317 : __Pyx_GOTREF(__pyx_t_3);
38318 : #endif
38319 31 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38320 : } else {
38321 0 : Py_ssize_t index = -1;
38322 0 : __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
38323 0 : __Pyx_GOTREF(__pyx_t_4);
38324 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38325 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
38326 0 : index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
38327 0 : __Pyx_GOTREF(__pyx_t_2);
38328 0 : index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
38329 0 : __Pyx_GOTREF(__pyx_t_3);
38330 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(0, 958, __pyx_L1_error)
38331 0 : __pyx_t_6 = NULL;
38332 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38333 0 : goto __pyx_L4_unpacking_done;
38334 0 : __pyx_L3_unpacking_failed:;
38335 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38336 0 : __pyx_t_6 = NULL;
38337 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
38338 0 : __PYX_ERR(0, 958, __pyx_L1_error)
38339 0 : __pyx_L4_unpacking_done:;
38340 : }
38341 31 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 958, __pyx_L1_error)
38342 31 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
38343 : {
38344 31 : __Pyx_BufFmt_StackElem __pyx_stack[1];
38345 31 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
38346 31 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
38347 31 : if (unlikely(__pyx_t_8 < 0)) {
38348 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
38349 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
38350 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
38351 : __Pyx_RaiseBufferFallbackError();
38352 : } else {
38353 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
38354 : }
38355 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
38356 : }
38357 31 : __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
38358 31 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 958, __pyx_L1_error)
38359 : }
38360 31 : __pyx_t_7 = 0;
38361 31 : __pyx_v_inds = ((PyArrayObject *)__pyx_t_2);
38362 31 : __pyx_t_2 = 0;
38363 31 : __pyx_v__ = __pyx_t_3;
38364 31 : __pyx_t_3 = 0;
38365 :
38366 : /* "scipy/linalg/_decomp_interpolative.pyx":959
38367 : *
38368 : * inds, _ = iddr_qrpiv(a, krank)
38369 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64) # <<<<<<<<<<<<<<
38370 : *
38371 : * if krank > 0:
38372 : */
38373 31 : __pyx_t_1 = PyArray_Arange(0.0, __pyx_v_n, 1.0, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
38374 31 : __Pyx_GOTREF(__pyx_t_1);
38375 31 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 959, __pyx_L1_error)
38376 31 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_1);
38377 : {
38378 31 : __Pyx_BufFmt_StackElem __pyx_stack[1];
38379 31 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
38380 31 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
38381 31 : if (unlikely(__pyx_t_8 < 0)) {
38382 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
38383 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
38384 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
38385 : __Pyx_RaiseBufferFallbackError();
38386 : } else {
38387 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
38388 : }
38389 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
38390 : }
38391 31 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
38392 31 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 959, __pyx_L1_error)
38393 : }
38394 31 : __pyx_t_12 = 0;
38395 31 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_1);
38396 31 : __pyx_t_1 = 0;
38397 :
38398 : /* "scipy/linalg/_decomp_interpolative.pyx":961
38399 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
38400 : *
38401 : * if krank > 0: # <<<<<<<<<<<<<<
38402 : * for p in range(krank):
38403 : * # Apply pivots
38404 : */
38405 31 : __pyx_t_13 = (__pyx_v_krank > 0);
38406 31 : if (__pyx_t_13) {
38407 :
38408 : /* "scipy/linalg/_decomp_interpolative.pyx":962
38409 : *
38410 : * if krank > 0:
38411 : * for p in range(krank): # <<<<<<<<<<<<<<
38412 : * # Apply pivots
38413 : * tmp_int = perms[p]
38414 : */
38415 433 : __pyx_t_8 = __pyx_v_krank;
38416 : __pyx_t_14 = __pyx_t_8;
38417 433 : for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
38418 402 : __pyx_v_p = __pyx_t_15;
38419 :
38420 : /* "scipy/linalg/_decomp_interpolative.pyx":964
38421 : * for p in range(krank):
38422 : * # Apply pivots
38423 : * tmp_int = perms[p] # <<<<<<<<<<<<<<
38424 : * perms[p] = perms[inds[p]]
38425 : * perms[inds[p]] = tmp_int
38426 : */
38427 402 : __pyx_t_16 = __pyx_v_p;
38428 402 : __pyx_v_tmp_int = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_perms.diminfo[0].strides));
38429 :
38430 : /* "scipy/linalg/_decomp_interpolative.pyx":965
38431 : * # Apply pivots
38432 : * tmp_int = perms[p]
38433 : * perms[p] = perms[inds[p]] # <<<<<<<<<<<<<<
38434 : * perms[inds[p]] = tmp_int
38435 : *
38436 : */
38437 402 : __pyx_t_16 = __pyx_v_p;
38438 402 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_inds.diminfo[0].strides));
38439 402 : __pyx_t_18 = __pyx_v_p;
38440 402 : *__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_perms.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
38441 :
38442 : /* "scipy/linalg/_decomp_interpolative.pyx":966
38443 : * tmp_int = perms[p]
38444 : * perms[p] = perms[inds[p]]
38445 : * perms[inds[p]] = tmp_int # <<<<<<<<<<<<<<
38446 : *
38447 : * # See iddp_id comments for below
38448 : */
38449 402 : __pyx_t_16 = __pyx_v_p;
38450 402 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_inds.diminfo[0].strides));
38451 402 : *__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides) = __pyx_v_tmp_int;
38452 : }
38453 :
38454 : /* "scipy/linalg/_decomp_interpolative.pyx":961
38455 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
38456 : *
38457 : * if krank > 0: # <<<<<<<<<<<<<<
38458 : * for p in range(krank):
38459 : * # Apply pivots
38460 : */
38461 : }
38462 :
38463 : /* "scipy/linalg/_decomp_interpolative.pyx":969
38464 : *
38465 : * # See iddp_id comments for below
38466 : * tmp_int = n - krank # <<<<<<<<<<<<<<
38467 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
38468 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
38469 : */
38470 31 : __pyx_v_tmp_int = (__pyx_v_n - __pyx_v_krank);
38471 :
38472 : /* "scipy/linalg/_decomp_interpolative.pyx":972
38473 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
38474 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
38475 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n) # <<<<<<<<<<<<<<
38476 : *
38477 : * return perms, a[:krank, krank:]
38478 : */
38479 31 : __pyx_t_16 = 0;
38480 31 : __pyx_t_18 = 0;
38481 31 : __pyx_t_19 = 0;
38482 31 : __pyx_t_20 = __pyx_v_krank;
38483 :
38484 : /* "scipy/linalg/_decomp_interpolative.pyx":971
38485 : * tmp_int = n - krank
38486 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
38487 : * dtrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N', # <<<<<<<<<<<<<<
38488 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
38489 : *
38490 : */
38491 31 : __pyx_f_5scipy_6linalg_11cython_blas_dtrsm(((char *)((char *)"R")), ((char *)((char *)"L")), ((char *)((char *)"N")), ((char *)((char *)"N")), (&__pyx_v_tmp_int), (&__pyx_v_krank), (&__pyx_v_one), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n));
38492 :
38493 : /* "scipy/linalg/_decomp_interpolative.pyx":974
38494 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
38495 : *
38496 : * return perms, a[:krank, krank:] # <<<<<<<<<<<<<<
38497 : *
38498 : *
38499 : */
38500 31 : __Pyx_XDECREF(__pyx_r);
38501 31 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
38502 31 : __Pyx_GOTREF(__pyx_t_1);
38503 31 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error)
38504 31 : __Pyx_GOTREF(__pyx_t_3);
38505 31 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38506 31 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
38507 31 : __Pyx_GOTREF(__pyx_t_1);
38508 31 : __pyx_t_2 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
38509 31 : __Pyx_GOTREF(__pyx_t_2);
38510 31 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38511 31 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
38512 31 : __Pyx_GOTREF(__pyx_t_1);
38513 31 : __Pyx_GIVEREF(__pyx_t_3);
38514 31 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error);
38515 31 : __Pyx_GIVEREF(__pyx_t_2);
38516 31 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error);
38517 31 : __pyx_t_3 = 0;
38518 31 : __pyx_t_2 = 0;
38519 31 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
38520 31 : __Pyx_GOTREF(__pyx_t_2);
38521 31 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38522 31 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
38523 31 : __Pyx_GOTREF(__pyx_t_1);
38524 31 : __Pyx_INCREF((PyObject *)__pyx_v_perms);
38525 31 : __Pyx_GIVEREF((PyObject *)__pyx_v_perms);
38526 31 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_perms))) __PYX_ERR(0, 974, __pyx_L1_error);
38527 31 : __Pyx_GIVEREF(__pyx_t_2);
38528 31 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error);
38529 31 : __pyx_t_2 = 0;
38530 31 : __pyx_r = __pyx_t_1;
38531 31 : __pyx_t_1 = 0;
38532 31 : goto __pyx_L0;
38533 :
38534 : /* "scipy/linalg/_decomp_interpolative.pyx":951
38535 : *
38536 : *
38537 : * def iddr_id(cnp.ndarray[cnp.float64_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
38538 : * cdef int n = a.shape[1]
38539 : * cdef int tmp_int
38540 : */
38541 :
38542 : /* function exit code */
38543 0 : __pyx_L1_error:;
38544 0 : __Pyx_XDECREF(__pyx_t_1);
38545 0 : __Pyx_XDECREF(__pyx_t_2);
38546 0 : __Pyx_XDECREF(__pyx_t_3);
38547 0 : __Pyx_XDECREF(__pyx_t_4);
38548 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
38549 0 : __Pyx_PyThreadState_declare
38550 0 : __Pyx_PyThreadState_assign
38551 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
38552 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
38553 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
38554 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
38555 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
38556 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
38557 0 : __pyx_r = NULL;
38558 0 : goto __pyx_L2;
38559 31 : __pyx_L0:;
38560 31 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
38561 31 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
38562 31 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
38563 31 : __pyx_L2:;
38564 31 : __Pyx_XDECREF((PyObject *)__pyx_v_inds);
38565 31 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
38566 31 : __Pyx_XDECREF(__pyx_v__);
38567 31 : __Pyx_XGIVEREF(__pyx_r);
38568 31 : __Pyx_RefNannyFinishContext();
38569 31 : return __pyx_r;
38570 : }
38571 :
38572 : /* "scipy/linalg/_decomp_interpolative.pyx":977
38573 : *
38574 : *
38575 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int): # <<<<<<<<<<<<<<
38576 : * cdef int m = a.shape[0], n = a.shape[1]
38577 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
38578 : */
38579 :
38580 : /* Python wrapper */
38581 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_33iddr_qrpiv(PyObject *__pyx_self,
38582 : #if CYTHON_METH_FASTCALL
38583 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
38584 : #else
38585 : PyObject *__pyx_args, PyObject *__pyx_kwds
38586 : #endif
38587 : ); /*proto*/
38588 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_33iddr_qrpiv = {"iddr_qrpiv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_33iddr_qrpiv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
38589 42 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_33iddr_qrpiv(PyObject *__pyx_self,
38590 : #if CYTHON_METH_FASTCALL
38591 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
38592 : #else
38593 : PyObject *__pyx_args, PyObject *__pyx_kwds
38594 : #endif
38595 : ) {
38596 42 : PyArrayObject *__pyx_v_a = 0;
38597 42 : PyObject *__pyx_v_krank = 0;
38598 : #if !CYTHON_METH_FASTCALL
38599 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
38600 : #endif
38601 42 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
38602 42 : PyObject* values[2] = {0,0};
38603 42 : int __pyx_lineno = 0;
38604 42 : const char *__pyx_filename = NULL;
38605 42 : int __pyx_clineno = 0;
38606 42 : PyObject *__pyx_r = 0;
38607 : __Pyx_RefNannyDeclarations
38608 42 : __Pyx_RefNannySetupContext("iddr_qrpiv (wrapper)", 0);
38609 : #if !CYTHON_METH_FASTCALL
38610 : #if CYTHON_ASSUME_SAFE_MACROS
38611 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
38612 : #else
38613 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
38614 : #endif
38615 : #endif
38616 42 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
38617 : {
38618 42 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
38619 42 : if (__pyx_kwds) {
38620 0 : Py_ssize_t kw_args;
38621 0 : switch (__pyx_nargs) {
38622 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
38623 0 : CYTHON_FALLTHROUGH;
38624 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
38625 0 : CYTHON_FALLTHROUGH;
38626 0 : case 0: break;
38627 0 : default: goto __pyx_L5_argtuple_error;
38628 : }
38629 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
38630 0 : switch (__pyx_nargs) {
38631 : case 0:
38632 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
38633 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
38634 0 : kw_args--;
38635 : }
38636 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
38637 0 : else goto __pyx_L5_argtuple_error;
38638 0 : CYTHON_FALLTHROUGH;
38639 : case 1:
38640 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
38641 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
38642 0 : kw_args--;
38643 : }
38644 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 977, __pyx_L3_error)
38645 : else {
38646 0 : __Pyx_RaiseArgtupleInvalid("iddr_qrpiv", 1, 2, 2, 1); __PYX_ERR(0, 977, __pyx_L3_error)
38647 : }
38648 : }
38649 0 : if (unlikely(kw_args > 0)) {
38650 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
38651 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_qrpiv") < 0)) __PYX_ERR(0, 977, __pyx_L3_error)
38652 : }
38653 42 : } else if (unlikely(__pyx_nargs != 2)) {
38654 0 : goto __pyx_L5_argtuple_error;
38655 : } else {
38656 42 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
38657 42 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
38658 : }
38659 42 : __pyx_v_a = ((PyArrayObject *)values[0]);
38660 42 : __pyx_v_krank = ((PyObject*)values[1]);
38661 : }
38662 42 : goto __pyx_L6_skip;
38663 0 : __pyx_L5_argtuple_error:;
38664 0 : __Pyx_RaiseArgtupleInvalid("iddr_qrpiv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 977, __pyx_L3_error)
38665 42 : __pyx_L6_skip:;
38666 42 : goto __pyx_L4_argument_unpacking_done;
38667 0 : __pyx_L3_error:;
38668 : {
38669 0 : Py_ssize_t __pyx_temp;
38670 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
38671 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
38672 : }
38673 : }
38674 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
38675 0 : __Pyx_RefNannyFinishContext();
38676 0 : return NULL;
38677 42 : __pyx_L4_argument_unpacking_done:;
38678 42 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 977, __pyx_L1_error)
38679 42 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_krank), (&PyInt_Type), 0, "krank", 1))) __PYX_ERR(0, 977, __pyx_L1_error)
38680 42 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_32iddr_qrpiv(__pyx_self, __pyx_v_a, __pyx_v_krank);
38681 :
38682 : /* function exit code */
38683 42 : goto __pyx_L0;
38684 : __pyx_L1_error:;
38685 : __pyx_r = NULL;
38686 42 : __pyx_L0:;
38687 : {
38688 42 : Py_ssize_t __pyx_temp;
38689 42 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
38690 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
38691 : }
38692 : }
38693 : __Pyx_RefNannyFinishContext();
38694 : return __pyx_r;
38695 : }
38696 :
38697 42 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_32iddr_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, PyObject *__pyx_v_krank) {
38698 42 : int __pyx_v_m;
38699 42 : int __pyx_v_n;
38700 42 : PyArrayObject *__pyx_v_col_norms = 0;
38701 42 : int __pyx_v_loop;
38702 42 : int __pyx_v_loops;
38703 42 : int __pyx_v_kpiv;
38704 42 : int __pyx_v_i;
38705 42 : int __pyx_v_tmp_int;
38706 42 : int __pyx_v_int_n;
38707 42 : __pyx_t_5numpy_float64_t __pyx_v_tmp_sca;
38708 42 : PyArrayObject *__pyx_v_taus = 0;
38709 42 : PyArrayObject *__pyx_v_ind = 0;
38710 42 : __Pyx_memviewslice __pyx_v_taus_v = { 0, 0, { 0 }, { 0 }, { 0 } };
38711 42 : __pyx_t_5numpy_float64_t __pyx_v_feps;
38712 42 : __pyx_t_5numpy_float64_t __pyx_v_ssmax;
38713 42 : __pyx_t_5numpy_float64_t __pyx_v_ssmaxin;
38714 42 : int __pyx_v_nupdate;
38715 42 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
38716 42 : __Pyx_Buffer __pyx_pybuffer_a;
38717 42 : PyObject *__pyx_r = NULL;
38718 : __Pyx_RefNannyDeclarations
38719 42 : npy_intp __pyx_t_1[1];
38720 42 : PyObject *__pyx_t_2 = NULL;
38721 42 : npy_intp __pyx_t_3[1];
38722 42 : npy_intp __pyx_t_4[1];
38723 42 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
38724 42 : int __pyx_t_6;
38725 42 : int __pyx_t_7;
38726 42 : int __pyx_t_8;
38727 42 : int __pyx_t_9;
38728 42 : PyObject *__pyx_t_10 = NULL;
38729 42 : PyObject *__pyx_t_11 = NULL;
38730 42 : PyObject *__pyx_t_12 = NULL;
38731 42 : Py_ssize_t __pyx_t_13;
38732 42 : Py_ssize_t __pyx_t_14;
38733 42 : unsigned int __pyx_t_15;
38734 42 : __pyx_t_5numpy_float64_t __pyx_t_16;
38735 42 : PyObject *__pyx_t_17 = NULL;
38736 42 : Py_ssize_t __pyx_t_18;
38737 42 : PyObject *__pyx_t_19 = NULL;
38738 42 : PyObject *__pyx_t_20 = NULL;
38739 42 : PyObject *__pyx_t_21 = NULL;
38740 42 : PyObject *__pyx_t_22 = NULL;
38741 42 : PyObject *__pyx_t_23 = NULL;
38742 42 : int __pyx_t_24;
38743 42 : int __pyx_t_25;
38744 42 : int __pyx_t_26;
38745 42 : int __pyx_t_27;
38746 42 : int __pyx_lineno = 0;
38747 42 : const char *__pyx_filename = NULL;
38748 42 : int __pyx_clineno = 0;
38749 42 : __Pyx_RefNannySetupContext("iddr_qrpiv", 1);
38750 42 : __pyx_pybuffer_a.pybuffer.buf = NULL;
38751 42 : __pyx_pybuffer_a.refcount = 0;
38752 42 : __pyx_pybuffernd_a.data = NULL;
38753 42 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
38754 : {
38755 42 : __Pyx_BufFmt_StackElem __pyx_stack[1];
38756 42 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 977, __pyx_L1_error)
38757 : }
38758 42 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
38759 :
38760 : /* "scipy/linalg/_decomp_interpolative.pyx":978
38761 : *
38762 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int):
38763 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
38764 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
38765 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
38766 : */
38767 42 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
38768 42 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
38769 :
38770 : /* "scipy/linalg/_decomp_interpolative.pyx":979
38771 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int):
38772 : * cdef int m = a.shape[0], n = a.shape[1]
38773 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
38774 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
38775 : * cdef cnp.float64_t tmp_sca = 0.
38776 : */
38777 42 : __pyx_t_1[0] = __pyx_v_n;
38778 42 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_1, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
38779 42 : __Pyx_GOTREF(__pyx_t_2);
38780 42 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 979, __pyx_L1_error)
38781 42 : __pyx_v_col_norms = ((PyArrayObject *)__pyx_t_2);
38782 42 : __pyx_t_2 = 0;
38783 :
38784 : /* "scipy/linalg/_decomp_interpolative.pyx":980
38785 : * cdef int m = a.shape[0], n = a.shape[1]
38786 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
38787 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0, int_n = 0 # <<<<<<<<<<<<<<
38788 : * cdef cnp.float64_t tmp_sca = 0.
38789 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
38790 : */
38791 42 : __pyx_v_loop = 0;
38792 42 : __pyx_v_kpiv = 0;
38793 42 : __pyx_v_i = 0;
38794 42 : __pyx_v_tmp_int = 0;
38795 42 : __pyx_v_int_n = 0;
38796 :
38797 : /* "scipy/linalg/_decomp_interpolative.pyx":981
38798 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
38799 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
38800 : * cdef cnp.float64_t tmp_sca = 0. # <<<<<<<<<<<<<<
38801 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
38802 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
38803 : */
38804 42 : __pyx_v_tmp_sca = 0.;
38805 :
38806 : /* "scipy/linalg/_decomp_interpolative.pyx":982
38807 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
38808 : * cdef cnp.float64_t tmp_sca = 0.
38809 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
38810 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
38811 : * cdef cnp.float64_t[::1] taus_v = taus
38812 : */
38813 42 : __pyx_t_3[0] = __pyx_v_m;
38814 42 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
38815 42 : __Pyx_GOTREF(__pyx_t_2);
38816 42 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 982, __pyx_L1_error)
38817 42 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_2);
38818 42 : __pyx_t_2 = 0;
38819 :
38820 : /* "scipy/linalg/_decomp_interpolative.pyx":983
38821 : * cdef cnp.float64_t tmp_sca = 0.
38822 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
38823 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
38824 : * cdef cnp.float64_t[::1] taus_v = taus
38825 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
38826 : */
38827 42 : __pyx_t_4[0] = __pyx_v_n;
38828 42 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
38829 42 : __Pyx_GOTREF(__pyx_t_2);
38830 42 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 983, __pyx_L1_error)
38831 42 : __pyx_v_ind = ((PyArrayObject *)__pyx_t_2);
38832 42 : __pyx_t_2 = 0;
38833 :
38834 : /* "scipy/linalg/_decomp_interpolative.pyx":984
38835 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_FLOAT64, 0)
38836 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
38837 : * cdef cnp.float64_t[::1] taus_v = taus # <<<<<<<<<<<<<<
38838 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
38839 : * cdef cnp.float64_t ssmax, ssmaxin
38840 : */
38841 42 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_taus), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 984, __pyx_L1_error)
38842 42 : __pyx_v_taus_v = __pyx_t_5;
38843 42 : __pyx_t_5.memview = NULL;
38844 42 : __pyx_t_5.data = NULL;
38845 :
38846 : /* "scipy/linalg/_decomp_interpolative.pyx":985
38847 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
38848 : * cdef cnp.float64_t[::1] taus_v = taus
38849 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps # <<<<<<<<<<<<<<
38850 : * cdef cnp.float64_t ssmax, ssmaxin
38851 : * cdef int nupdate = 0
38852 : */
38853 42 : __pyx_v_feps = 0.1e-16;
38854 :
38855 : /* "scipy/linalg/_decomp_interpolative.pyx":987
38856 : * cdef cnp.float64_t feps = 0.1e-16 # np.finfo(np.float64).eps
38857 : * cdef cnp.float64_t ssmax, ssmaxin
38858 : * cdef int nupdate = 0 # <<<<<<<<<<<<<<
38859 : *
38860 : * loops = min(krank, min(m, n))
38861 : */
38862 42 : __pyx_v_nupdate = 0;
38863 :
38864 : /* "scipy/linalg/_decomp_interpolative.pyx":989
38865 : * cdef int nupdate = 0
38866 : *
38867 : * loops = min(krank, min(m, n)) # <<<<<<<<<<<<<<
38868 : * for i in range(n):
38869 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2
38870 : */
38871 42 : __pyx_t_6 = __pyx_v_n;
38872 42 : __pyx_t_7 = __pyx_v_m;
38873 42 : __pyx_t_9 = (__pyx_t_6 < __pyx_t_7);
38874 42 : if (__pyx_t_9) {
38875 : __pyx_t_8 = __pyx_t_6;
38876 : } else {
38877 : __pyx_t_8 = __pyx_t_7;
38878 : }
38879 42 : __pyx_t_6 = __pyx_t_8;
38880 42 : __Pyx_INCREF(__pyx_v_krank);
38881 42 : __pyx_t_10 = __pyx_v_krank;
38882 42 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 989, __pyx_L1_error)
38883 42 : __Pyx_GOTREF(__pyx_t_11);
38884 42 : __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 989, __pyx_L1_error)
38885 42 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
38886 42 : __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 989, __pyx_L1_error)
38887 42 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
38888 42 : if (__pyx_t_9) {
38889 0 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 989, __pyx_L1_error)
38890 : __Pyx_GOTREF(__pyx_t_12);
38891 : __pyx_t_2 = __pyx_t_12;
38892 : __pyx_t_12 = 0;
38893 : } else {
38894 42 : __Pyx_INCREF(__pyx_t_10);
38895 : __pyx_t_2 = __pyx_t_10;
38896 : }
38897 42 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
38898 42 : __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
38899 42 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38900 42 : __pyx_v_loops = __pyx_t_6;
38901 :
38902 : /* "scipy/linalg/_decomp_interpolative.pyx":990
38903 : *
38904 : * loops = min(krank, min(m, n))
38905 : * for i in range(n): # <<<<<<<<<<<<<<
38906 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2
38907 : *
38908 : */
38909 42 : __pyx_t_6 = __pyx_v_n;
38910 42 : __pyx_t_8 = __pyx_t_6;
38911 2981 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
38912 2939 : __pyx_v_i = __pyx_t_7;
38913 :
38914 : /* "scipy/linalg/_decomp_interpolative.pyx":991
38915 : * loops = min(krank, min(m, n))
38916 : * for i in range(n):
38917 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2 # <<<<<<<<<<<<<<
38918 : *
38919 : * kpiv = np.argmax(col_norms)
38920 : */
38921 2939 : __pyx_t_13 = 0;
38922 2939 : __pyx_t_14 = __pyx_v_i;
38923 2939 : __pyx_t_2 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_m), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error)
38924 2939 : __Pyx_GOTREF(__pyx_t_2);
38925 2939 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 991, __pyx_L1_error)
38926 5878 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38927 : }
38928 :
38929 : /* "scipy/linalg/_decomp_interpolative.pyx":993
38930 : * col_norms[i] = dnrm2(&m, &a[0, i], &n)**2
38931 : *
38932 : * kpiv = np.argmax(col_norms) # <<<<<<<<<<<<<<
38933 : * ssmax = col_norms[kpiv]
38934 : * ssmaxin = ssmax
38935 : */
38936 42 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 993, __pyx_L1_error)
38937 42 : __Pyx_GOTREF(__pyx_t_12);
38938 42 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_argmax); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 993, __pyx_L1_error)
38939 42 : __Pyx_GOTREF(__pyx_t_11);
38940 42 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
38941 42 : __pyx_t_12 = NULL;
38942 42 : __pyx_t_15 = 0;
38943 : #if CYTHON_UNPACK_METHODS
38944 42 : if (unlikely(PyMethod_Check(__pyx_t_11))) {
38945 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
38946 0 : if (likely(__pyx_t_12)) {
38947 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
38948 0 : __Pyx_INCREF(__pyx_t_12);
38949 0 : __Pyx_INCREF(function);
38950 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
38951 : __pyx_t_15 = 1;
38952 : }
38953 : }
38954 : #endif
38955 : {
38956 42 : PyObject *__pyx_callargs[2] = {__pyx_t_12, ((PyObject *)__pyx_v_col_norms)};
38957 42 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
38958 42 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
38959 42 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error)
38960 42 : __Pyx_GOTREF(__pyx_t_2);
38961 42 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
38962 : }
38963 42 : __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 993, __pyx_L1_error)
38964 42 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38965 42 : __pyx_v_kpiv = __pyx_t_6;
38966 :
38967 : /* "scipy/linalg/_decomp_interpolative.pyx":994
38968 : *
38969 : * kpiv = np.argmax(col_norms)
38970 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
38971 : * ssmaxin = ssmax
38972 : *
38973 : */
38974 42 : __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
38975 42 : __Pyx_GOTREF(__pyx_t_2);
38976 42 : __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L1_error)
38977 42 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38978 658 : __pyx_v_ssmax = __pyx_t_16;
38979 :
38980 : /* "scipy/linalg/_decomp_interpolative.pyx":995
38981 : * kpiv = np.argmax(col_norms)
38982 : * ssmax = col_norms[kpiv]
38983 : * ssmaxin = ssmax # <<<<<<<<<<<<<<
38984 : *
38985 : * for loop in range(loops):
38986 : */
38987 : __pyx_v_ssmaxin = __pyx_v_ssmax;
38988 :
38989 : /* "scipy/linalg/_decomp_interpolative.pyx":997
38990 : * ssmaxin = ssmax
38991 : *
38992 : * for loop in range(loops): # <<<<<<<<<<<<<<
38993 : *
38994 : * ind[loop] = kpiv
38995 : */
38996 658 : __pyx_t_6 = __pyx_v_loops;
38997 658 : __pyx_t_8 = __pyx_t_6;
38998 658 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
38999 616 : __pyx_v_loop = __pyx_t_7;
39000 :
39001 : /* "scipy/linalg/_decomp_interpolative.pyx":999
39002 : * for loop in range(loops):
39003 : *
39004 : * ind[loop] = kpiv # <<<<<<<<<<<<<<
39005 : * # Swap columns a[:, k] and a[:, kpiv]
39006 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]]
39007 : */
39008 616 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
39009 616 : __Pyx_GOTREF(__pyx_t_2);
39010 616 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_ind), __pyx_v_loop, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 999, __pyx_L1_error)
39011 616 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39012 :
39013 : /* "scipy/linalg/_decomp_interpolative.pyx":1001
39014 : * ind[loop] = kpiv
39015 : * # Swap columns a[:, k] and a[:, kpiv]
39016 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]] # <<<<<<<<<<<<<<
39017 : * # Swap col_norms[krank] and col_norms[kpiv]
39018 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
39019 : */
39020 616 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
39021 616 : __Pyx_GOTREF(__pyx_t_2);
39022 616 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error)
39023 616 : __Pyx_GOTREF(__pyx_t_11);
39024 616 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1001, __pyx_L1_error)
39025 616 : __Pyx_GOTREF(__pyx_t_12);
39026 616 : __Pyx_GIVEREF(__pyx_t_2);
39027 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error);
39028 616 : __Pyx_GIVEREF(__pyx_t_11);
39029 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error);
39030 616 : __pyx_t_2 = 0;
39031 616 : __pyx_t_11 = 0;
39032 616 : __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error)
39033 616 : __Pyx_GOTREF(__pyx_t_11);
39034 616 : __Pyx_INCREF(__pyx_slice__5);
39035 616 : __Pyx_GIVEREF(__pyx_slice__5);
39036 616 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_slice__5)) __PYX_ERR(0, 1001, __pyx_L1_error);
39037 616 : __Pyx_GIVEREF(__pyx_t_12);
39038 616 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(0, 1001, __pyx_L1_error);
39039 616 : __pyx_t_12 = 0;
39040 616 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1001, __pyx_L1_error)
39041 616 : __Pyx_GOTREF(__pyx_t_12);
39042 616 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
39043 616 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error)
39044 616 : __Pyx_GOTREF(__pyx_t_11);
39045 616 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
39046 616 : __Pyx_GOTREF(__pyx_t_2);
39047 616 : __pyx_t_17 = PyList_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1001, __pyx_L1_error)
39048 616 : __Pyx_GOTREF(__pyx_t_17);
39049 616 : __Pyx_GIVEREF(__pyx_t_11);
39050 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_11)) __PYX_ERR(0, 1001, __pyx_L1_error);
39051 616 : __Pyx_GIVEREF(__pyx_t_2);
39052 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error);
39053 616 : __pyx_t_11 = 0;
39054 616 : __pyx_t_2 = 0;
39055 616 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
39056 616 : __Pyx_GOTREF(__pyx_t_2);
39057 616 : __Pyx_INCREF(__pyx_slice__5);
39058 616 : __Pyx_GIVEREF(__pyx_slice__5);
39059 616 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1001, __pyx_L1_error);
39060 616 : __Pyx_GIVEREF(__pyx_t_17);
39061 616 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_17)) __PYX_ERR(0, 1001, __pyx_L1_error);
39062 616 : __pyx_t_17 = 0;
39063 616 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_12) < 0))) __PYX_ERR(0, 1001, __pyx_L1_error)
39064 616 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39065 616 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39066 :
39067 : /* "scipy/linalg/_decomp_interpolative.pyx":1003
39068 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]]
39069 : * # Swap col_norms[krank] and col_norms[kpiv]
39070 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]] # <<<<<<<<<<<<<<
39071 : *
39072 : * if loop < m-1:
39073 : */
39074 616 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1003, __pyx_L1_error)
39075 616 : __Pyx_GOTREF(__pyx_t_12);
39076 616 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
39077 616 : __Pyx_GOTREF(__pyx_t_2);
39078 616 : __pyx_t_17 = PyList_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1003, __pyx_L1_error)
39079 616 : __Pyx_GOTREF(__pyx_t_17);
39080 616 : __Pyx_GIVEREF(__pyx_t_12);
39081 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_12)) __PYX_ERR(0, 1003, __pyx_L1_error);
39082 616 : __Pyx_GIVEREF(__pyx_t_2);
39083 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error);
39084 616 : __pyx_t_12 = 0;
39085 616 : __pyx_t_2 = 0;
39086 616 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
39087 616 : __Pyx_GOTREF(__pyx_t_2);
39088 616 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
39089 616 : __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1003, __pyx_L1_error)
39090 616 : __Pyx_GOTREF(__pyx_t_17);
39091 616 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1003, __pyx_L1_error)
39092 616 : __Pyx_GOTREF(__pyx_t_12);
39093 616 : __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1003, __pyx_L1_error)
39094 616 : __Pyx_GOTREF(__pyx_t_11);
39095 616 : __Pyx_GIVEREF(__pyx_t_17);
39096 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_17)) __PYX_ERR(0, 1003, __pyx_L1_error);
39097 616 : __Pyx_GIVEREF(__pyx_t_12);
39098 616 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(0, 1003, __pyx_L1_error);
39099 616 : __pyx_t_17 = 0;
39100 616 : __pyx_t_12 = 0;
39101 616 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_11, __pyx_t_2) < 0))) __PYX_ERR(0, 1003, __pyx_L1_error)
39102 616 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
39103 616 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39104 :
39105 : /* "scipy/linalg/_decomp_interpolative.pyx":1005
39106 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
39107 : *
39108 : * if loop < m-1: # <<<<<<<<<<<<<<
39109 : * tmp_sca = a[loop, loop]
39110 : * # FIX: Convert these to F_INT
39111 : */
39112 616 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_m - 1));
39113 616 : if (__pyx_t_9) {
39114 :
39115 : /* "scipy/linalg/_decomp_interpolative.pyx":1006
39116 : *
39117 : * if loop < m-1:
39118 : * tmp_sca = a[loop, loop] # <<<<<<<<<<<<<<
39119 : * # FIX: Convert these to F_INT
39120 : * tmp_int = <int>(m - loop)
39121 : */
39122 613 : __pyx_t_14 = __pyx_v_loop;
39123 613 : __pyx_t_13 = __pyx_v_loop;
39124 613 : __pyx_v_tmp_sca = (*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_a.diminfo[1].strides));
39125 :
39126 : /* "scipy/linalg/_decomp_interpolative.pyx":1008
39127 : * tmp_sca = a[loop, loop]
39128 : * # FIX: Convert these to F_INT
39129 : * tmp_int = <int>(m - loop) # <<<<<<<<<<<<<<
39130 : * int_n = <int>n
39131 : * dlarfgp(&tmp_int, &tmp_sca, &a[loop+1, loop], &int_n, &taus_v[loop])
39132 : */
39133 613 : __pyx_v_tmp_int = ((int)(__pyx_v_m - __pyx_v_loop));
39134 :
39135 : /* "scipy/linalg/_decomp_interpolative.pyx":1009
39136 : * # FIX: Convert these to F_INT
39137 : * tmp_int = <int>(m - loop)
39138 : * int_n = <int>n # <<<<<<<<<<<<<<
39139 : * dlarfgp(&tmp_int, &tmp_sca, &a[loop+1, loop], &int_n, &taus_v[loop])
39140 : *
39141 : */
39142 613 : __pyx_v_int_n = ((int)__pyx_v_n);
39143 :
39144 : /* "scipy/linalg/_decomp_interpolative.pyx":1010
39145 : * tmp_int = <int>(m - loop)
39146 : * int_n = <int>n
39147 : * dlarfgp(&tmp_int, &tmp_sca, &a[loop+1, loop], &int_n, &taus_v[loop]) # <<<<<<<<<<<<<<
39148 : *
39149 : * # Overwrite with 1. for easy matmul
39150 : */
39151 613 : __pyx_t_13 = (__pyx_v_loop + 1);
39152 613 : __pyx_t_14 = __pyx_v_loop;
39153 613 : __pyx_t_18 = __pyx_v_loop;
39154 613 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp((&__pyx_v_tmp_int), (&__pyx_v_tmp_sca), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_int_n), (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_taus_v.data) + __pyx_t_18)) )))));
39155 :
39156 : /* "scipy/linalg/_decomp_interpolative.pyx":1013
39157 : *
39158 : * # Overwrite with 1. for easy matmul
39159 : * a[loop, loop] = 1 # <<<<<<<<<<<<<<
39160 : * if loop < n-1:
39161 : * # Apply the householder reflector to the rest on the right
39162 : */
39163 613 : __pyx_t_18 = __pyx_v_loop;
39164 613 : __pyx_t_14 = __pyx_v_loop;
39165 613 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_a.diminfo[1].strides) = 1.0;
39166 :
39167 : /* "scipy/linalg/_decomp_interpolative.pyx":1014
39168 : * # Overwrite with 1. for easy matmul
39169 : * a[loop, loop] = 1
39170 : * if loop < n-1: # <<<<<<<<<<<<<<
39171 : * # Apply the householder reflector to the rest on the right
39172 : * a[loop:, loop+1:] -= np.outer(taus[loop]*a[loop:, loop],
39173 : */
39174 613 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
39175 613 : if (__pyx_t_9) {
39176 :
39177 : /* "scipy/linalg/_decomp_interpolative.pyx":1016
39178 : * if loop < n-1:
39179 : * # Apply the householder reflector to the rest on the right
39180 : * a[loop:, loop+1:] -= np.outer(taus[loop]*a[loop:, loop], # <<<<<<<<<<<<<<
39181 : * a[loop:, loop] @ a[loop:, loop+1:])
39182 : *
39183 : */
39184 600 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
39185 600 : __Pyx_GOTREF(__pyx_t_2);
39186 600 : __pyx_t_11 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1016, __pyx_L1_error)
39187 600 : __Pyx_GOTREF(__pyx_t_11);
39188 600 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39189 600 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
39190 600 : __Pyx_GOTREF(__pyx_t_2);
39191 600 : __pyx_t_12 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1016, __pyx_L1_error)
39192 600 : __Pyx_GOTREF(__pyx_t_12);
39193 600 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39194 600 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
39195 600 : __Pyx_GOTREF(__pyx_t_2);
39196 600 : __Pyx_GIVEREF(__pyx_t_11);
39197 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11)) __PYX_ERR(0, 1016, __pyx_L1_error);
39198 600 : __Pyx_GIVEREF(__pyx_t_12);
39199 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12)) __PYX_ERR(0, 1016, __pyx_L1_error);
39200 600 : __pyx_t_11 = 0;
39201 600 : __pyx_t_12 = 0;
39202 600 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1016, __pyx_L1_error)
39203 600 : __Pyx_GOTREF(__pyx_t_12);
39204 600 : __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1016, __pyx_L1_error)
39205 600 : __Pyx_GOTREF(__pyx_t_17);
39206 600 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_outer); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1016, __pyx_L1_error)
39207 600 : __Pyx_GOTREF(__pyx_t_19);
39208 600 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
39209 600 : __pyx_t_17 = __Pyx_GetItemInt(((PyObject *)__pyx_v_taus), __pyx_v_loop, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1016, __pyx_L1_error)
39210 600 : __Pyx_GOTREF(__pyx_t_17);
39211 600 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1016, __pyx_L1_error)
39212 600 : __Pyx_GOTREF(__pyx_t_20);
39213 600 : __pyx_t_21 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1016, __pyx_L1_error)
39214 600 : __Pyx_GOTREF(__pyx_t_21);
39215 600 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
39216 600 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1016, __pyx_L1_error)
39217 600 : __Pyx_GOTREF(__pyx_t_20);
39218 600 : __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1016, __pyx_L1_error)
39219 600 : __Pyx_GOTREF(__pyx_t_22);
39220 600 : __Pyx_GIVEREF(__pyx_t_21);
39221 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21)) __PYX_ERR(0, 1016, __pyx_L1_error);
39222 600 : __Pyx_GIVEREF(__pyx_t_20);
39223 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20)) __PYX_ERR(0, 1016, __pyx_L1_error);
39224 600 : __pyx_t_21 = 0;
39225 600 : __pyx_t_20 = 0;
39226 600 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1016, __pyx_L1_error)
39227 600 : __Pyx_GOTREF(__pyx_t_20);
39228 600 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
39229 600 : __pyx_t_22 = PyNumber_Multiply(__pyx_t_17, __pyx_t_20); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1016, __pyx_L1_error)
39230 600 : __Pyx_GOTREF(__pyx_t_22);
39231 600 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
39232 600 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
39233 :
39234 : /* "scipy/linalg/_decomp_interpolative.pyx":1017
39235 : * # Apply the householder reflector to the rest on the right
39236 : * a[loop:, loop+1:] -= np.outer(taus[loop]*a[loop:, loop],
39237 : * a[loop:, loop] @ a[loop:, loop+1:]) # <<<<<<<<<<<<<<
39238 : *
39239 : * # Put back the beta in place
39240 : */
39241 600 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1017, __pyx_L1_error)
39242 600 : __Pyx_GOTREF(__pyx_t_20);
39243 600 : __pyx_t_17 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1017, __pyx_L1_error)
39244 600 : __Pyx_GOTREF(__pyx_t_17);
39245 600 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
39246 600 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1017, __pyx_L1_error)
39247 600 : __Pyx_GOTREF(__pyx_t_20);
39248 600 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1017, __pyx_L1_error)
39249 600 : __Pyx_GOTREF(__pyx_t_21);
39250 600 : __Pyx_GIVEREF(__pyx_t_17);
39251 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_17)) __PYX_ERR(0, 1017, __pyx_L1_error);
39252 600 : __Pyx_GIVEREF(__pyx_t_20);
39253 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20)) __PYX_ERR(0, 1017, __pyx_L1_error);
39254 600 : __pyx_t_17 = 0;
39255 600 : __pyx_t_20 = 0;
39256 600 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1017, __pyx_L1_error)
39257 600 : __Pyx_GOTREF(__pyx_t_20);
39258 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39259 600 : __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1017, __pyx_L1_error)
39260 600 : __Pyx_GOTREF(__pyx_t_21);
39261 600 : __pyx_t_17 = PySlice_New(__pyx_t_21, Py_None, Py_None); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1017, __pyx_L1_error)
39262 600 : __Pyx_GOTREF(__pyx_t_17);
39263 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39264 600 : __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1017, __pyx_L1_error)
39265 600 : __Pyx_GOTREF(__pyx_t_21);
39266 600 : __pyx_t_23 = PySlice_New(__pyx_t_21, Py_None, Py_None); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1017, __pyx_L1_error)
39267 600 : __Pyx_GOTREF(__pyx_t_23);
39268 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39269 600 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1017, __pyx_L1_error)
39270 600 : __Pyx_GOTREF(__pyx_t_21);
39271 600 : __Pyx_GIVEREF(__pyx_t_17);
39272 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_17)) __PYX_ERR(0, 1017, __pyx_L1_error);
39273 600 : __Pyx_GIVEREF(__pyx_t_23);
39274 600 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_23)) __PYX_ERR(0, 1017, __pyx_L1_error);
39275 600 : __pyx_t_17 = 0;
39276 600 : __pyx_t_23 = 0;
39277 600 : __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1017, __pyx_L1_error)
39278 600 : __Pyx_GOTREF(__pyx_t_23);
39279 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39280 600 : __pyx_t_21 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_20, __pyx_t_23); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1017, __pyx_L1_error)
39281 600 : __Pyx_GOTREF(__pyx_t_21);
39282 600 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
39283 600 : __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
39284 600 : __pyx_t_23 = NULL;
39285 600 : __pyx_t_15 = 0;
39286 : #if CYTHON_UNPACK_METHODS
39287 600 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
39288 0 : __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_19);
39289 0 : if (likely(__pyx_t_23)) {
39290 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
39291 0 : __Pyx_INCREF(__pyx_t_23);
39292 0 : __Pyx_INCREF(function);
39293 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
39294 : __pyx_t_15 = 1;
39295 : }
39296 : }
39297 : #endif
39298 : {
39299 600 : PyObject *__pyx_callargs[3] = {__pyx_t_23, __pyx_t_22, __pyx_t_21};
39300 600 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_15, 2+__pyx_t_15);
39301 600 : __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
39302 600 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
39303 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39304 600 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1016, __pyx_L1_error)
39305 600 : __Pyx_GOTREF(__pyx_t_11);
39306 600 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39307 : }
39308 :
39309 : /* "scipy/linalg/_decomp_interpolative.pyx":1016
39310 : * if loop < n-1:
39311 : * # Apply the householder reflector to the rest on the right
39312 : * a[loop:, loop+1:] -= np.outer(taus[loop]*a[loop:, loop], # <<<<<<<<<<<<<<
39313 : * a[loop:, loop] @ a[loop:, loop+1:])
39314 : *
39315 : */
39316 600 : __pyx_t_19 = PyNumber_InPlaceSubtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1016, __pyx_L1_error)
39317 600 : __Pyx_GOTREF(__pyx_t_19);
39318 600 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39319 600 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
39320 600 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_19) < 0))) __PYX_ERR(0, 1016, __pyx_L1_error)
39321 600 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39322 600 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39323 :
39324 : /* "scipy/linalg/_decomp_interpolative.pyx":1014
39325 : * # Overwrite with 1. for easy matmul
39326 : * a[loop, loop] = 1
39327 : * if loop < n-1: # <<<<<<<<<<<<<<
39328 : * # Apply the householder reflector to the rest on the right
39329 : * a[loop:, loop+1:] -= np.outer(taus[loop]*a[loop:, loop],
39330 : */
39331 : }
39332 :
39333 : /* "scipy/linalg/_decomp_interpolative.pyx":1020
39334 : *
39335 : * # Put back the beta in place
39336 : * a[loop, loop] = tmp_sca # <<<<<<<<<<<<<<
39337 : *
39338 : * # Update the norms
39339 : */
39340 613 : __pyx_t_14 = __pyx_v_loop;
39341 613 : __pyx_t_18 = __pyx_v_loop;
39342 613 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_v_tmp_sca;
39343 :
39344 : /* "scipy/linalg/_decomp_interpolative.pyx":1023
39345 : *
39346 : * # Update the norms
39347 : * col_norms[loop] = 0 # <<<<<<<<<<<<<<
39348 : * col_norms[loop+1:] -= a[loop, loop+1:]**2
39349 : * ssmax = 0
39350 : */
39351 613 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_loop, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1023, __pyx_L1_error)
39352 :
39353 : /* "scipy/linalg/_decomp_interpolative.pyx":1024
39354 : * # Update the norms
39355 : * col_norms[loop] = 0
39356 : * col_norms[loop+1:] -= a[loop, loop+1:]**2 # <<<<<<<<<<<<<<
39357 : * ssmax = 0
39358 : * kpiv = loop+1
39359 : */
39360 613 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error)
39361 613 : __Pyx_GOTREF(__pyx_t_2);
39362 613 : __pyx_t_19 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1024, __pyx_L1_error)
39363 613 : __Pyx_GOTREF(__pyx_t_19);
39364 613 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39365 613 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error)
39366 613 : __Pyx_GOTREF(__pyx_t_2);
39367 613 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __pyx_L1_error)
39368 613 : __Pyx_GOTREF(__pyx_t_11);
39369 613 : __pyx_t_12 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1024, __pyx_L1_error)
39370 613 : __Pyx_GOTREF(__pyx_t_12);
39371 613 : __pyx_t_21 = PySlice_New(__pyx_t_12, Py_None, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1024, __pyx_L1_error)
39372 613 : __Pyx_GOTREF(__pyx_t_21);
39373 613 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39374 613 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1024, __pyx_L1_error)
39375 613 : __Pyx_GOTREF(__pyx_t_12);
39376 613 : __Pyx_GIVEREF(__pyx_t_11);
39377 613 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 1024, __pyx_L1_error);
39378 613 : __Pyx_GIVEREF(__pyx_t_21);
39379 613 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_21)) __PYX_ERR(0, 1024, __pyx_L1_error);
39380 613 : __pyx_t_11 = 0;
39381 613 : __pyx_t_21 = 0;
39382 613 : __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1024, __pyx_L1_error)
39383 613 : __Pyx_GOTREF(__pyx_t_21);
39384 613 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39385 613 : __pyx_t_12 = PyNumber_Power(__pyx_t_21, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1024, __pyx_L1_error)
39386 613 : __Pyx_GOTREF(__pyx_t_12);
39387 613 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39388 613 : __pyx_t_21 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1024, __pyx_L1_error)
39389 613 : __Pyx_GOTREF(__pyx_t_21);
39390 613 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39391 613 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39392 613 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_19, __pyx_t_21) < 0))) __PYX_ERR(0, 1024, __pyx_L1_error)
39393 613 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39394 613 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39395 :
39396 : /* "scipy/linalg/_decomp_interpolative.pyx":1025
39397 : * col_norms[loop] = 0
39398 : * col_norms[loop+1:] -= a[loop, loop+1:]**2
39399 : * ssmax = 0 # <<<<<<<<<<<<<<
39400 : * kpiv = loop+1
39401 : *
39402 : */
39403 613 : __pyx_v_ssmax = 0.0;
39404 :
39405 : /* "scipy/linalg/_decomp_interpolative.pyx":1026
39406 : * col_norms[loop+1:] -= a[loop, loop+1:]**2
39407 : * ssmax = 0
39408 : * kpiv = loop+1 # <<<<<<<<<<<<<<
39409 : *
39410 : * if loop < n-1:
39411 : */
39412 613 : __pyx_v_kpiv = (__pyx_v_loop + 1);
39413 :
39414 : /* "scipy/linalg/_decomp_interpolative.pyx":1028
39415 : * kpiv = loop+1
39416 : *
39417 : * if loop < n-1: # <<<<<<<<<<<<<<
39418 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39419 : * ssmax = col_norms[kpiv]
39420 : */
39421 613 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
39422 613 : if (__pyx_t_9) {
39423 :
39424 : /* "scipy/linalg/_decomp_interpolative.pyx":1029
39425 : *
39426 : * if loop < n-1:
39427 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1) # <<<<<<<<<<<<<<
39428 : * ssmax = col_norms[kpiv]
39429 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
39430 : */
39431 600 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1029, __pyx_L1_error)
39432 600 : __Pyx_GOTREF(__pyx_t_21);
39433 600 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_argmax); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1029, __pyx_L1_error)
39434 600 : __Pyx_GOTREF(__pyx_t_12);
39435 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39436 600 : __pyx_t_21 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_loop + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1029, __pyx_L1_error)
39437 600 : __Pyx_GOTREF(__pyx_t_21);
39438 600 : __pyx_t_2 = NULL;
39439 600 : __pyx_t_15 = 0;
39440 : #if CYTHON_UNPACK_METHODS
39441 600 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
39442 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
39443 0 : if (likely(__pyx_t_2)) {
39444 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
39445 0 : __Pyx_INCREF(__pyx_t_2);
39446 0 : __Pyx_INCREF(function);
39447 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
39448 : __pyx_t_15 = 1;
39449 : }
39450 : }
39451 : #endif
39452 : {
39453 600 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_21};
39454 600 : __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
39455 600 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
39456 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39457 600 : if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1029, __pyx_L1_error)
39458 600 : __Pyx_GOTREF(__pyx_t_19);
39459 600 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39460 : }
39461 600 : __pyx_t_12 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1029, __pyx_L1_error)
39462 600 : __Pyx_GOTREF(__pyx_t_12);
39463 600 : __pyx_t_21 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1029, __pyx_L1_error)
39464 600 : __Pyx_GOTREF(__pyx_t_21);
39465 600 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39466 600 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39467 600 : __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_21); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error)
39468 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39469 600 : __pyx_v_kpiv = __pyx_t_24;
39470 :
39471 : /* "scipy/linalg/_decomp_interpolative.pyx":1030
39472 : * if loop < n-1:
39473 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39474 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
39475 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
39476 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39477 : */
39478 600 : __pyx_t_21 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1030, __pyx_L1_error)
39479 600 : __Pyx_GOTREF(__pyx_t_21);
39480 600 : __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_21); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1030, __pyx_L1_error)
39481 600 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39482 : __pyx_v_ssmax = __pyx_t_16;
39483 :
39484 : /* "scipy/linalg/_decomp_interpolative.pyx":1028
39485 : * kpiv = loop+1
39486 : *
39487 : * if loop < n-1: # <<<<<<<<<<<<<<
39488 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39489 : * ssmax = col_norms[kpiv]
39490 : */
39491 : }
39492 :
39493 : /* "scipy/linalg/_decomp_interpolative.pyx":1031
39494 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39495 : * ssmax = col_norms[kpiv]
39496 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
39497 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39498 : * nupdate += 1
39499 : */
39500 613 : __pyx_t_25 = (__pyx_v_ssmax < ((1000.0 * __pyx_v_feps) * __pyx_v_ssmaxin));
39501 613 : if (!__pyx_t_25) {
39502 473 : goto __pyx_L12_next_or;
39503 : } else {
39504 140 : }
39505 140 : __pyx_t_25 = (__pyx_v_nupdate == 0);
39506 140 : if (!__pyx_t_25) {
39507 : } else {
39508 37 : __pyx_t_9 = __pyx_t_25;
39509 37 : goto __pyx_L11_bool_binop_done;
39510 : }
39511 576 : __pyx_L12_next_or:;
39512 :
39513 : /* "scipy/linalg/_decomp_interpolative.pyx":1032
39514 : * ssmax = col_norms[kpiv]
39515 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
39516 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))): # <<<<<<<<<<<<<<
39517 : * nupdate += 1
39518 : * ssmax = 0
39519 : */
39520 576 : __pyx_t_25 = (__pyx_v_ssmax < (pow((1000.0 * __pyx_v_feps), 2.0) * __pyx_v_ssmaxin));
39521 576 : if (__pyx_t_25) {
39522 9 : } else {
39523 567 : __pyx_t_9 = __pyx_t_25;
39524 567 : goto __pyx_L11_bool_binop_done;
39525 : }
39526 9 : __pyx_t_25 = (__pyx_v_nupdate == 1);
39527 9 : __pyx_t_9 = __pyx_t_25;
39528 613 : __pyx_L11_bool_binop_done:;
39529 :
39530 : /* "scipy/linalg/_decomp_interpolative.pyx":1031
39531 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39532 : * ssmax = col_norms[kpiv]
39533 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
39534 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39535 : * nupdate += 1
39536 : */
39537 613 : if (__pyx_t_9) {
39538 :
39539 : /* "scipy/linalg/_decomp_interpolative.pyx":1033
39540 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
39541 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39542 : * nupdate += 1 # <<<<<<<<<<<<<<
39543 : * ssmax = 0
39544 : * kpiv = loop+1
39545 : */
39546 44 : __pyx_v_nupdate = (__pyx_v_nupdate + 1);
39547 :
39548 : /* "scipy/linalg/_decomp_interpolative.pyx":1034
39549 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39550 : * nupdate += 1
39551 : * ssmax = 0 # <<<<<<<<<<<<<<
39552 : * kpiv = loop+1
39553 : *
39554 : */
39555 44 : __pyx_v_ssmax = 0.0;
39556 :
39557 : /* "scipy/linalg/_decomp_interpolative.pyx":1035
39558 : * nupdate += 1
39559 : * ssmax = 0
39560 : * kpiv = loop+1 # <<<<<<<<<<<<<<
39561 : *
39562 : * if loop < n-1:
39563 : */
39564 44 : __pyx_v_kpiv = (__pyx_v_loop + 1);
39565 :
39566 : /* "scipy/linalg/_decomp_interpolative.pyx":1037
39567 : * kpiv = loop+1
39568 : *
39569 : * if loop < n-1: # <<<<<<<<<<<<<<
39570 : * for i in range(loop+1, n):
39571 : * tmp_int = m-loop-1
39572 : */
39573 44 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
39574 44 : if (__pyx_t_9) {
39575 :
39576 : /* "scipy/linalg/_decomp_interpolative.pyx":1038
39577 : *
39578 : * if loop < n-1:
39579 : * for i in range(loop+1, n): # <<<<<<<<<<<<<<
39580 : * tmp_int = m-loop-1
39581 : * col_norms[i] = dnrm2(&tmp_int, &a[loop+1, i], &n)**2
39582 : */
39583 2991 : __pyx_t_24 = __pyx_v_n;
39584 : __pyx_t_26 = __pyx_t_24;
39585 2991 : for (__pyx_t_27 = (__pyx_v_loop + 1); __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
39586 2960 : __pyx_v_i = __pyx_t_27;
39587 :
39588 : /* "scipy/linalg/_decomp_interpolative.pyx":1039
39589 : * if loop < n-1:
39590 : * for i in range(loop+1, n):
39591 : * tmp_int = m-loop-1 # <<<<<<<<<<<<<<
39592 : * col_norms[i] = dnrm2(&tmp_int, &a[loop+1, i], &n)**2
39593 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39594 : */
39595 2960 : __pyx_v_tmp_int = ((__pyx_v_m - __pyx_v_loop) - 1);
39596 :
39597 : /* "scipy/linalg/_decomp_interpolative.pyx":1040
39598 : * for i in range(loop+1, n):
39599 : * tmp_int = m-loop-1
39600 : * col_norms[i] = dnrm2(&tmp_int, &a[loop+1, i], &n)**2 # <<<<<<<<<<<<<<
39601 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39602 : * ssmax = col_norms[kpiv]
39603 : */
39604 2960 : __pyx_t_18 = (__pyx_v_loop + 1);
39605 2960 : __pyx_t_14 = __pyx_v_i;
39606 2960 : __pyx_t_21 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_tmp_int), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1040, __pyx_L1_error)
39607 2960 : __Pyx_GOTREF(__pyx_t_21);
39608 2960 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_21, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1040, __pyx_L1_error)
39609 5920 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39610 : }
39611 :
39612 : /* "scipy/linalg/_decomp_interpolative.pyx":1041
39613 : * tmp_int = m-loop-1
39614 : * col_norms[i] = dnrm2(&tmp_int, &a[loop+1, i], &n)**2
39615 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1) # <<<<<<<<<<<<<<
39616 : * ssmax = col_norms[kpiv]
39617 : *
39618 : */
39619 31 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1041, __pyx_L1_error)
39620 31 : __Pyx_GOTREF(__pyx_t_12);
39621 31 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_argmax); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1041, __pyx_L1_error)
39622 31 : __Pyx_GOTREF(__pyx_t_19);
39623 31 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39624 31 : __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_loop + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1041, __pyx_L1_error)
39625 31 : __Pyx_GOTREF(__pyx_t_12);
39626 31 : __pyx_t_2 = NULL;
39627 31 : __pyx_t_15 = 0;
39628 : #if CYTHON_UNPACK_METHODS
39629 31 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
39630 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_19);
39631 0 : if (likely(__pyx_t_2)) {
39632 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
39633 0 : __Pyx_INCREF(__pyx_t_2);
39634 0 : __Pyx_INCREF(function);
39635 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
39636 : __pyx_t_15 = 1;
39637 : }
39638 : }
39639 : #endif
39640 : {
39641 31 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_12};
39642 31 : __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
39643 31 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
39644 31 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39645 31 : if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1041, __pyx_L1_error)
39646 31 : __Pyx_GOTREF(__pyx_t_21);
39647 31 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39648 : }
39649 31 : __pyx_t_19 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1041, __pyx_L1_error)
39650 31 : __Pyx_GOTREF(__pyx_t_19);
39651 31 : __pyx_t_12 = PyNumber_Add(__pyx_t_21, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1041, __pyx_L1_error)
39652 31 : __Pyx_GOTREF(__pyx_t_12);
39653 31 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
39654 31 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
39655 31 : __pyx_t_24 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_24 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
39656 31 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39657 31 : __pyx_v_kpiv = __pyx_t_24;
39658 :
39659 : /* "scipy/linalg/_decomp_interpolative.pyx":1042
39660 : * col_norms[i] = dnrm2(&tmp_int, &a[loop+1, i], &n)**2
39661 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39662 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
39663 : *
39664 : * return ind, taus
39665 : */
39666 31 : __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1042, __pyx_L1_error)
39667 31 : __Pyx_GOTREF(__pyx_t_12);
39668 31 : __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1042, __pyx_L1_error)
39669 31 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
39670 616 : __pyx_v_ssmax = __pyx_t_16;
39671 :
39672 : /* "scipy/linalg/_decomp_interpolative.pyx":1037
39673 : * kpiv = loop+1
39674 : *
39675 : * if loop < n-1: # <<<<<<<<<<<<<<
39676 : * for i in range(loop+1, n):
39677 : * tmp_int = m-loop-1
39678 : */
39679 : }
39680 :
39681 : /* "scipy/linalg/_decomp_interpolative.pyx":1031
39682 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
39683 : * ssmax = col_norms[kpiv]
39684 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
39685 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
39686 : * nupdate += 1
39687 : */
39688 : }
39689 :
39690 : /* "scipy/linalg/_decomp_interpolative.pyx":1005
39691 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
39692 : *
39693 : * if loop < m-1: # <<<<<<<<<<<<<<
39694 : * tmp_sca = a[loop, loop]
39695 : * # FIX: Convert these to F_INT
39696 : */
39697 : }
39698 : }
39699 :
39700 : /* "scipy/linalg/_decomp_interpolative.pyx":1044
39701 : * ssmax = col_norms[kpiv]
39702 : *
39703 : * return ind, taus # <<<<<<<<<<<<<<
39704 : *
39705 : *
39706 : */
39707 42 : __Pyx_XDECREF(__pyx_r);
39708 42 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1044, __pyx_L1_error)
39709 42 : __Pyx_GOTREF(__pyx_t_12);
39710 42 : __Pyx_INCREF((PyObject *)__pyx_v_ind);
39711 42 : __Pyx_GIVEREF((PyObject *)__pyx_v_ind);
39712 42 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_ind))) __PYX_ERR(0, 1044, __pyx_L1_error);
39713 42 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
39714 42 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
39715 42 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 1044, __pyx_L1_error);
39716 42 : __pyx_r = __pyx_t_12;
39717 42 : __pyx_t_12 = 0;
39718 42 : goto __pyx_L0;
39719 :
39720 : /* "scipy/linalg/_decomp_interpolative.pyx":977
39721 : *
39722 : *
39723 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int): # <<<<<<<<<<<<<<
39724 : * cdef int m = a.shape[0], n = a.shape[1]
39725 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
39726 : */
39727 :
39728 : /* function exit code */
39729 0 : __pyx_L1_error:;
39730 0 : __Pyx_XDECREF(__pyx_t_2);
39731 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
39732 0 : __Pyx_XDECREF(__pyx_t_10);
39733 0 : __Pyx_XDECREF(__pyx_t_11);
39734 0 : __Pyx_XDECREF(__pyx_t_12);
39735 0 : __Pyx_XDECREF(__pyx_t_17);
39736 0 : __Pyx_XDECREF(__pyx_t_19);
39737 0 : __Pyx_XDECREF(__pyx_t_20);
39738 0 : __Pyx_XDECREF(__pyx_t_21);
39739 0 : __Pyx_XDECREF(__pyx_t_22);
39740 0 : __Pyx_XDECREF(__pyx_t_23);
39741 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
39742 0 : __Pyx_PyThreadState_declare
39743 0 : __Pyx_PyThreadState_assign
39744 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
39745 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
39746 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
39747 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
39748 0 : __pyx_r = NULL;
39749 0 : goto __pyx_L2;
39750 42 : __pyx_L0:;
39751 42 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
39752 42 : __pyx_L2:;
39753 42 : __Pyx_XDECREF((PyObject *)__pyx_v_col_norms);
39754 42 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
39755 42 : __Pyx_XDECREF((PyObject *)__pyx_v_ind);
39756 42 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_taus_v, 1);
39757 42 : __Pyx_XGIVEREF(__pyx_r);
39758 42 : __Pyx_RefNannyFinishContext();
39759 42 : return __pyx_r;
39760 : }
39761 :
39762 : /* "scipy/linalg/_decomp_interpolative.pyx":1047
39763 : *
39764 : *
39765 : * def iddr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
39766 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
39767 : * cdef int L = min(krank+2, min(m, n))
39768 : */
39769 :
39770 : /* Python wrapper */
39771 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_35iddr_rid(PyObject *__pyx_self,
39772 : #if CYTHON_METH_FASTCALL
39773 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
39774 : #else
39775 : PyObject *__pyx_args, PyObject *__pyx_kwds
39776 : #endif
39777 : ); /*proto*/
39778 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_35iddr_rid = {"iddr_rid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_35iddr_rid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
39779 2 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_35iddr_rid(PyObject *__pyx_self,
39780 : #if CYTHON_METH_FASTCALL
39781 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
39782 : #else
39783 : PyObject *__pyx_args, PyObject *__pyx_kwds
39784 : #endif
39785 : ) {
39786 2 : PyObject *__pyx_v_A = 0;
39787 2 : int __pyx_v_krank;
39788 2 : PyObject *__pyx_v_rng = 0;
39789 : #if !CYTHON_METH_FASTCALL
39790 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
39791 : #endif
39792 2 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
39793 2 : PyObject* values[3] = {0,0,0};
39794 2 : int __pyx_lineno = 0;
39795 2 : const char *__pyx_filename = NULL;
39796 2 : int __pyx_clineno = 0;
39797 2 : PyObject *__pyx_r = 0;
39798 : __Pyx_RefNannyDeclarations
39799 2 : __Pyx_RefNannySetupContext("iddr_rid (wrapper)", 0);
39800 : #if !CYTHON_METH_FASTCALL
39801 : #if CYTHON_ASSUME_SAFE_MACROS
39802 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
39803 : #else
39804 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
39805 : #endif
39806 : #endif
39807 2 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
39808 : {
39809 2 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
39810 2 : if (likely(__pyx_kwds)) {
39811 2 : Py_ssize_t kw_args;
39812 2 : switch (__pyx_nargs) {
39813 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
39814 2 : CYTHON_FALLTHROUGH;
39815 2 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
39816 2 : CYTHON_FALLTHROUGH;
39817 2 : case 0: break;
39818 0 : default: goto __pyx_L5_argtuple_error;
39819 : }
39820 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
39821 2 : switch (__pyx_nargs) {
39822 : case 0:
39823 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
39824 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
39825 0 : kw_args--;
39826 : }
39827 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error)
39828 0 : else goto __pyx_L5_argtuple_error;
39829 0 : CYTHON_FALLTHROUGH;
39830 : case 1:
39831 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
39832 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
39833 0 : kw_args--;
39834 : }
39835 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error)
39836 : else {
39837 0 : __Pyx_RaiseArgtupleInvalid("iddr_rid", 1, 2, 2, 1); __PYX_ERR(0, 1047, __pyx_L3_error)
39838 : }
39839 2 : CYTHON_FALLTHROUGH;
39840 : case 2:
39841 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
39842 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
39843 2 : kw_args--;
39844 : }
39845 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error)
39846 : else {
39847 0 : __Pyx_RaiseKeywordRequired("iddr_rid", __pyx_n_s_rng); __PYX_ERR(0, 1047, __pyx_L3_error)
39848 : }
39849 : }
39850 2 : if (unlikely(kw_args > 0)) {
39851 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
39852 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_rid") < 0)) __PYX_ERR(0, 1047, __pyx_L3_error)
39853 : }
39854 0 : } else if (unlikely(__pyx_nargs != 2)) {
39855 0 : goto __pyx_L5_argtuple_error;
39856 : } else {
39857 0 : __Pyx_RaiseKeywordRequired("iddr_rid", __pyx_n_s_rng); __PYX_ERR(0, 1047, __pyx_L3_error)
39858 : }
39859 2 : __pyx_v_A = values[0];
39860 2 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error)
39861 2 : __pyx_v_rng = values[2];
39862 : }
39863 2 : goto __pyx_L6_skip;
39864 0 : __pyx_L5_argtuple_error:;
39865 0 : __Pyx_RaiseArgtupleInvalid("iddr_rid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1047, __pyx_L3_error)
39866 2 : __pyx_L6_skip:;
39867 2 : goto __pyx_L4_argument_unpacking_done;
39868 0 : __pyx_L3_error:;
39869 : {
39870 0 : Py_ssize_t __pyx_temp;
39871 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
39872 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
39873 : }
39874 : }
39875 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
39876 0 : __Pyx_RefNannyFinishContext();
39877 0 : return NULL;
39878 2 : __pyx_L4_argument_unpacking_done:;
39879 2 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_34iddr_rid(__pyx_self, __pyx_v_A, __pyx_v_krank, __pyx_v_rng);
39880 :
39881 : /* function exit code */
39882 : {
39883 2 : Py_ssize_t __pyx_temp;
39884 2 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
39885 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
39886 : }
39887 : }
39888 : __Pyx_RefNannyFinishContext();
39889 : return __pyx_r;
39890 : }
39891 :
39892 2 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_34iddr_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng) {
39893 2 : int __pyx_v_m;
39894 2 : int __pyx_v_n;
39895 2 : int __pyx_v_k;
39896 2 : int __pyx_v_L;
39897 2 : PyArrayObject *__pyx_v_r = 0;
39898 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_r;
39899 2 : __Pyx_Buffer __pyx_pybuffer_r;
39900 2 : PyObject *__pyx_r = NULL;
39901 : __Pyx_RefNannyDeclarations
39902 2 : PyObject *__pyx_t_1 = NULL;
39903 2 : PyObject *__pyx_t_2 = NULL;
39904 2 : int __pyx_t_3;
39905 2 : int __pyx_t_4;
39906 2 : int __pyx_t_5;
39907 2 : int __pyx_t_6;
39908 2 : long __pyx_t_7;
39909 2 : long __pyx_t_8;
39910 2 : npy_intp __pyx_t_9[2];
39911 2 : PyArrayObject *__pyx_t_10 = NULL;
39912 2 : PyObject *__pyx_t_11 = NULL;
39913 2 : PyObject *__pyx_t_12 = NULL;
39914 2 : PyObject *__pyx_t_13 = NULL;
39915 2 : PyObject *__pyx_t_14 = NULL;
39916 2 : PyObject *__pyx_t_15 = NULL;
39917 2 : PyObject *__pyx_t_16 = NULL;
39918 2 : unsigned int __pyx_t_17;
39919 2 : int __pyx_lineno = 0;
39920 2 : const char *__pyx_filename = NULL;
39921 2 : int __pyx_clineno = 0;
39922 2 : __Pyx_RefNannySetupContext("iddr_rid", 1);
39923 2 : __pyx_pybuffer_r.pybuffer.buf = NULL;
39924 2 : __pyx_pybuffer_r.refcount = 0;
39925 2 : __pyx_pybuffernd_r.data = NULL;
39926 2 : __pyx_pybuffernd_r.rcbuffer = &__pyx_pybuffer_r;
39927 :
39928 : /* "scipy/linalg/_decomp_interpolative.pyx":1048
39929 : *
39930 : * def iddr_rid(A: LinearOperator, int krank, *, rng):
39931 : * cdef int m = A.shape[0], n = A.shape[1], k = 0 # <<<<<<<<<<<<<<
39932 : * cdef int L = min(krank+2, min(m, n))
39933 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] r
39934 : */
39935 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
39936 2 : __Pyx_GOTREF(__pyx_t_1);
39937 2 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
39938 2 : __Pyx_GOTREF(__pyx_t_2);
39939 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39940 2 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L1_error)
39941 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39942 2 : __pyx_v_m = __pyx_t_3;
39943 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
39944 2 : __Pyx_GOTREF(__pyx_t_2);
39945 2 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
39946 2 : __Pyx_GOTREF(__pyx_t_1);
39947 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39948 2 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L1_error)
39949 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39950 2 : __pyx_v_n = __pyx_t_3;
39951 2 : __pyx_v_k = 0;
39952 :
39953 : /* "scipy/linalg/_decomp_interpolative.pyx":1049
39954 : * def iddr_rid(A: LinearOperator, int krank, *, rng):
39955 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
39956 : * cdef int L = min(krank+2, min(m, n)) # <<<<<<<<<<<<<<
39957 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] r
39958 : *
39959 : */
39960 2 : __pyx_t_3 = __pyx_v_n;
39961 2 : __pyx_t_4 = __pyx_v_m;
39962 2 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
39963 2 : if (__pyx_t_6) {
39964 : __pyx_t_5 = __pyx_t_3;
39965 : } else {
39966 : __pyx_t_5 = __pyx_t_4;
39967 : }
39968 2 : __pyx_t_3 = __pyx_t_5;
39969 2 : __pyx_t_7 = (__pyx_v_krank + 2);
39970 2 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_7);
39971 2 : if (__pyx_t_6) {
39972 : __pyx_t_8 = __pyx_t_3;
39973 : } else {
39974 : __pyx_t_8 = __pyx_t_7;
39975 : }
39976 2 : __pyx_v_L = __pyx_t_8;
39977 :
39978 : /* "scipy/linalg/_decomp_interpolative.pyx":1052
39979 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] r
39980 : *
39981 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
39982 : * for k in range(L):
39983 : * r[k, :] = A.rmatvec(rng.uniform(size=m))
39984 : */
39985 2 : __pyx_t_9[0] = __pyx_v_L;
39986 2 : __pyx_t_9[1] = __pyx_v_n;
39987 2 : __pyx_t_1 = PyArray_EMPTY(2, __pyx_t_9, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
39988 2 : __Pyx_GOTREF(__pyx_t_1);
39989 2 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1052, __pyx_L1_error)
39990 2 : __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
39991 : {
39992 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
39993 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
39994 2 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
39995 2 : if (unlikely(__pyx_t_3 < 0)) {
39996 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
39997 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_r, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
39998 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
39999 : __Pyx_RaiseBufferFallbackError();
40000 : } else {
40001 0 : PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
40002 : }
40003 0 : __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
40004 : }
40005 2 : __pyx_pybuffernd_r.diminfo[0].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_r.diminfo[0].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_r.diminfo[1].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_r.diminfo[1].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[1];
40006 2 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1052, __pyx_L1_error)
40007 : }
40008 2 : __pyx_t_10 = 0;
40009 2 : __pyx_v_r = ((PyArrayObject *)__pyx_t_1);
40010 2 : __pyx_t_1 = 0;
40011 :
40012 : /* "scipy/linalg/_decomp_interpolative.pyx":1053
40013 : *
40014 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_FLOAT64, 0)
40015 : * for k in range(L): # <<<<<<<<<<<<<<
40016 : * r[k, :] = A.rmatvec(rng.uniform(size=m))
40017 : *
40018 : */
40019 2 : __pyx_t_3 = __pyx_v_L;
40020 2 : __pyx_t_5 = __pyx_t_3;
40021 46 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
40022 44 : __pyx_v_k = __pyx_t_4;
40023 :
40024 : /* "scipy/linalg/_decomp_interpolative.pyx":1054
40025 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_FLOAT64, 0)
40026 : * for k in range(L):
40027 : * r[k, :] = A.rmatvec(rng.uniform(size=m)) # <<<<<<<<<<<<<<
40028 : *
40029 : * return iddr_id(a=r, krank=krank)
40030 : */
40031 44 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
40032 44 : __Pyx_GOTREF(__pyx_t_2);
40033 44 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1054, __pyx_L1_error)
40034 44 : __Pyx_GOTREF(__pyx_t_14);
40035 44 : __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1054, __pyx_L1_error)
40036 44 : __Pyx_GOTREF(__pyx_t_15);
40037 44 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1054, __pyx_L1_error)
40038 44 : __Pyx_GOTREF(__pyx_t_16);
40039 44 : if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_size, __pyx_t_16) < 0) __PYX_ERR(0, 1054, __pyx_L1_error)
40040 44 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
40041 44 : __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1054, __pyx_L1_error)
40042 44 : __Pyx_GOTREF(__pyx_t_16);
40043 44 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40044 44 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
40045 44 : __pyx_t_15 = NULL;
40046 44 : __pyx_t_17 = 0;
40047 : #if CYTHON_UNPACK_METHODS
40048 44 : if (likely(PyMethod_Check(__pyx_t_2))) {
40049 44 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
40050 44 : if (likely(__pyx_t_15)) {
40051 44 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
40052 44 : __Pyx_INCREF(__pyx_t_15);
40053 44 : __Pyx_INCREF(function);
40054 44 : __Pyx_DECREF_SET(__pyx_t_2, function);
40055 : __pyx_t_17 = 1;
40056 : }
40057 : }
40058 : #endif
40059 : {
40060 44 : PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_16};
40061 44 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
40062 44 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
40063 44 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
40064 44 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
40065 44 : __Pyx_GOTREF(__pyx_t_1);
40066 44 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40067 : }
40068 44 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error)
40069 44 : __Pyx_GOTREF(__pyx_t_2);
40070 44 : __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1054, __pyx_L1_error)
40071 44 : __Pyx_GOTREF(__pyx_t_16);
40072 44 : __Pyx_GIVEREF(__pyx_t_2);
40073 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2)) __PYX_ERR(0, 1054, __pyx_L1_error);
40074 44 : __Pyx_INCREF(__pyx_slice__5);
40075 44 : __Pyx_GIVEREF(__pyx_slice__5);
40076 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_slice__5)) __PYX_ERR(0, 1054, __pyx_L1_error);
40077 44 : __pyx_t_2 = 0;
40078 44 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_r), __pyx_t_16, __pyx_t_1) < 0))) __PYX_ERR(0, 1054, __pyx_L1_error)
40079 44 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
40080 88 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40081 : }
40082 :
40083 : /* "scipy/linalg/_decomp_interpolative.pyx":1056
40084 : * r[k, :] = A.rmatvec(rng.uniform(size=m))
40085 : *
40086 : * return iddr_id(a=r, krank=krank) # <<<<<<<<<<<<<<
40087 : *
40088 : *
40089 : */
40090 2 : __Pyx_XDECREF(__pyx_r);
40091 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_iddr_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
40092 2 : __Pyx_GOTREF(__pyx_t_1);
40093 2 : __pyx_t_16 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1056, __pyx_L1_error)
40094 2 : __Pyx_GOTREF(__pyx_t_16);
40095 2 : if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_a, ((PyObject *)__pyx_v_r)) < 0) __PYX_ERR(0, 1056, __pyx_L1_error)
40096 2 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error)
40097 2 : __Pyx_GOTREF(__pyx_t_2);
40098 2 : if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_krank, __pyx_t_2) < 0) __PYX_ERR(0, 1056, __pyx_L1_error)
40099 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40100 2 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error)
40101 2 : __Pyx_GOTREF(__pyx_t_2);
40102 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40103 2 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
40104 2 : __pyx_r = __pyx_t_2;
40105 2 : __pyx_t_2 = 0;
40106 2 : goto __pyx_L0;
40107 :
40108 : /* "scipy/linalg/_decomp_interpolative.pyx":1047
40109 : *
40110 : *
40111 : * def iddr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
40112 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
40113 : * cdef int L = min(krank+2, min(m, n))
40114 : */
40115 :
40116 : /* function exit code */
40117 0 : __pyx_L1_error:;
40118 0 : __Pyx_XDECREF(__pyx_t_1);
40119 0 : __Pyx_XDECREF(__pyx_t_2);
40120 0 : __Pyx_XDECREF(__pyx_t_14);
40121 0 : __Pyx_XDECREF(__pyx_t_15);
40122 0 : __Pyx_XDECREF(__pyx_t_16);
40123 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
40124 0 : __Pyx_PyThreadState_declare
40125 0 : __Pyx_PyThreadState_assign
40126 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
40127 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
40128 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
40129 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
40130 0 : __pyx_r = NULL;
40131 0 : goto __pyx_L2;
40132 2 : __pyx_L0:;
40133 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
40134 2 : __pyx_L2:;
40135 2 : __Pyx_XDECREF((PyObject *)__pyx_v_r);
40136 2 : __Pyx_XGIVEREF(__pyx_r);
40137 2 : __Pyx_RefNannyFinishContext();
40138 2 : return __pyx_r;
40139 : }
40140 :
40141 : /* "scipy/linalg/_decomp_interpolative.pyx":1059
40142 : *
40143 : *
40144 : * def iddr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
40145 : * cdef int n = A.shape[1], j
40146 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
40147 : */
40148 :
40149 : /* Python wrapper */
40150 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_37iddr_rsvd(PyObject *__pyx_self,
40151 : #if CYTHON_METH_FASTCALL
40152 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
40153 : #else
40154 : PyObject *__pyx_args, PyObject *__pyx_kwds
40155 : #endif
40156 : ); /*proto*/
40157 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_37iddr_rsvd = {"iddr_rsvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_37iddr_rsvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
40158 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_37iddr_rsvd(PyObject *__pyx_self,
40159 : #if CYTHON_METH_FASTCALL
40160 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
40161 : #else
40162 : PyObject *__pyx_args, PyObject *__pyx_kwds
40163 : #endif
40164 : ) {
40165 1 : PyObject *__pyx_v_A = 0;
40166 1 : int __pyx_v_krank;
40167 1 : PyObject *__pyx_v_rng = 0;
40168 : #if !CYTHON_METH_FASTCALL
40169 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
40170 : #endif
40171 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
40172 1 : PyObject* values[3] = {0,0,0};
40173 1 : int __pyx_lineno = 0;
40174 1 : const char *__pyx_filename = NULL;
40175 1 : int __pyx_clineno = 0;
40176 1 : PyObject *__pyx_r = 0;
40177 : __Pyx_RefNannyDeclarations
40178 1 : __Pyx_RefNannySetupContext("iddr_rsvd (wrapper)", 0);
40179 : #if !CYTHON_METH_FASTCALL
40180 : #if CYTHON_ASSUME_SAFE_MACROS
40181 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
40182 : #else
40183 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
40184 : #endif
40185 : #endif
40186 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
40187 : {
40188 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
40189 1 : if (likely(__pyx_kwds)) {
40190 1 : Py_ssize_t kw_args;
40191 1 : switch (__pyx_nargs) {
40192 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
40193 1 : CYTHON_FALLTHROUGH;
40194 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
40195 1 : CYTHON_FALLTHROUGH;
40196 1 : case 0: break;
40197 0 : default: goto __pyx_L5_argtuple_error;
40198 : }
40199 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
40200 1 : switch (__pyx_nargs) {
40201 : case 0:
40202 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
40203 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
40204 0 : kw_args--;
40205 : }
40206 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
40207 0 : else goto __pyx_L5_argtuple_error;
40208 0 : CYTHON_FALLTHROUGH;
40209 : case 1:
40210 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
40211 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
40212 0 : kw_args--;
40213 : }
40214 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
40215 : else {
40216 0 : __Pyx_RaiseArgtupleInvalid("iddr_rsvd", 1, 2, 2, 1); __PYX_ERR(0, 1059, __pyx_L3_error)
40217 : }
40218 1 : CYTHON_FALLTHROUGH;
40219 : case 2:
40220 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
40221 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
40222 1 : kw_args--;
40223 : }
40224 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
40225 : else {
40226 0 : __Pyx_RaiseKeywordRequired("iddr_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1059, __pyx_L3_error)
40227 : }
40228 : }
40229 1 : if (unlikely(kw_args > 0)) {
40230 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
40231 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_rsvd") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error)
40232 : }
40233 0 : } else if (unlikely(__pyx_nargs != 2)) {
40234 0 : goto __pyx_L5_argtuple_error;
40235 : } else {
40236 0 : __Pyx_RaiseKeywordRequired("iddr_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1059, __pyx_L3_error)
40237 : }
40238 1 : __pyx_v_A = values[0];
40239 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1059, __pyx_L3_error)
40240 1 : __pyx_v_rng = values[2];
40241 : }
40242 1 : goto __pyx_L6_skip;
40243 0 : __pyx_L5_argtuple_error:;
40244 0 : __Pyx_RaiseArgtupleInvalid("iddr_rsvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1059, __pyx_L3_error)
40245 1 : __pyx_L6_skip:;
40246 1 : goto __pyx_L4_argument_unpacking_done;
40247 0 : __pyx_L3_error:;
40248 : {
40249 0 : Py_ssize_t __pyx_temp;
40250 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
40251 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
40252 : }
40253 : }
40254 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
40255 0 : __Pyx_RefNannyFinishContext();
40256 0 : return NULL;
40257 1 : __pyx_L4_argument_unpacking_done:;
40258 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_36iddr_rsvd(__pyx_self, __pyx_v_A, __pyx_v_krank, __pyx_v_rng);
40259 :
40260 : /* function exit code */
40261 : {
40262 1 : Py_ssize_t __pyx_temp;
40263 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
40264 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
40265 : }
40266 : }
40267 : __Pyx_RefNannyFinishContext();
40268 : return __pyx_r;
40269 : }
40270 :
40271 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_36iddr_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng) {
40272 1 : int __pyx_v_n;
40273 1 : int __pyx_v_j;
40274 1 : PyArrayObject *__pyx_v_perms = 0;
40275 1 : PyArrayObject *__pyx_v_proj = 0;
40276 1 : PyArrayObject *__pyx_v_col = 0;
40277 1 : PyObject *__pyx_v_x = NULL;
40278 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
40279 1 : __Pyx_Buffer __pyx_pybuffer_col;
40280 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
40281 1 : __Pyx_Buffer __pyx_pybuffer_perms;
40282 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
40283 1 : __Pyx_Buffer __pyx_pybuffer_proj;
40284 1 : PyObject *__pyx_r = NULL;
40285 : __Pyx_RefNannyDeclarations
40286 1 : PyObject *__pyx_t_1 = NULL;
40287 1 : PyObject *__pyx_t_2 = NULL;
40288 1 : int __pyx_t_3;
40289 1 : PyObject *__pyx_t_4 = NULL;
40290 1 : PyObject *__pyx_t_5 = NULL;
40291 1 : PyObject *(*__pyx_t_6)(PyObject *);
40292 1 : PyArrayObject *__pyx_t_7 = NULL;
40293 1 : PyObject *__pyx_t_8 = NULL;
40294 1 : PyObject *__pyx_t_9 = NULL;
40295 1 : PyObject *__pyx_t_10 = NULL;
40296 1 : PyArrayObject *__pyx_t_11 = NULL;
40297 1 : npy_intp __pyx_t_12[2];
40298 1 : PyArrayObject *__pyx_t_13 = NULL;
40299 1 : npy_intp __pyx_t_14[1];
40300 1 : int __pyx_t_15;
40301 1 : int __pyx_t_16;
40302 1 : Py_ssize_t __pyx_t_17;
40303 1 : __pyx_t_5numpy_int64_t __pyx_t_18;
40304 1 : unsigned int __pyx_t_19;
40305 1 : int __pyx_lineno = 0;
40306 1 : const char *__pyx_filename = NULL;
40307 1 : int __pyx_clineno = 0;
40308 1 : __Pyx_RefNannySetupContext("iddr_rsvd", 1);
40309 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
40310 1 : __pyx_pybuffer_perms.refcount = 0;
40311 1 : __pyx_pybuffernd_perms.data = NULL;
40312 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
40313 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
40314 1 : __pyx_pybuffer_proj.refcount = 0;
40315 1 : __pyx_pybuffernd_proj.data = NULL;
40316 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
40317 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
40318 1 : __pyx_pybuffer_col.refcount = 0;
40319 1 : __pyx_pybuffernd_col.data = NULL;
40320 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
40321 :
40322 : /* "scipy/linalg/_decomp_interpolative.pyx":1060
40323 : *
40324 : * def iddr_rsvd(A: LinearOperator, int krank, *, rng):
40325 : * cdef int n = A.shape[1], j # <<<<<<<<<<<<<<
40326 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
40327 : * cdef cnp.ndarray[cnp.float64_t, ndim=2] proj
40328 : */
40329 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
40330 1 : __Pyx_GOTREF(__pyx_t_1);
40331 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
40332 1 : __Pyx_GOTREF(__pyx_t_2);
40333 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40334 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L1_error)
40335 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40336 1 : __pyx_v_n = __pyx_t_3;
40337 :
40338 : /* "scipy/linalg/_decomp_interpolative.pyx":1065
40339 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] col
40340 : *
40341 : * perms, proj = iddr_rid(A, krank, rng=rng) # <<<<<<<<<<<<<<
40342 : * # idd_getcols
40343 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
40344 : */
40345 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddr_rid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error)
40346 1 : __Pyx_GOTREF(__pyx_t_2);
40347 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
40348 1 : __Pyx_GOTREF(__pyx_t_1);
40349 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error)
40350 1 : __Pyx_GOTREF(__pyx_t_4);
40351 1 : __Pyx_INCREF(__pyx_v_A);
40352 1 : __Pyx_GIVEREF(__pyx_v_A);
40353 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1065, __pyx_L1_error);
40354 1 : __Pyx_GIVEREF(__pyx_t_1);
40355 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error);
40356 1 : __pyx_t_1 = 0;
40357 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
40358 1 : __Pyx_GOTREF(__pyx_t_1);
40359 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1065, __pyx_L1_error)
40360 1 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1065, __pyx_L1_error)
40361 1 : __Pyx_GOTREF(__pyx_t_5);
40362 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40363 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
40364 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40365 1 : if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
40366 1 : PyObject* sequence = __pyx_t_5;
40367 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
40368 1 : if (unlikely(size != 2)) {
40369 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
40370 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
40371 0 : __PYX_ERR(0, 1065, __pyx_L1_error)
40372 : }
40373 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40374 1 : if (likely(PyTuple_CheckExact(sequence))) {
40375 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
40376 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
40377 : } else {
40378 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
40379 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
40380 : }
40381 1 : __Pyx_INCREF(__pyx_t_1);
40382 1 : __Pyx_INCREF(__pyx_t_4);
40383 : #else
40384 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
40385 : __Pyx_GOTREF(__pyx_t_1);
40386 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error)
40387 : __Pyx_GOTREF(__pyx_t_4);
40388 : #endif
40389 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40390 : } else {
40391 0 : Py_ssize_t index = -1;
40392 0 : __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error)
40393 0 : __Pyx_GOTREF(__pyx_t_2);
40394 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40395 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
40396 0 : index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
40397 0 : __Pyx_GOTREF(__pyx_t_1);
40398 0 : index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
40399 0 : __Pyx_GOTREF(__pyx_t_4);
40400 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1065, __pyx_L1_error)
40401 0 : __pyx_t_6 = NULL;
40402 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40403 0 : goto __pyx_L4_unpacking_done;
40404 0 : __pyx_L3_unpacking_failed:;
40405 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40406 0 : __pyx_t_6 = NULL;
40407 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
40408 0 : __PYX_ERR(0, 1065, __pyx_L1_error)
40409 0 : __pyx_L4_unpacking_done:;
40410 : }
40411 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1065, __pyx_L1_error)
40412 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1065, __pyx_L1_error)
40413 1 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
40414 : {
40415 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
40416 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
40417 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
40418 1 : if (unlikely(__pyx_t_3 < 0)) {
40419 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
40420 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
40421 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
40422 : __Pyx_RaiseBufferFallbackError();
40423 : } else {
40424 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
40425 : }
40426 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
40427 : }
40428 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
40429 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error)
40430 : }
40431 1 : __pyx_t_7 = 0;
40432 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_1);
40433 1 : __pyx_t_1 = 0;
40434 1 : __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
40435 : {
40436 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
40437 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
40438 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
40439 1 : if (unlikely(__pyx_t_3 < 0)) {
40440 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
40441 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
40442 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
40443 : __Pyx_RaiseBufferFallbackError();
40444 : } else {
40445 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
40446 : }
40447 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
40448 : }
40449 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
40450 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error)
40451 : }
40452 1 : __pyx_t_11 = 0;
40453 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_4);
40454 1 : __pyx_t_4 = 0;
40455 :
40456 : /* "scipy/linalg/_decomp_interpolative.pyx":1067
40457 : * perms, proj = iddr_rid(A, krank, rng=rng)
40458 : * # idd_getcols
40459 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
40460 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
40461 : * for j in range(krank):
40462 : */
40463 1 : __pyx_t_12[0] = __pyx_v_n;
40464 1 : __pyx_t_12[1] = __pyx_v_krank;
40465 1 : __pyx_t_5 = PyArray_EMPTY(2, __pyx_t_12, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1067, __pyx_L1_error)
40466 1 : __Pyx_GOTREF(__pyx_t_5);
40467 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1067, __pyx_L1_error)
40468 1 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
40469 : {
40470 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
40471 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
40472 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
40473 1 : if (unlikely(__pyx_t_3 < 0)) {
40474 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
40475 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
40476 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
40477 : __Pyx_RaiseBufferFallbackError();
40478 : } else {
40479 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
40480 : }
40481 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
40482 : }
40483 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
40484 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error)
40485 : }
40486 1 : __pyx_t_13 = 0;
40487 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_5);
40488 1 : __pyx_t_5 = 0;
40489 :
40490 : /* "scipy/linalg/_decomp_interpolative.pyx":1068
40491 : * # idd_getcols
40492 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
40493 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
40494 : * for j in range(krank):
40495 : * x[perms[j]] = 1.
40496 : */
40497 1 : __pyx_t_14[0] = __pyx_v_n;
40498 1 : __pyx_t_5 = PyArray_ZEROS(1, __pyx_t_14, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error)
40499 : __Pyx_GOTREF(__pyx_t_5);
40500 21 : __pyx_v_x = __pyx_t_5;
40501 : __pyx_t_5 = 0;
40502 :
40503 : /* "scipy/linalg/_decomp_interpolative.pyx":1069
40504 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_FLOAT64, 0)
40505 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
40506 : * for j in range(krank): # <<<<<<<<<<<<<<
40507 : * x[perms[j]] = 1.
40508 : * col[:, j] = A.matvec(x)
40509 : */
40510 21 : __pyx_t_3 = __pyx_v_krank;
40511 : __pyx_t_15 = __pyx_t_3;
40512 21 : for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
40513 20 : __pyx_v_j = __pyx_t_16;
40514 :
40515 : /* "scipy/linalg/_decomp_interpolative.pyx":1070
40516 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
40517 : * for j in range(krank):
40518 : * x[perms[j]] = 1. # <<<<<<<<<<<<<<
40519 : * col[:, j] = A.matvec(x)
40520 : * x[perms[j]] = 0.
40521 : */
40522 20 : __pyx_t_17 = __pyx_v_j;
40523 20 : __pyx_t_18 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
40524 20 : if (unlikely((__Pyx_SetItemInt(__pyx_v_x, __pyx_t_18, __pyx_float_1_, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0) < 0))) __PYX_ERR(0, 1070, __pyx_L1_error)
40525 :
40526 : /* "scipy/linalg/_decomp_interpolative.pyx":1071
40527 : * for j in range(krank):
40528 : * x[perms[j]] = 1.
40529 : * col[:, j] = A.matvec(x) # <<<<<<<<<<<<<<
40530 : * x[perms[j]] = 0.
40531 : *
40532 : */
40533 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error)
40534 20 : __Pyx_GOTREF(__pyx_t_4);
40535 20 : __pyx_t_1 = NULL;
40536 20 : __pyx_t_19 = 0;
40537 : #if CYTHON_UNPACK_METHODS
40538 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
40539 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
40540 20 : if (likely(__pyx_t_1)) {
40541 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
40542 20 : __Pyx_INCREF(__pyx_t_1);
40543 20 : __Pyx_INCREF(function);
40544 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
40545 : __pyx_t_19 = 1;
40546 : }
40547 : }
40548 : #endif
40549 : {
40550 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_x};
40551 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_19, 1+__pyx_t_19);
40552 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
40553 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
40554 20 : __Pyx_GOTREF(__pyx_t_5);
40555 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
40556 : }
40557 20 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error)
40558 20 : __Pyx_GOTREF(__pyx_t_4);
40559 20 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
40560 20 : __Pyx_GOTREF(__pyx_t_1);
40561 20 : __Pyx_INCREF(__pyx_slice__5);
40562 20 : __Pyx_GIVEREF(__pyx_slice__5);
40563 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1071, __pyx_L1_error);
40564 20 : __Pyx_GIVEREF(__pyx_t_4);
40565 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error);
40566 20 : __pyx_t_4 = 0;
40567 20 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col), __pyx_t_1, __pyx_t_5) < 0))) __PYX_ERR(0, 1071, __pyx_L1_error)
40568 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40569 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40570 :
40571 : /* "scipy/linalg/_decomp_interpolative.pyx":1072
40572 : * x[perms[j]] = 1.
40573 : * col[:, j] = A.matvec(x)
40574 : * x[perms[j]] = 0. # <<<<<<<<<<<<<<
40575 : *
40576 : * return idd_id2svd(cols=col, perms=perms, proj=proj)
40577 : */
40578 20 : __pyx_t_17 = __pyx_v_j;
40579 20 : __pyx_t_18 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
40580 20 : if (unlikely((__Pyx_SetItemInt(__pyx_v_x, __pyx_t_18, __pyx_float_0_, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0) < 0))) __PYX_ERR(0, 1072, __pyx_L1_error)
40581 : }
40582 :
40583 : /* "scipy/linalg/_decomp_interpolative.pyx":1074
40584 : * x[perms[j]] = 0.
40585 : *
40586 : * return idd_id2svd(cols=col, perms=perms, proj=proj) # <<<<<<<<<<<<<<
40587 : *
40588 : *
40589 : */
40590 1 : __Pyx_XDECREF(__pyx_r);
40591 1 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idd_id2svd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1074, __pyx_L1_error)
40592 1 : __Pyx_GOTREF(__pyx_t_5);
40593 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
40594 1 : __Pyx_GOTREF(__pyx_t_1);
40595 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cols, ((PyObject *)__pyx_v_col)) < 0) __PYX_ERR(0, 1074, __pyx_L1_error)
40596 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_perms, ((PyObject *)__pyx_v_perms)) < 0) __PYX_ERR(0, 1074, __pyx_L1_error)
40597 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_proj, ((PyObject *)__pyx_v_proj)) < 0) __PYX_ERR(0, 1074, __pyx_L1_error)
40598 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error)
40599 1 : __Pyx_GOTREF(__pyx_t_4);
40600 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40601 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40602 1 : __pyx_r = __pyx_t_4;
40603 1 : __pyx_t_4 = 0;
40604 1 : goto __pyx_L0;
40605 :
40606 : /* "scipy/linalg/_decomp_interpolative.pyx":1059
40607 : *
40608 : *
40609 : * def iddr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
40610 : * cdef int n = A.shape[1], j
40611 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
40612 : */
40613 :
40614 : /* function exit code */
40615 0 : __pyx_L1_error:;
40616 0 : __Pyx_XDECREF(__pyx_t_1);
40617 0 : __Pyx_XDECREF(__pyx_t_2);
40618 0 : __Pyx_XDECREF(__pyx_t_4);
40619 0 : __Pyx_XDECREF(__pyx_t_5);
40620 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
40621 0 : __Pyx_PyThreadState_declare
40622 0 : __Pyx_PyThreadState_assign
40623 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
40624 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
40625 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
40626 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
40627 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
40628 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
40629 0 : __pyx_r = NULL;
40630 0 : goto __pyx_L2;
40631 1 : __pyx_L0:;
40632 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
40633 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
40634 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
40635 1 : __pyx_L2:;
40636 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
40637 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
40638 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
40639 1 : __Pyx_XDECREF(__pyx_v_x);
40640 1 : __Pyx_XGIVEREF(__pyx_r);
40641 1 : __Pyx_RefNannyFinishContext();
40642 1 : return __pyx_r;
40643 : }
40644 :
40645 : /* "scipy/linalg/_decomp_interpolative.pyx":1077
40646 : *
40647 : *
40648 : * def iddr_svd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank): # <<<<<<<<<<<<<<
40649 : * cdef int m = a.shape[0], info = 0
40650 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
40651 : */
40652 :
40653 : /* Python wrapper */
40654 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_39iddr_svd(PyObject *__pyx_self,
40655 : #if CYTHON_METH_FASTCALL
40656 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
40657 : #else
40658 : PyObject *__pyx_args, PyObject *__pyx_kwds
40659 : #endif
40660 : ); /*proto*/
40661 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_39iddr_svd = {"iddr_svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_39iddr_svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
40662 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_39iddr_svd(PyObject *__pyx_self,
40663 : #if CYTHON_METH_FASTCALL
40664 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
40665 : #else
40666 : PyObject *__pyx_args, PyObject *__pyx_kwds
40667 : #endif
40668 : ) {
40669 1 : PyArrayObject *__pyx_v_a = 0;
40670 1 : int __pyx_v_krank;
40671 : #if !CYTHON_METH_FASTCALL
40672 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
40673 : #endif
40674 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
40675 1 : PyObject* values[2] = {0,0};
40676 1 : int __pyx_lineno = 0;
40677 1 : const char *__pyx_filename = NULL;
40678 1 : int __pyx_clineno = 0;
40679 1 : PyObject *__pyx_r = 0;
40680 : __Pyx_RefNannyDeclarations
40681 1 : __Pyx_RefNannySetupContext("iddr_svd (wrapper)", 0);
40682 : #if !CYTHON_METH_FASTCALL
40683 : #if CYTHON_ASSUME_SAFE_MACROS
40684 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
40685 : #else
40686 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
40687 : #endif
40688 : #endif
40689 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
40690 : {
40691 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
40692 1 : if (__pyx_kwds) {
40693 0 : Py_ssize_t kw_args;
40694 0 : switch (__pyx_nargs) {
40695 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
40696 0 : CYTHON_FALLTHROUGH;
40697 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
40698 0 : CYTHON_FALLTHROUGH;
40699 0 : case 0: break;
40700 0 : default: goto __pyx_L5_argtuple_error;
40701 : }
40702 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
40703 0 : switch (__pyx_nargs) {
40704 : case 0:
40705 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
40706 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
40707 0 : kw_args--;
40708 : }
40709 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1077, __pyx_L3_error)
40710 0 : else goto __pyx_L5_argtuple_error;
40711 0 : CYTHON_FALLTHROUGH;
40712 : case 1:
40713 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
40714 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
40715 0 : kw_args--;
40716 : }
40717 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1077, __pyx_L3_error)
40718 : else {
40719 0 : __Pyx_RaiseArgtupleInvalid("iddr_svd", 1, 2, 2, 1); __PYX_ERR(0, 1077, __pyx_L3_error)
40720 : }
40721 : }
40722 0 : if (unlikely(kw_args > 0)) {
40723 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
40724 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "iddr_svd") < 0)) __PYX_ERR(0, 1077, __pyx_L3_error)
40725 : }
40726 1 : } else if (unlikely(__pyx_nargs != 2)) {
40727 0 : goto __pyx_L5_argtuple_error;
40728 : } else {
40729 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
40730 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
40731 : }
40732 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
40733 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1077, __pyx_L3_error)
40734 : }
40735 1 : goto __pyx_L6_skip;
40736 0 : __pyx_L5_argtuple_error:;
40737 0 : __Pyx_RaiseArgtupleInvalid("iddr_svd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1077, __pyx_L3_error)
40738 1 : __pyx_L6_skip:;
40739 1 : goto __pyx_L4_argument_unpacking_done;
40740 0 : __pyx_L3_error:;
40741 : {
40742 0 : Py_ssize_t __pyx_temp;
40743 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
40744 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
40745 : }
40746 : }
40747 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
40748 0 : __Pyx_RefNannyFinishContext();
40749 0 : return NULL;
40750 1 : __pyx_L4_argument_unpacking_done:;
40751 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1077, __pyx_L1_error)
40752 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_38iddr_svd(__pyx_self, __pyx_v_a, __pyx_v_krank);
40753 :
40754 : /* function exit code */
40755 1 : goto __pyx_L0;
40756 0 : __pyx_L1_error:;
40757 0 : __pyx_r = NULL;
40758 1 : __pyx_L0:;
40759 : {
40760 1 : Py_ssize_t __pyx_temp;
40761 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
40762 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
40763 : }
40764 : }
40765 : __Pyx_RefNannyFinishContext();
40766 : return __pyx_r;
40767 : }
40768 :
40769 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_38iddr_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank) {
40770 1 : int __pyx_v_m;
40771 1 : int __pyx_v_info;
40772 1 : PyArrayObject *__pyx_v_taus = 0;
40773 1 : PyArrayObject *__pyx_v_UU = 0;
40774 1 : PyArrayObject *__pyx_v_C = 0;
40775 1 : PyObject *__pyx_v_inds = NULL;
40776 1 : PyObject *__pyx_v_r = NULL;
40777 1 : long __pyx_v_p;
40778 1 : PyObject *__pyx_v_U = NULL;
40779 1 : PyObject *__pyx_v_S = NULL;
40780 1 : PyObject *__pyx_v_V = NULL;
40781 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
40782 1 : __Pyx_Buffer __pyx_pybuffer_C;
40783 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
40784 1 : __Pyx_Buffer __pyx_pybuffer_UU;
40785 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
40786 1 : __Pyx_Buffer __pyx_pybuffer_a;
40787 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_taus;
40788 1 : __Pyx_Buffer __pyx_pybuffer_taus;
40789 1 : PyObject *__pyx_r = NULL;
40790 : __Pyx_RefNannyDeclarations
40791 1 : PyObject *__pyx_t_1 = NULL;
40792 1 : PyObject *__pyx_t_2 = NULL;
40793 1 : PyObject *__pyx_t_3 = NULL;
40794 1 : PyObject *__pyx_t_4 = NULL;
40795 1 : unsigned int __pyx_t_5;
40796 1 : PyObject *(*__pyx_t_6)(PyObject *);
40797 1 : PyArrayObject *__pyx_t_7 = NULL;
40798 1 : int __pyx_t_8;
40799 1 : PyObject *__pyx_t_9 = NULL;
40800 1 : PyObject *__pyx_t_10 = NULL;
40801 1 : PyObject *__pyx_t_11 = NULL;
40802 1 : long __pyx_t_12;
40803 1 : PyObject *__pyx_t_13 = NULL;
40804 1 : PyArrayObject *__pyx_t_14 = NULL;
40805 1 : PyArrayObject *__pyx_t_15 = NULL;
40806 1 : Py_ssize_t __pyx_t_16;
40807 1 : Py_ssize_t __pyx_t_17;
40808 1 : Py_ssize_t __pyx_t_18;
40809 1 : Py_ssize_t __pyx_t_19;
40810 1 : Py_ssize_t __pyx_t_20;
40811 1 : Py_ssize_t __pyx_t_21;
40812 1 : Py_ssize_t __pyx_t_22;
40813 1 : int __pyx_lineno = 0;
40814 1 : const char *__pyx_filename = NULL;
40815 1 : int __pyx_clineno = 0;
40816 1 : __Pyx_RefNannySetupContext("iddr_svd", 1);
40817 1 : __pyx_pybuffer_taus.pybuffer.buf = NULL;
40818 1 : __pyx_pybuffer_taus.refcount = 0;
40819 1 : __pyx_pybuffernd_taus.data = NULL;
40820 1 : __pyx_pybuffernd_taus.rcbuffer = &__pyx_pybuffer_taus;
40821 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
40822 1 : __pyx_pybuffer_UU.refcount = 0;
40823 1 : __pyx_pybuffernd_UU.data = NULL;
40824 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
40825 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
40826 1 : __pyx_pybuffer_C.refcount = 0;
40827 1 : __pyx_pybuffernd_C.data = NULL;
40828 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
40829 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
40830 1 : __pyx_pybuffer_a.refcount = 0;
40831 1 : __pyx_pybuffernd_a.data = NULL;
40832 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
40833 : {
40834 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
40835 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1077, __pyx_L1_error)
40836 : }
40837 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
40838 :
40839 : /* "scipy/linalg/_decomp_interpolative.pyx":1078
40840 : *
40841 : * def iddr_svd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank):
40842 : * cdef int m = a.shape[0], info = 0 # <<<<<<<<<<<<<<
40843 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
40844 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=2] UU
40845 : */
40846 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
40847 1 : __pyx_v_info = 0;
40848 :
40849 : /* "scipy/linalg/_decomp_interpolative.pyx":1084
40850 : *
40851 : * # Get the pivoted QR
40852 : * inds, taus = iddr_qrpiv(a, krank) # <<<<<<<<<<<<<<
40853 : *
40854 : * r = np.triu(a[:krank, :])
40855 : */
40856 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_iddr_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error)
40857 1 : __Pyx_GOTREF(__pyx_t_2);
40858 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
40859 1 : __Pyx_GOTREF(__pyx_t_3);
40860 1 : __pyx_t_4 = NULL;
40861 1 : __pyx_t_5 = 0;
40862 : #if CYTHON_UNPACK_METHODS
40863 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
40864 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
40865 0 : if (likely(__pyx_t_4)) {
40866 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
40867 0 : __Pyx_INCREF(__pyx_t_4);
40868 0 : __Pyx_INCREF(function);
40869 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
40870 : __pyx_t_5 = 1;
40871 : }
40872 : }
40873 : #endif
40874 : {
40875 1 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
40876 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
40877 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
40878 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40879 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
40880 1 : __Pyx_GOTREF(__pyx_t_1);
40881 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40882 : }
40883 1 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
40884 1 : PyObject* sequence = __pyx_t_1;
40885 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
40886 1 : if (unlikely(size != 2)) {
40887 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
40888 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
40889 0 : __PYX_ERR(0, 1084, __pyx_L1_error)
40890 : }
40891 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40892 1 : if (likely(PyTuple_CheckExact(sequence))) {
40893 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
40894 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
40895 : } else {
40896 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
40897 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
40898 : }
40899 1 : __Pyx_INCREF(__pyx_t_2);
40900 1 : __Pyx_INCREF(__pyx_t_3);
40901 : #else
40902 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error)
40903 : __Pyx_GOTREF(__pyx_t_2);
40904 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
40905 : __Pyx_GOTREF(__pyx_t_3);
40906 : #endif
40907 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40908 : } else {
40909 0 : Py_ssize_t index = -1;
40910 0 : __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error)
40911 0 : __Pyx_GOTREF(__pyx_t_4);
40912 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40913 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
40914 0 : index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
40915 0 : __Pyx_GOTREF(__pyx_t_2);
40916 0 : index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
40917 0 : __Pyx_GOTREF(__pyx_t_3);
40918 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1084, __pyx_L1_error)
40919 0 : __pyx_t_6 = NULL;
40920 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
40921 0 : goto __pyx_L4_unpacking_done;
40922 0 : __pyx_L3_unpacking_failed:;
40923 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
40924 0 : __pyx_t_6 = NULL;
40925 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
40926 0 : __PYX_ERR(0, 1084, __pyx_L1_error)
40927 0 : __pyx_L4_unpacking_done:;
40928 : }
40929 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1084, __pyx_L1_error)
40930 1 : __pyx_v_inds = __pyx_t_2;
40931 1 : __pyx_t_2 = 0;
40932 1 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_3);
40933 : {
40934 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
40935 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
40936 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
40937 1 : if (unlikely(__pyx_t_8 < 0)) {
40938 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
40939 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_v_taus, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
40940 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
40941 : __Pyx_RaiseBufferFallbackError();
40942 : } else {
40943 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
40944 : }
40945 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
40946 : }
40947 1 : __pyx_pybuffernd_taus.diminfo[0].strides = __pyx_pybuffernd_taus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_taus.diminfo[0].shape = __pyx_pybuffernd_taus.rcbuffer->pybuffer.shape[0];
40948 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1084, __pyx_L1_error)
40949 : }
40950 1 : __pyx_t_7 = 0;
40951 1 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_3);
40952 1 : __pyx_t_3 = 0;
40953 :
40954 : /* "scipy/linalg/_decomp_interpolative.pyx":1086
40955 : * inds, taus = iddr_qrpiv(a, krank)
40956 : *
40957 : * r = np.triu(a[:krank, :]) # <<<<<<<<<<<<<<
40958 : * # Apply pivots in reverse
40959 : * for p in range(krank-1, -1, -1):
40960 : */
40961 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error)
40962 1 : __Pyx_GOTREF(__pyx_t_3);
40963 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_triu); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error)
40964 1 : __Pyx_GOTREF(__pyx_t_2);
40965 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40966 1 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error)
40967 1 : __Pyx_GOTREF(__pyx_t_3);
40968 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
40969 1 : __Pyx_GOTREF(__pyx_t_4);
40970 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40971 1 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error)
40972 1 : __Pyx_GOTREF(__pyx_t_3);
40973 1 : __Pyx_GIVEREF(__pyx_t_4);
40974 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error);
40975 1 : __Pyx_INCREF(__pyx_slice__5);
40976 1 : __Pyx_GIVEREF(__pyx_slice__5);
40977 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 1086, __pyx_L1_error);
40978 1 : __pyx_t_4 = 0;
40979 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
40980 1 : __Pyx_GOTREF(__pyx_t_4);
40981 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40982 1 : __pyx_t_3 = NULL;
40983 1 : __pyx_t_5 = 0;
40984 : #if CYTHON_UNPACK_METHODS
40985 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
40986 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
40987 0 : if (likely(__pyx_t_3)) {
40988 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
40989 0 : __Pyx_INCREF(__pyx_t_3);
40990 0 : __Pyx_INCREF(function);
40991 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
40992 : __pyx_t_5 = 1;
40993 : }
40994 : }
40995 : #endif
40996 : {
40997 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
40998 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
40999 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
41000 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41001 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
41002 1 : __Pyx_GOTREF(__pyx_t_1);
41003 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41004 : }
41005 1 : __pyx_v_r = __pyx_t_1;
41006 1 : __pyx_t_1 = 0;
41007 :
41008 : /* "scipy/linalg/_decomp_interpolative.pyx":1088
41009 : * r = np.triu(a[:krank, :])
41010 : * # Apply pivots in reverse
41011 : * for p in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
41012 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]]
41013 : *
41014 : */
41015 21 : for (__pyx_t_12 = (__pyx_v_krank - 1); __pyx_t_12 > -1L; __pyx_t_12-=1) {
41016 20 : __pyx_v_p = __pyx_t_12;
41017 :
41018 : /* "scipy/linalg/_decomp_interpolative.pyx":1089
41019 : * # Apply pivots in reverse
41020 : * for p in range(krank-1, -1, -1):
41021 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]] # <<<<<<<<<<<<<<
41022 : *
41023 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
41024 : */
41025 20 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
41026 20 : __Pyx_GOTREF(__pyx_t_1);
41027 20 : __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
41028 20 : __Pyx_GOTREF(__pyx_t_2);
41029 20 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error)
41030 20 : __Pyx_GOTREF(__pyx_t_4);
41031 20 : __Pyx_GIVEREF(__pyx_t_1);
41032 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error);
41033 20 : __Pyx_GIVEREF(__pyx_t_2);
41034 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error);
41035 20 : __pyx_t_1 = 0;
41036 20 : __pyx_t_2 = 0;
41037 20 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
41038 20 : __Pyx_GOTREF(__pyx_t_2);
41039 20 : __Pyx_INCREF(__pyx_slice__5);
41040 20 : __Pyx_GIVEREF(__pyx_slice__5);
41041 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1089, __pyx_L1_error);
41042 20 : __Pyx_GIVEREF(__pyx_t_4);
41043 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error);
41044 20 : __pyx_t_4 = 0;
41045 20 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error)
41046 20 : __Pyx_GOTREF(__pyx_t_4);
41047 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41048 20 : __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
41049 20 : __Pyx_GOTREF(__pyx_t_2);
41050 20 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
41051 20 : __Pyx_GOTREF(__pyx_t_1);
41052 20 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error)
41053 20 : __Pyx_GOTREF(__pyx_t_3);
41054 20 : __Pyx_GIVEREF(__pyx_t_2);
41055 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error);
41056 20 : __Pyx_GIVEREF(__pyx_t_1);
41057 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error);
41058 20 : __pyx_t_2 = 0;
41059 20 : __pyx_t_1 = 0;
41060 20 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
41061 20 : __Pyx_GOTREF(__pyx_t_1);
41062 20 : __Pyx_INCREF(__pyx_slice__5);
41063 20 : __Pyx_GIVEREF(__pyx_slice__5);
41064 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1089, __pyx_L1_error);
41065 20 : __Pyx_GIVEREF(__pyx_t_3);
41066 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error);
41067 20 : __pyx_t_3 = 0;
41068 20 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_1, __pyx_t_4) < 0))) __PYX_ERR(0, 1089, __pyx_L1_error)
41069 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41070 40 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41071 : }
41072 :
41073 : /* "scipy/linalg/_decomp_interpolative.pyx":1093
41074 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
41075 : * # dgesvd(<char*>'S', <char*>'O', &krank, &n)
41076 : * U, S, V = la.svd(r, full_matrices=False) # <<<<<<<<<<<<<<
41077 : *
41078 : * # Apply Q to U via dorm2r
41079 : */
41080 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_la); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error)
41081 1 : __Pyx_GOTREF(__pyx_t_4);
41082 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
41083 1 : __Pyx_GOTREF(__pyx_t_1);
41084 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41085 1 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error)
41086 1 : __Pyx_GOTREF(__pyx_t_4);
41087 1 : __Pyx_INCREF(__pyx_v_r);
41088 1 : __Pyx_GIVEREF(__pyx_v_r);
41089 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_r)) __PYX_ERR(0, 1093, __pyx_L1_error);
41090 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error)
41091 1 : __Pyx_GOTREF(__pyx_t_3);
41092 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1093, __pyx_L1_error)
41093 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error)
41094 1 : __Pyx_GOTREF(__pyx_t_2);
41095 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41096 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41097 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
41098 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
41099 1 : PyObject* sequence = __pyx_t_2;
41100 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
41101 1 : if (unlikely(size != 3)) {
41102 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
41103 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
41104 0 : __PYX_ERR(0, 1093, __pyx_L1_error)
41105 : }
41106 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41107 1 : if (likely(PyTuple_CheckExact(sequence))) {
41108 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
41109 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
41110 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
41111 : } else {
41112 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
41113 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
41114 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
41115 : }
41116 1 : __Pyx_INCREF(__pyx_t_3);
41117 1 : __Pyx_INCREF(__pyx_t_4);
41118 1 : __Pyx_INCREF(__pyx_t_1);
41119 : #else
41120 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error)
41121 : __Pyx_GOTREF(__pyx_t_3);
41122 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error)
41123 : __Pyx_GOTREF(__pyx_t_4);
41124 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
41125 : __Pyx_GOTREF(__pyx_t_1);
41126 : #endif
41127 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41128 : } else {
41129 0 : Py_ssize_t index = -1;
41130 0 : __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1093, __pyx_L1_error)
41131 0 : __Pyx_GOTREF(__pyx_t_13);
41132 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41133 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13);
41134 0 : index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
41135 0 : __Pyx_GOTREF(__pyx_t_3);
41136 0 : index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
41137 0 : __Pyx_GOTREF(__pyx_t_4);
41138 0 : index = 2; __pyx_t_1 = __pyx_t_6(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
41139 0 : __Pyx_GOTREF(__pyx_t_1);
41140 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_13), 3) < 0) __PYX_ERR(0, 1093, __pyx_L1_error)
41141 0 : __pyx_t_6 = NULL;
41142 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
41143 0 : goto __pyx_L8_unpacking_done;
41144 0 : __pyx_L7_unpacking_failed:;
41145 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
41146 0 : __pyx_t_6 = NULL;
41147 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
41148 0 : __PYX_ERR(0, 1093, __pyx_L1_error)
41149 0 : __pyx_L8_unpacking_done:;
41150 : }
41151 1 : __pyx_v_U = __pyx_t_3;
41152 1 : __pyx_t_3 = 0;
41153 1 : __pyx_v_S = __pyx_t_4;
41154 1 : __pyx_t_4 = 0;
41155 1 : __pyx_v_V = __pyx_t_1;
41156 1 : __pyx_t_1 = 0;
41157 :
41158 : /* "scipy/linalg/_decomp_interpolative.pyx":1097
41159 : * # Apply Q to U via dorm2r
41160 : * # Possibly U is shorter than Q
41161 : * UU = np.zeros([m, krank], dtype=a.dtype) # <<<<<<<<<<<<<<
41162 : * UU[:krank, :krank] = U
41163 : * # Do the transpose dance for C-layout, use a for scratch
41164 : */
41165 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error)
41166 1 : __Pyx_GOTREF(__pyx_t_2);
41167 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error)
41168 1 : __Pyx_GOTREF(__pyx_t_1);
41169 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41170 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error)
41171 1 : __Pyx_GOTREF(__pyx_t_2);
41172 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error)
41173 1 : __Pyx_GOTREF(__pyx_t_4);
41174 1 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __pyx_L1_error)
41175 1 : __Pyx_GOTREF(__pyx_t_3);
41176 1 : __Pyx_GIVEREF(__pyx_t_2);
41177 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error);
41178 1 : __Pyx_GIVEREF(__pyx_t_4);
41179 1 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error);
41180 1 : __pyx_t_2 = 0;
41181 1 : __pyx_t_4 = 0;
41182 1 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error)
41183 1 : __Pyx_GOTREF(__pyx_t_4);
41184 1 : __Pyx_GIVEREF(__pyx_t_3);
41185 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1097, __pyx_L1_error);
41186 1 : __pyx_t_3 = 0;
41187 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __pyx_L1_error)
41188 1 : __Pyx_GOTREF(__pyx_t_3);
41189 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error)
41190 1 : __Pyx_GOTREF(__pyx_t_2);
41191 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 1097, __pyx_L1_error)
41192 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41193 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __pyx_L1_error)
41194 1 : __Pyx_GOTREF(__pyx_t_2);
41195 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41196 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41197 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
41198 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1097, __pyx_L1_error)
41199 1 : __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
41200 : {
41201 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41202 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
41203 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
41204 1 : if (unlikely(__pyx_t_8 < 0)) {
41205 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
41206 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
41207 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
41208 : __Pyx_RaiseBufferFallbackError();
41209 : } else {
41210 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
41211 : }
41212 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
41213 : }
41214 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
41215 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error)
41216 : }
41217 1 : __pyx_t_14 = 0;
41218 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
41219 1 : __pyx_t_2 = 0;
41220 :
41221 : /* "scipy/linalg/_decomp_interpolative.pyx":1098
41222 : * # Possibly U is shorter than Q
41223 : * UU = np.zeros([m, krank], dtype=a.dtype)
41224 : * UU[:krank, :krank] = U # <<<<<<<<<<<<<<
41225 : * # Do the transpose dance for C-layout, use a for scratch
41226 : * C = a[:, :krank].copy(order='F')
41227 : */
41228 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
41229 1 : __Pyx_GOTREF(__pyx_t_2);
41230 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L1_error)
41231 1 : __Pyx_GOTREF(__pyx_t_3);
41232 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41233 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
41234 1 : __Pyx_GOTREF(__pyx_t_2);
41235 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error)
41236 1 : __Pyx_GOTREF(__pyx_t_4);
41237 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41238 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
41239 1 : __Pyx_GOTREF(__pyx_t_2);
41240 1 : __Pyx_GIVEREF(__pyx_t_3);
41241 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L1_error);
41242 1 : __Pyx_GIVEREF(__pyx_t_4);
41243 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error);
41244 1 : __pyx_t_3 = 0;
41245 1 : __pyx_t_4 = 0;
41246 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_2, __pyx_v_U) < 0))) __PYX_ERR(0, 1098, __pyx_L1_error)
41247 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41248 :
41249 : /* "scipy/linalg/_decomp_interpolative.pyx":1100
41250 : * UU[:krank, :krank] = U
41251 : * # Do the transpose dance for C-layout, use a for scratch
41252 : * C = a[:, :krank].copy(order='F') # <<<<<<<<<<<<<<
41253 : * dorm2r(<char*>'R', <char*>'T',
41254 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
41255 : */
41256 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
41257 1 : __Pyx_GOTREF(__pyx_t_2);
41258 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
41259 1 : __Pyx_GOTREF(__pyx_t_4);
41260 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41261 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
41262 1 : __Pyx_GOTREF(__pyx_t_2);
41263 1 : __Pyx_INCREF(__pyx_slice__5);
41264 1 : __Pyx_GIVEREF(__pyx_slice__5);
41265 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1100, __pyx_L1_error);
41266 1 : __Pyx_GIVEREF(__pyx_t_4);
41267 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error);
41268 1 : __pyx_t_4 = 0;
41269 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
41270 1 : __Pyx_GOTREF(__pyx_t_4);
41271 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41272 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
41273 1 : __Pyx_GOTREF(__pyx_t_2);
41274 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41275 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
41276 1 : __Pyx_GOTREF(__pyx_t_4);
41277 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1100, __pyx_L1_error)
41278 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
41279 1 : __Pyx_GOTREF(__pyx_t_3);
41280 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41281 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41282 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1100, __pyx_L1_error)
41283 1 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_3);
41284 : {
41285 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41286 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
41287 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
41288 1 : if (unlikely(__pyx_t_8 < 0)) {
41289 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
41290 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
41291 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
41292 : __Pyx_RaiseBufferFallbackError();
41293 : } else {
41294 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
41295 : }
41296 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
41297 : }
41298 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
41299 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error)
41300 : }
41301 1 : __pyx_t_15 = 0;
41302 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_3);
41303 1 : __pyx_t_3 = 0;
41304 :
41305 : /* "scipy/linalg/_decomp_interpolative.pyx":1102
41306 : * C = a[:, :krank].copy(order='F')
41307 : * dorm2r(<char*>'R', <char*>'T',
41308 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0], # <<<<<<<<<<<<<<
41309 : * &UU[0,0], &krank, &a[0, 0], &info)
41310 : *
41311 : */
41312 1 : __pyx_t_16 = 0;
41313 1 : __pyx_t_17 = 0;
41314 1 : __pyx_t_18 = 0;
41315 :
41316 : /* "scipy/linalg/_decomp_interpolative.pyx":1103
41317 : * dorm2r(<char*>'R', <char*>'T',
41318 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
41319 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
41320 : *
41321 : * return UU, S, V
41322 : */
41323 1 : __pyx_t_19 = 0;
41324 1 : __pyx_t_20 = 0;
41325 1 : __pyx_t_21 = 0;
41326 1 : __pyx_t_22 = 0;
41327 :
41328 : /* "scipy/linalg/_decomp_interpolative.pyx":1101
41329 : * # Do the transpose dance for C-layout, use a for scratch
41330 : * C = a[:, :krank].copy(order='F')
41331 : * dorm2r(<char*>'R', <char*>'T', # <<<<<<<<<<<<<<
41332 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
41333 : * &UU[0,0], &krank, &a[0, 0], &info)
41334 : */
41335 1 : __pyx_f_5scipy_6linalg_13cython_lapack_dorm2r(((char *)((char *)"R")), ((char *)((char *)"T")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_taus.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_taus.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
41336 :
41337 : /* "scipy/linalg/_decomp_interpolative.pyx":1105
41338 : * &UU[0,0], &krank, &a[0, 0], &info)
41339 : *
41340 : * return UU, S, V # <<<<<<<<<<<<<<
41341 : *
41342 : *
41343 : */
41344 1 : __Pyx_XDECREF(__pyx_r);
41345 1 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1105, __pyx_L1_error)
41346 1 : __Pyx_GOTREF(__pyx_t_3);
41347 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
41348 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
41349 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1105, __pyx_L1_error);
41350 1 : __Pyx_INCREF(__pyx_v_S);
41351 1 : __Pyx_GIVEREF(__pyx_v_S);
41352 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_S)) __PYX_ERR(0, 1105, __pyx_L1_error);
41353 1 : __Pyx_INCREF(__pyx_v_V);
41354 1 : __Pyx_GIVEREF(__pyx_v_V);
41355 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_V)) __PYX_ERR(0, 1105, __pyx_L1_error);
41356 1 : __pyx_r = __pyx_t_3;
41357 1 : __pyx_t_3 = 0;
41358 1 : goto __pyx_L0;
41359 :
41360 : /* "scipy/linalg/_decomp_interpolative.pyx":1077
41361 : *
41362 : *
41363 : * def iddr_svd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank): # <<<<<<<<<<<<<<
41364 : * cdef int m = a.shape[0], info = 0
41365 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
41366 : */
41367 :
41368 : /* function exit code */
41369 0 : __pyx_L1_error:;
41370 0 : __Pyx_XDECREF(__pyx_t_1);
41371 0 : __Pyx_XDECREF(__pyx_t_2);
41372 0 : __Pyx_XDECREF(__pyx_t_3);
41373 0 : __Pyx_XDECREF(__pyx_t_4);
41374 0 : __Pyx_XDECREF(__pyx_t_13);
41375 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
41376 0 : __Pyx_PyThreadState_declare
41377 0 : __Pyx_PyThreadState_assign
41378 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
41379 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
41380 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
41381 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
41382 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
41383 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
41384 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.iddr_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
41385 0 : __pyx_r = NULL;
41386 0 : goto __pyx_L2;
41387 1 : __pyx_L0:;
41388 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
41389 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
41390 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
41391 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
41392 1 : __pyx_L2:;
41393 1 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
41394 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
41395 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
41396 1 : __Pyx_XDECREF(__pyx_v_inds);
41397 1 : __Pyx_XDECREF(__pyx_v_r);
41398 1 : __Pyx_XDECREF(__pyx_v_U);
41399 1 : __Pyx_XDECREF(__pyx_v_S);
41400 1 : __Pyx_XDECREF(__pyx_v_V);
41401 1 : __Pyx_XGIVEREF(__pyx_r);
41402 1 : __Pyx_RefNannyFinishContext();
41403 1 : return __pyx_r;
41404 : }
41405 :
41406 : /* "scipy/linalg/_decomp_interpolative.pyx":1108
41407 : *
41408 : *
41409 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
41410 : * cdef int n = A.shape[1], j = 0, intone = 1
41411 : * cdef cnp.float64_t snorm = 0.0
41412 : */
41413 :
41414 : /* Python wrapper */
41415 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_41idz_diffsnorm(PyObject *__pyx_self,
41416 : #if CYTHON_METH_FASTCALL
41417 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
41418 : #else
41419 : PyObject *__pyx_args, PyObject *__pyx_kwds
41420 : #endif
41421 : ); /*proto*/
41422 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_41idz_diffsnorm = {"idz_diffsnorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_41idz_diffsnorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
41423 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_41idz_diffsnorm(PyObject *__pyx_self,
41424 : #if CYTHON_METH_FASTCALL
41425 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
41426 : #else
41427 : PyObject *__pyx_args, PyObject *__pyx_kwds
41428 : #endif
41429 : ) {
41430 1 : PyObject *__pyx_v_A = 0;
41431 1 : PyObject *__pyx_v_B = 0;
41432 1 : PyObject *__pyx_v_rng = 0;
41433 1 : int __pyx_v_its;
41434 : #if !CYTHON_METH_FASTCALL
41435 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
41436 : #endif
41437 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
41438 1 : PyObject* values[4] = {0,0,0,0};
41439 1 : int __pyx_lineno = 0;
41440 1 : const char *__pyx_filename = NULL;
41441 1 : int __pyx_clineno = 0;
41442 1 : PyObject *__pyx_r = 0;
41443 : __Pyx_RefNannyDeclarations
41444 1 : __Pyx_RefNannySetupContext("idz_diffsnorm (wrapper)", 0);
41445 : #if !CYTHON_METH_FASTCALL
41446 : #if CYTHON_ASSUME_SAFE_MACROS
41447 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
41448 : #else
41449 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
41450 : #endif
41451 : #endif
41452 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
41453 : {
41454 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_rng,&__pyx_n_s_its,0};
41455 1 : if (likely(__pyx_kwds)) {
41456 1 : Py_ssize_t kw_args;
41457 1 : switch (__pyx_nargs) {
41458 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
41459 1 : CYTHON_FALLTHROUGH;
41460 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
41461 1 : CYTHON_FALLTHROUGH;
41462 1 : case 0: break;
41463 0 : default: goto __pyx_L5_argtuple_error;
41464 : }
41465 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
41466 1 : switch (__pyx_nargs) {
41467 : case 0:
41468 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
41469 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
41470 0 : kw_args--;
41471 : }
41472 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
41473 0 : else goto __pyx_L5_argtuple_error;
41474 0 : CYTHON_FALLTHROUGH;
41475 : case 1:
41476 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) {
41477 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
41478 0 : kw_args--;
41479 : }
41480 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
41481 : else {
41482 0 : __Pyx_RaiseArgtupleInvalid("idz_diffsnorm", 1, 2, 2, 1); __PYX_ERR(0, 1108, __pyx_L3_error)
41483 : }
41484 1 : CYTHON_FALLTHROUGH;
41485 : case 2:
41486 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
41487 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
41488 1 : kw_args--;
41489 : }
41490 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
41491 : else {
41492 0 : __Pyx_RaiseKeywordRequired("idz_diffsnorm", __pyx_n_s_rng); __PYX_ERR(0, 1108, __pyx_L3_error)
41493 : }
41494 : }
41495 1 : if (kw_args == 1) {
41496 1 : const Py_ssize_t index = 3;
41497 1 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
41498 1 : if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
41499 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
41500 : }
41501 1 : if (unlikely(kw_args > 0)) {
41502 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
41503 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_diffsnorm") < 0)) __PYX_ERR(0, 1108, __pyx_L3_error)
41504 : }
41505 0 : } else if (unlikely(__pyx_nargs != 2)) {
41506 0 : goto __pyx_L5_argtuple_error;
41507 : } else {
41508 0 : __Pyx_RaiseKeywordRequired("idz_diffsnorm", __pyx_n_s_rng); __PYX_ERR(0, 1108, __pyx_L3_error)
41509 : }
41510 1 : __pyx_v_A = values[0];
41511 1 : __pyx_v_B = values[1];
41512 1 : __pyx_v_rng = values[2];
41513 1 : if (values[3]) {
41514 1 : __pyx_v_its = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_its == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L3_error)
41515 : } else {
41516 : __pyx_v_its = ((int)((int)20));
41517 : }
41518 : }
41519 1 : goto __pyx_L6_skip;
41520 0 : __pyx_L5_argtuple_error:;
41521 0 : __Pyx_RaiseArgtupleInvalid("idz_diffsnorm", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1108, __pyx_L3_error)
41522 1 : __pyx_L6_skip:;
41523 1 : goto __pyx_L4_argument_unpacking_done;
41524 0 : __pyx_L3_error:;
41525 : {
41526 0 : Py_ssize_t __pyx_temp;
41527 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
41528 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
41529 : }
41530 : }
41531 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_diffsnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
41532 0 : __Pyx_RefNannyFinishContext();
41533 0 : return NULL;
41534 1 : __pyx_L4_argument_unpacking_done:;
41535 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_40idz_diffsnorm(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_rng, __pyx_v_its);
41536 :
41537 : /* function exit code */
41538 : {
41539 1 : Py_ssize_t __pyx_temp;
41540 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
41541 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
41542 : }
41543 : }
41544 : __Pyx_RefNannyFinishContext();
41545 : return __pyx_r;
41546 : }
41547 :
41548 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_40idz_diffsnorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_rng, int __pyx_v_its) {
41549 1 : int __pyx_v_n;
41550 1 : CYTHON_UNUSED int __pyx_v_j;
41551 1 : int __pyx_v_intone;
41552 1 : __pyx_t_5numpy_float64_t __pyx_v_snorm;
41553 1 : PyArrayObject *__pyx_v_v1 = 0;
41554 1 : PyArrayObject *__pyx_v_v2 = 0;
41555 1 : PyArrayObject *__pyx_v_u1 = 0;
41556 1 : PyArrayObject *__pyx_v_u2 = 0;
41557 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u1;
41558 1 : __Pyx_Buffer __pyx_pybuffer_u1;
41559 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u2;
41560 1 : __Pyx_Buffer __pyx_pybuffer_u2;
41561 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
41562 1 : __Pyx_Buffer __pyx_pybuffer_v1;
41563 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
41564 1 : __Pyx_Buffer __pyx_pybuffer_v2;
41565 1 : PyObject *__pyx_r = NULL;
41566 : __Pyx_RefNannyDeclarations
41567 1 : PyObject *__pyx_t_1 = NULL;
41568 1 : PyObject *__pyx_t_2 = NULL;
41569 1 : int __pyx_t_3;
41570 1 : PyObject *__pyx_t_4 = NULL;
41571 1 : PyObject *__pyx_t_5 = NULL;
41572 1 : PyObject *__pyx_t_6 = NULL;
41573 1 : PyObject *__pyx_t_7 = NULL;
41574 1 : unsigned int __pyx_t_8;
41575 1 : PyArrayObject *__pyx_t_9 = NULL;
41576 1 : PyObject *__pyx_t_10 = NULL;
41577 1 : PyObject *__pyx_t_11 = NULL;
41578 1 : PyObject *__pyx_t_12 = NULL;
41579 1 : Py_ssize_t __pyx_t_13;
41580 1 : int __pyx_t_14;
41581 1 : int __pyx_t_15;
41582 1 : PyArrayObject *__pyx_t_16 = NULL;
41583 1 : int __pyx_t_17;
41584 1 : PyArrayObject *__pyx_t_18 = NULL;
41585 1 : PyArrayObject *__pyx_t_19 = NULL;
41586 1 : int __pyx_t_20;
41587 1 : __pyx_t_5numpy_float64_t __pyx_t_21;
41588 1 : int __pyx_lineno = 0;
41589 1 : const char *__pyx_filename = NULL;
41590 1 : int __pyx_clineno = 0;
41591 1 : __Pyx_RefNannySetupContext("idz_diffsnorm", 1);
41592 1 : __pyx_pybuffer_v1.pybuffer.buf = NULL;
41593 1 : __pyx_pybuffer_v1.refcount = 0;
41594 1 : __pyx_pybuffernd_v1.data = NULL;
41595 1 : __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
41596 1 : __pyx_pybuffer_v2.pybuffer.buf = NULL;
41597 1 : __pyx_pybuffer_v2.refcount = 0;
41598 1 : __pyx_pybuffernd_v2.data = NULL;
41599 1 : __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
41600 1 : __pyx_pybuffer_u1.pybuffer.buf = NULL;
41601 1 : __pyx_pybuffer_u1.refcount = 0;
41602 1 : __pyx_pybuffernd_u1.data = NULL;
41603 1 : __pyx_pybuffernd_u1.rcbuffer = &__pyx_pybuffer_u1;
41604 1 : __pyx_pybuffer_u2.pybuffer.buf = NULL;
41605 1 : __pyx_pybuffer_u2.refcount = 0;
41606 1 : __pyx_pybuffernd_u2.data = NULL;
41607 1 : __pyx_pybuffernd_u2.rcbuffer = &__pyx_pybuffer_u2;
41608 :
41609 : /* "scipy/linalg/_decomp_interpolative.pyx":1109
41610 : *
41611 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20):
41612 : * cdef int n = A.shape[1], j = 0, intone = 1 # <<<<<<<<<<<<<<
41613 : * cdef cnp.float64_t snorm = 0.0
41614 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] v1
41615 : */
41616 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
41617 1 : __Pyx_GOTREF(__pyx_t_1);
41618 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
41619 1 : __Pyx_GOTREF(__pyx_t_2);
41620 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41621 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1109, __pyx_L1_error)
41622 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41623 1 : __pyx_v_n = __pyx_t_3;
41624 1 : __pyx_v_j = 0;
41625 1 : __pyx_v_intone = 1;
41626 :
41627 : /* "scipy/linalg/_decomp_interpolative.pyx":1110
41628 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20):
41629 : * cdef int n = A.shape[1], j = 0, intone = 1
41630 : * cdef cnp.float64_t snorm = 0.0 # <<<<<<<<<<<<<<
41631 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] v1
41632 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] v2
41633 : */
41634 1 : __pyx_v_snorm = 0.0;
41635 :
41636 : /* "scipy/linalg/_decomp_interpolative.pyx":1116
41637 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] u2
41638 : *
41639 : * v1 = rng.uniform(low=-1, high=1, size=(n, 2)).view(np.complex128).ravel() # <<<<<<<<<<<<<<
41640 : * v1 /= dznrm2(&n, &v1[0], &intone)
41641 : *
41642 : */
41643 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
41644 1 : __Pyx_GOTREF(__pyx_t_4);
41645 1 : __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
41646 1 : __Pyx_GOTREF(__pyx_t_5);
41647 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_low, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
41648 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_int_1) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
41649 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1116, __pyx_L1_error)
41650 1 : __Pyx_GOTREF(__pyx_t_6);
41651 1 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error)
41652 1 : __Pyx_GOTREF(__pyx_t_7);
41653 1 : __Pyx_GIVEREF(__pyx_t_6);
41654 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1116, __pyx_L1_error);
41655 1 : __Pyx_INCREF(__pyx_int_2);
41656 1 : __Pyx_GIVEREF(__pyx_int_2);
41657 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_2)) __PYX_ERR(0, 1116, __pyx_L1_error);
41658 1 : __pyx_t_6 = 0;
41659 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)
41660 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41661 1 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error)
41662 1 : __Pyx_GOTREF(__pyx_t_7);
41663 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41664 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41665 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
41666 1 : __Pyx_GOTREF(__pyx_t_5);
41667 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41668 1 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error)
41669 1 : __Pyx_GOTREF(__pyx_t_7);
41670 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_complex128); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
41671 1 : __Pyx_GOTREF(__pyx_t_4);
41672 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41673 1 : __pyx_t_7 = NULL;
41674 1 : __pyx_t_8 = 0;
41675 : #if CYTHON_UNPACK_METHODS
41676 1 : if (likely(PyMethod_Check(__pyx_t_5))) {
41677 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
41678 0 : if (likely(__pyx_t_7)) {
41679 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
41680 0 : __Pyx_INCREF(__pyx_t_7);
41681 0 : __Pyx_INCREF(function);
41682 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
41683 : __pyx_t_8 = 1;
41684 : }
41685 : }
41686 : #endif
41687 : {
41688 1 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
41689 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
41690 1 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41691 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41692 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error)
41693 1 : __Pyx_GOTREF(__pyx_t_1);
41694 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41695 : }
41696 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ravel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
41697 1 : __Pyx_GOTREF(__pyx_t_5);
41698 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41699 1 : __pyx_t_1 = NULL;
41700 1 : __pyx_t_8 = 0;
41701 : #if CYTHON_UNPACK_METHODS
41702 1 : if (likely(PyMethod_Check(__pyx_t_5))) {
41703 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
41704 0 : if (likely(__pyx_t_1)) {
41705 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
41706 0 : __Pyx_INCREF(__pyx_t_1);
41707 0 : __Pyx_INCREF(function);
41708 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
41709 : __pyx_t_8 = 1;
41710 : }
41711 : }
41712 : #endif
41713 : {
41714 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
41715 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
41716 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
41717 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error)
41718 1 : __Pyx_GOTREF(__pyx_t_2);
41719 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41720 : }
41721 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1116, __pyx_L1_error)
41722 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
41723 : {
41724 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41725 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
41726 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41727 1 : if (unlikely(__pyx_t_3 < 0)) {
41728 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
41729 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41730 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
41731 : __Pyx_RaiseBufferFallbackError();
41732 : } else {
41733 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
41734 : }
41735 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
41736 : }
41737 1 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
41738 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error)
41739 : }
41740 1 : __pyx_t_9 = 0;
41741 1 : __pyx_v_v1 = ((PyArrayObject *)__pyx_t_2);
41742 1 : __pyx_t_2 = 0;
41743 :
41744 : /* "scipy/linalg/_decomp_interpolative.pyx":1117
41745 : *
41746 : * v1 = rng.uniform(low=-1, high=1, size=(n, 2)).view(np.complex128).ravel()
41747 : * v1 /= dznrm2(&n, &v1[0], &intone) # <<<<<<<<<<<<<<
41748 : *
41749 : * for j in range(its):
41750 : */
41751 1 : __pyx_t_13 = 0;
41752 1 : __pyx_t_2 = PyFloat_FromDouble(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v1.diminfo[0].strides))), (&__pyx_v_intone))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
41753 1 : __Pyx_GOTREF(__pyx_t_2);
41754 1 : __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v1), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __pyx_L1_error)
41755 1 : __Pyx_GOTREF(__pyx_t_5);
41756 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41757 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1117, __pyx_L1_error)
41758 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
41759 : {
41760 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41761 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
41762 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41763 1 : if (unlikely(__pyx_t_3 < 0)) {
41764 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
41765 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41766 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
41767 0 : __Pyx_RaiseBufferFallbackError();
41768 : } else {
41769 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
41770 : }
41771 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
41772 : }
41773 1 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
41774 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error)
41775 : }
41776 1 : __pyx_t_9 = 0;
41777 1 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_5));
41778 : __pyx_t_5 = 0;
41779 :
41780 : /* "scipy/linalg/_decomp_interpolative.pyx":1119
41781 : * v1 /= dznrm2(&n, &v1[0], &intone)
41782 : *
41783 : * for j in range(its): # <<<<<<<<<<<<<<
41784 : * u1 = A.matvec(v1)
41785 : * u2 = B.matvec(v1)
41786 : */
41787 21 : __pyx_t_3 = __pyx_v_its;
41788 : __pyx_t_14 = __pyx_t_3;
41789 21 : for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
41790 20 : __pyx_v_j = __pyx_t_15;
41791 :
41792 : /* "scipy/linalg/_decomp_interpolative.pyx":1120
41793 : *
41794 : * for j in range(its):
41795 : * u1 = A.matvec(v1) # <<<<<<<<<<<<<<
41796 : * u2 = B.matvec(v1)
41797 : * u1 -= u2
41798 : */
41799 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1120, __pyx_L1_error)
41800 20 : __Pyx_GOTREF(__pyx_t_2);
41801 20 : __pyx_t_1 = NULL;
41802 20 : __pyx_t_8 = 0;
41803 : #if CYTHON_UNPACK_METHODS
41804 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
41805 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
41806 20 : if (likely(__pyx_t_1)) {
41807 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
41808 20 : __Pyx_INCREF(__pyx_t_1);
41809 20 : __Pyx_INCREF(function);
41810 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
41811 : __pyx_t_8 = 1;
41812 : }
41813 : }
41814 : #endif
41815 : {
41816 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_v1)};
41817 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
41818 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
41819 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1120, __pyx_L1_error)
41820 20 : __Pyx_GOTREF(__pyx_t_5);
41821 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41822 : }
41823 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1120, __pyx_L1_error)
41824 20 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
41825 : {
41826 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41827 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
41828 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41829 20 : if (unlikely(__pyx_t_17 < 0)) {
41830 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
41831 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_v_u1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41832 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
41833 0 : __Pyx_RaiseBufferFallbackError();
41834 : } else {
41835 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
41836 : }
41837 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
41838 : }
41839 20 : __pyx_pybuffernd_u1.diminfo[0].strides = __pyx_pybuffernd_u1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u1.diminfo[0].shape = __pyx_pybuffernd_u1.rcbuffer->pybuffer.shape[0];
41840 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1120, __pyx_L1_error)
41841 : }
41842 20 : __pyx_t_16 = 0;
41843 20 : __Pyx_XDECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_5));
41844 20 : __pyx_t_5 = 0;
41845 :
41846 : /* "scipy/linalg/_decomp_interpolative.pyx":1121
41847 : * for j in range(its):
41848 : * u1 = A.matvec(v1)
41849 : * u2 = B.matvec(v1) # <<<<<<<<<<<<<<
41850 : * u1 -= u2
41851 : * v1 = A.rmatvec(u1)
41852 : */
41853 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_matvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error)
41854 20 : __Pyx_GOTREF(__pyx_t_2);
41855 20 : __pyx_t_1 = NULL;
41856 20 : __pyx_t_8 = 0;
41857 : #if CYTHON_UNPACK_METHODS
41858 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
41859 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
41860 20 : if (likely(__pyx_t_1)) {
41861 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
41862 20 : __Pyx_INCREF(__pyx_t_1);
41863 20 : __Pyx_INCREF(function);
41864 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
41865 : __pyx_t_8 = 1;
41866 : }
41867 : }
41868 : #endif
41869 : {
41870 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_v1)};
41871 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
41872 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
41873 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1121, __pyx_L1_error)
41874 20 : __Pyx_GOTREF(__pyx_t_5);
41875 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41876 : }
41877 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1121, __pyx_L1_error)
41878 20 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
41879 : {
41880 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41881 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
41882 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u2.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41883 20 : if (unlikely(__pyx_t_17 < 0)) {
41884 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
41885 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u2.rcbuffer->pybuffer, (PyObject*)__pyx_v_u2, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41886 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
41887 0 : __Pyx_RaiseBufferFallbackError();
41888 : } else {
41889 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
41890 : }
41891 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
41892 : }
41893 20 : __pyx_pybuffernd_u2.diminfo[0].strides = __pyx_pybuffernd_u2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u2.diminfo[0].shape = __pyx_pybuffernd_u2.rcbuffer->pybuffer.shape[0];
41894 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1121, __pyx_L1_error)
41895 : }
41896 20 : __pyx_t_18 = 0;
41897 20 : __Pyx_XDECREF_SET(__pyx_v_u2, ((PyArrayObject *)__pyx_t_5));
41898 20 : __pyx_t_5 = 0;
41899 :
41900 : /* "scipy/linalg/_decomp_interpolative.pyx":1122
41901 : * u1 = A.matvec(v1)
41902 : * u2 = B.matvec(v1)
41903 : * u1 -= u2 # <<<<<<<<<<<<<<
41904 : * v1 = A.rmatvec(u1)
41905 : * v2 = B.rmatvec(u1)
41906 : */
41907 20 : __pyx_t_5 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_u1), ((PyObject *)__pyx_v_u2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1122, __pyx_L1_error)
41908 20 : __Pyx_GOTREF(__pyx_t_5);
41909 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1122, __pyx_L1_error)
41910 20 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
41911 : {
41912 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41913 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
41914 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41915 20 : if (unlikely(__pyx_t_17 < 0)) {
41916 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
41917 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u1.rcbuffer->pybuffer, (PyObject*)__pyx_v_u1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41918 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
41919 0 : __Pyx_RaiseBufferFallbackError();
41920 : } else {
41921 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
41922 : }
41923 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
41924 : }
41925 20 : __pyx_pybuffernd_u1.diminfo[0].strides = __pyx_pybuffernd_u1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u1.diminfo[0].shape = __pyx_pybuffernd_u1.rcbuffer->pybuffer.shape[0];
41926 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error)
41927 : }
41928 20 : __pyx_t_16 = 0;
41929 20 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_5));
41930 20 : __pyx_t_5 = 0;
41931 :
41932 : /* "scipy/linalg/_decomp_interpolative.pyx":1123
41933 : * u2 = B.matvec(v1)
41934 : * u1 -= u2
41935 : * v1 = A.rmatvec(u1) # <<<<<<<<<<<<<<
41936 : * v2 = B.rmatvec(u1)
41937 : * v1 -= v2
41938 : */
41939 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error)
41940 20 : __Pyx_GOTREF(__pyx_t_2);
41941 20 : __pyx_t_1 = NULL;
41942 20 : __pyx_t_8 = 0;
41943 : #if CYTHON_UNPACK_METHODS
41944 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
41945 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
41946 20 : if (likely(__pyx_t_1)) {
41947 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
41948 20 : __Pyx_INCREF(__pyx_t_1);
41949 20 : __Pyx_INCREF(function);
41950 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
41951 : __pyx_t_8 = 1;
41952 : }
41953 : }
41954 : #endif
41955 : {
41956 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_u1)};
41957 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
41958 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
41959 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1123, __pyx_L1_error)
41960 20 : __Pyx_GOTREF(__pyx_t_5);
41961 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41962 : }
41963 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1123, __pyx_L1_error)
41964 20 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
41965 : {
41966 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
41967 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
41968 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
41969 20 : if (unlikely(__pyx_t_17 < 0)) {
41970 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
41971 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
41972 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
41973 0 : __Pyx_RaiseBufferFallbackError();
41974 : } else {
41975 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
41976 : }
41977 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
41978 : }
41979 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
41980 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1123, __pyx_L1_error)
41981 : }
41982 20 : __pyx_t_9 = 0;
41983 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_5));
41984 20 : __pyx_t_5 = 0;
41985 :
41986 : /* "scipy/linalg/_decomp_interpolative.pyx":1124
41987 : * u1 -= u2
41988 : * v1 = A.rmatvec(u1)
41989 : * v2 = B.rmatvec(u1) # <<<<<<<<<<<<<<
41990 : * v1 -= v2
41991 : *
41992 : */
41993 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error)
41994 20 : __Pyx_GOTREF(__pyx_t_2);
41995 20 : __pyx_t_1 = NULL;
41996 20 : __pyx_t_8 = 0;
41997 : #if CYTHON_UNPACK_METHODS
41998 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
41999 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
42000 20 : if (likely(__pyx_t_1)) {
42001 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
42002 20 : __Pyx_INCREF(__pyx_t_1);
42003 20 : __Pyx_INCREF(function);
42004 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
42005 : __pyx_t_8 = 1;
42006 : }
42007 : }
42008 : #endif
42009 : {
42010 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_u1)};
42011 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
42012 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
42013 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error)
42014 20 : __Pyx_GOTREF(__pyx_t_5);
42015 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42016 : }
42017 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1124, __pyx_L1_error)
42018 20 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_5);
42019 : {
42020 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42021 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
42022 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
42023 20 : if (unlikely(__pyx_t_17 < 0)) {
42024 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
42025 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
42026 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
42027 0 : __Pyx_RaiseBufferFallbackError();
42028 : } else {
42029 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
42030 : }
42031 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
42032 : }
42033 20 : __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0];
42034 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1124, __pyx_L1_error)
42035 : }
42036 20 : __pyx_t_19 = 0;
42037 20 : __Pyx_XDECREF_SET(__pyx_v_v2, ((PyArrayObject *)__pyx_t_5));
42038 20 : __pyx_t_5 = 0;
42039 :
42040 : /* "scipy/linalg/_decomp_interpolative.pyx":1125
42041 : * v1 = A.rmatvec(u1)
42042 : * v2 = B.rmatvec(u1)
42043 : * v1 -= v2 # <<<<<<<<<<<<<<
42044 : *
42045 : * snorm = dznrm2(&n, &v1[0], &intone)
42046 : */
42047 20 : __pyx_t_5 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_v1), ((PyObject *)__pyx_v_v2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1125, __pyx_L1_error)
42048 20 : __Pyx_GOTREF(__pyx_t_5);
42049 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1125, __pyx_L1_error)
42050 20 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
42051 : {
42052 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42053 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
42054 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
42055 20 : if (unlikely(__pyx_t_17 < 0)) {
42056 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
42057 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
42058 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
42059 0 : __Pyx_RaiseBufferFallbackError();
42060 : } else {
42061 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
42062 : }
42063 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
42064 : }
42065 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
42066 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1125, __pyx_L1_error)
42067 : }
42068 20 : __pyx_t_9 = 0;
42069 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_5));
42070 20 : __pyx_t_5 = 0;
42071 :
42072 : /* "scipy/linalg/_decomp_interpolative.pyx":1127
42073 : * v1 -= v2
42074 : *
42075 : * snorm = dznrm2(&n, &v1[0], &intone) # <<<<<<<<<<<<<<
42076 : * if snorm > 0.0:
42077 : * v1 /= snorm
42078 : */
42079 20 : __pyx_t_13 = 0;
42080 20 : __pyx_v_snorm = __pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v1.diminfo[0].strides))), (&__pyx_v_intone));
42081 :
42082 : /* "scipy/linalg/_decomp_interpolative.pyx":1128
42083 : *
42084 : * snorm = dznrm2(&n, &v1[0], &intone)
42085 : * if snorm > 0.0: # <<<<<<<<<<<<<<
42086 : * v1 /= snorm
42087 : *
42088 : */
42089 20 : __pyx_t_20 = (__pyx_v_snorm > 0.0);
42090 20 : if (__pyx_t_20) {
42091 :
42092 : /* "scipy/linalg/_decomp_interpolative.pyx":1129
42093 : * snorm = dznrm2(&n, &v1[0], &intone)
42094 : * if snorm > 0.0:
42095 : * v1 /= snorm # <<<<<<<<<<<<<<
42096 : *
42097 : * snorm = np.sqrt(snorm)
42098 : */
42099 20 : __pyx_t_5 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1129, __pyx_L1_error)
42100 20 : __Pyx_GOTREF(__pyx_t_5);
42101 20 : __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v1), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error)
42102 20 : __Pyx_GOTREF(__pyx_t_2);
42103 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42104 20 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1129, __pyx_L1_error)
42105 20 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
42106 : {
42107 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42108 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
42109 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
42110 20 : if (unlikely(__pyx_t_17 < 0)) {
42111 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
42112 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
42113 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
42114 0 : __Pyx_RaiseBufferFallbackError();
42115 : } else {
42116 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
42117 : }
42118 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
42119 : }
42120 20 : __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
42121 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error)
42122 : }
42123 20 : __pyx_t_9 = 0;
42124 20 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_2));
42125 : __pyx_t_2 = 0;
42126 :
42127 : /* "scipy/linalg/_decomp_interpolative.pyx":1128
42128 : *
42129 : * snorm = dznrm2(&n, &v1[0], &intone)
42130 : * if snorm > 0.0: # <<<<<<<<<<<<<<
42131 : * v1 /= snorm
42132 : *
42133 : */
42134 : }
42135 :
42136 : /* "scipy/linalg/_decomp_interpolative.pyx":1131
42137 : * v1 /= snorm
42138 : *
42139 : * snorm = np.sqrt(snorm) # <<<<<<<<<<<<<<
42140 : *
42141 : * return snorm
42142 : */
42143 20 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error)
42144 20 : __Pyx_GOTREF(__pyx_t_5);
42145 20 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error)
42146 20 : __Pyx_GOTREF(__pyx_t_1);
42147 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42148 20 : __pyx_t_5 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error)
42149 20 : __Pyx_GOTREF(__pyx_t_5);
42150 20 : __pyx_t_4 = NULL;
42151 20 : __pyx_t_8 = 0;
42152 : #if CYTHON_UNPACK_METHODS
42153 20 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
42154 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
42155 0 : if (likely(__pyx_t_4)) {
42156 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
42157 0 : __Pyx_INCREF(__pyx_t_4);
42158 0 : __Pyx_INCREF(function);
42159 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
42160 : __pyx_t_8 = 1;
42161 : }
42162 : }
42163 : #endif
42164 : {
42165 20 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
42166 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
42167 20 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42168 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42169 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error)
42170 20 : __Pyx_GOTREF(__pyx_t_2);
42171 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42172 : }
42173 20 : __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_21 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1131, __pyx_L1_error)
42174 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42175 20 : __pyx_v_snorm = __pyx_t_21;
42176 : }
42177 :
42178 : /* "scipy/linalg/_decomp_interpolative.pyx":1133
42179 : * snorm = np.sqrt(snorm)
42180 : *
42181 : * return snorm # <<<<<<<<<<<<<<
42182 : *
42183 : *
42184 : */
42185 1 : __Pyx_XDECREF(__pyx_r);
42186 1 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error)
42187 1 : __Pyx_GOTREF(__pyx_t_2);
42188 1 : __pyx_r = __pyx_t_2;
42189 1 : __pyx_t_2 = 0;
42190 1 : goto __pyx_L0;
42191 :
42192 : /* "scipy/linalg/_decomp_interpolative.pyx":1108
42193 : *
42194 : *
42195 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
42196 : * cdef int n = A.shape[1], j = 0, intone = 1
42197 : * cdef cnp.float64_t snorm = 0.0
42198 : */
42199 :
42200 : /* function exit code */
42201 0 : __pyx_L1_error:;
42202 0 : __Pyx_XDECREF(__pyx_t_1);
42203 0 : __Pyx_XDECREF(__pyx_t_2);
42204 0 : __Pyx_XDECREF(__pyx_t_4);
42205 0 : __Pyx_XDECREF(__pyx_t_5);
42206 0 : __Pyx_XDECREF(__pyx_t_6);
42207 0 : __Pyx_XDECREF(__pyx_t_7);
42208 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
42209 0 : __Pyx_PyThreadState_declare
42210 0 : __Pyx_PyThreadState_assign
42211 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
42212 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
42213 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
42214 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
42215 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
42216 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
42217 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_diffsnorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
42218 0 : __pyx_r = NULL;
42219 0 : goto __pyx_L2;
42220 1 : __pyx_L0:;
42221 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u1.rcbuffer->pybuffer);
42222 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u2.rcbuffer->pybuffer);
42223 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
42224 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
42225 1 : __pyx_L2:;
42226 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v1);
42227 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v2);
42228 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u1);
42229 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u2);
42230 1 : __Pyx_XGIVEREF(__pyx_r);
42231 1 : __Pyx_RefNannyFinishContext();
42232 1 : return __pyx_r;
42233 : }
42234 :
42235 : /* "scipy/linalg/_decomp_interpolative.pyx":1136
42236 : *
42237 : *
42238 : * def idz_estrank(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
42239 : * rng):
42240 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, cols, k
42241 : */
42242 :
42243 : /* Python wrapper */
42244 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_43idz_estrank(PyObject *__pyx_self,
42245 : #if CYTHON_METH_FASTCALL
42246 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
42247 : #else
42248 : PyObject *__pyx_args, PyObject *__pyx_kwds
42249 : #endif
42250 : ); /*proto*/
42251 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_43idz_estrank = {"idz_estrank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_43idz_estrank, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
42252 5 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_43idz_estrank(PyObject *__pyx_self,
42253 : #if CYTHON_METH_FASTCALL
42254 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
42255 : #else
42256 : PyObject *__pyx_args, PyObject *__pyx_kwds
42257 : #endif
42258 : ) {
42259 5 : PyArrayObject *__pyx_v_a = 0;
42260 5 : double __pyx_v_eps;
42261 5 : PyObject *__pyx_v_rng = 0;
42262 : #if !CYTHON_METH_FASTCALL
42263 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
42264 : #endif
42265 5 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
42266 5 : PyObject* values[3] = {0,0,0};
42267 5 : int __pyx_lineno = 0;
42268 5 : const char *__pyx_filename = NULL;
42269 5 : int __pyx_clineno = 0;
42270 5 : PyObject *__pyx_r = 0;
42271 : __Pyx_RefNannyDeclarations
42272 5 : __Pyx_RefNannySetupContext("idz_estrank (wrapper)", 0);
42273 : #if !CYTHON_METH_FASTCALL
42274 : #if CYTHON_ASSUME_SAFE_MACROS
42275 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
42276 : #else
42277 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
42278 : #endif
42279 : #endif
42280 5 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
42281 : {
42282 5 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
42283 5 : if (likely(__pyx_kwds)) {
42284 5 : Py_ssize_t kw_args;
42285 5 : switch (__pyx_nargs) {
42286 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
42287 5 : CYTHON_FALLTHROUGH;
42288 5 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
42289 5 : CYTHON_FALLTHROUGH;
42290 5 : case 0: break;
42291 0 : default: goto __pyx_L5_argtuple_error;
42292 : }
42293 5 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
42294 5 : switch (__pyx_nargs) {
42295 : case 0:
42296 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
42297 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
42298 0 : kw_args--;
42299 : }
42300 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L3_error)
42301 0 : else goto __pyx_L5_argtuple_error;
42302 3 : CYTHON_FALLTHROUGH;
42303 : case 1:
42304 3 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
42305 3 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
42306 3 : kw_args--;
42307 : }
42308 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L3_error)
42309 : else {
42310 0 : __Pyx_RaiseArgtupleInvalid("idz_estrank", 1, 2, 2, 1); __PYX_ERR(0, 1136, __pyx_L3_error)
42311 : }
42312 5 : CYTHON_FALLTHROUGH;
42313 : case 2:
42314 5 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
42315 5 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
42316 5 : kw_args--;
42317 : }
42318 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L3_error)
42319 : else {
42320 0 : __Pyx_RaiseKeywordRequired("idz_estrank", __pyx_n_s_rng); __PYX_ERR(0, 1136, __pyx_L3_error)
42321 : }
42322 : }
42323 5 : if (unlikely(kw_args > 0)) {
42324 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
42325 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_estrank") < 0)) __PYX_ERR(0, 1136, __pyx_L3_error)
42326 : }
42327 0 : } else if (unlikely(__pyx_nargs != 2)) {
42328 0 : goto __pyx_L5_argtuple_error;
42329 : } else {
42330 0 : __Pyx_RaiseKeywordRequired("idz_estrank", __pyx_n_s_rng); __PYX_ERR(0, 1136, __pyx_L3_error)
42331 : }
42332 5 : __pyx_v_a = ((PyArrayObject *)values[0]);
42333 5 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L3_error)
42334 5 : __pyx_v_rng = values[2];
42335 : }
42336 5 : goto __pyx_L6_skip;
42337 0 : __pyx_L5_argtuple_error:;
42338 0 : __Pyx_RaiseArgtupleInvalid("idz_estrank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1136, __pyx_L3_error)
42339 5 : __pyx_L6_skip:;
42340 5 : goto __pyx_L4_argument_unpacking_done;
42341 0 : __pyx_L3_error:;
42342 : {
42343 0 : Py_ssize_t __pyx_temp;
42344 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
42345 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
42346 : }
42347 : }
42348 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_estrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
42349 0 : __Pyx_RefNannyFinishContext();
42350 0 : return NULL;
42351 5 : __pyx_L4_argument_unpacking_done:;
42352 5 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1136, __pyx_L1_error)
42353 5 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_42idz_estrank(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
42354 :
42355 : /* function exit code */
42356 5 : goto __pyx_L0;
42357 0 : __pyx_L1_error:;
42358 0 : __pyx_r = NULL;
42359 5 : __pyx_L0:;
42360 : {
42361 5 : Py_ssize_t __pyx_temp;
42362 5 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
42363 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
42364 : }
42365 : }
42366 : __Pyx_RefNannyFinishContext();
42367 : return __pyx_r;
42368 : }
42369 :
42370 5 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_42idz_estrank(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng) {
42371 5 : int __pyx_v_m;
42372 5 : int __pyx_v_n;
42373 5 : int __pyx_v_n2;
42374 5 : int __pyx_v_nsteps;
42375 5 : int __pyx_v_row;
42376 5 : int __pyx_v_r;
42377 5 : int __pyx_v_nstep;
42378 5 : int __pyx_v_cols;
42379 5 : int __pyx_v_k;
42380 5 : __pyx_t_5numpy_float64_t __pyx_v_h;
42381 5 : __pyx_t_5numpy_float64_t __pyx_v_alpha;
42382 5 : __pyx_t_5numpy_float64_t __pyx_v_beta;
42383 5 : PyArrayObject *__pyx_v_albetas = 0;
42384 5 : PyArrayObject *__pyx_v_tau_arr = 0;
42385 5 : PyArrayObject *__pyx_v_subselect = 0;
42386 5 : __Pyx_memviewslice __pyx_v_ff = { 0, 0, { 0 }, { 0 }, { 0 } };
42387 5 : PyArrayObject *__pyx_v_giv2x2 = 0;
42388 5 : PyArrayObject *__pyx_v_rta = 0;
42389 5 : PyArrayObject *__pyx_v_F = 0;
42390 5 : PyObject *__pyx_v_Fcopy = NULL;
42391 5 : PyObject *__pyx_v_sssmax = NULL;
42392 5 : PyObject *__pyx_v_nulls = NULL;
42393 5 : int __pyx_v_kk;
42394 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_F;
42395 5 : __Pyx_Buffer __pyx_pybuffer_F;
42396 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
42397 5 : __Pyx_Buffer __pyx_pybuffer_a;
42398 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_albetas;
42399 5 : __Pyx_Buffer __pyx_pybuffer_albetas;
42400 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_giv2x2;
42401 5 : __Pyx_Buffer __pyx_pybuffer_giv2x2;
42402 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rta;
42403 5 : __Pyx_Buffer __pyx_pybuffer_rta;
42404 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_subselect;
42405 5 : __Pyx_Buffer __pyx_pybuffer_subselect;
42406 5 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau_arr;
42407 5 : __Pyx_Buffer __pyx_pybuffer_tau_arr;
42408 5 : PyObject *__pyx_r = NULL;
42409 : __Pyx_RefNannyDeclarations
42410 5 : PyObject *__pyx_t_1 = NULL;
42411 5 : PyObject *__pyx_t_2 = NULL;
42412 5 : PyObject *__pyx_t_3 = NULL;
42413 5 : PyObject *__pyx_t_4 = NULL;
42414 5 : PyObject *__pyx_t_5 = NULL;
42415 5 : unsigned int __pyx_t_6;
42416 5 : PyArrayObject *__pyx_t_7 = NULL;
42417 5 : int __pyx_t_8;
42418 5 : PyObject *__pyx_t_9 = NULL;
42419 5 : PyObject *__pyx_t_10 = NULL;
42420 5 : PyObject *__pyx_t_11 = NULL;
42421 5 : PyObject *__pyx_t_12 = NULL;
42422 5 : PyArrayObject *__pyx_t_13 = NULL;
42423 5 : npy_intp __pyx_t_14[2];
42424 5 : PyArrayObject *__pyx_t_15 = NULL;
42425 5 : int __pyx_t_16;
42426 5 : int __pyx_t_17;
42427 5 : int __pyx_t_18;
42428 5 : long __pyx_t_19;
42429 5 : long __pyx_t_20;
42430 5 : Py_ssize_t __pyx_t_21;
42431 5 : Py_ssize_t __pyx_t_22;
42432 5 : Py_ssize_t __pyx_t_23;
42433 5 : __pyx_t_5numpy_float64_t __pyx_t_24;
42434 5 : __pyx_t_5numpy_float64_t __pyx_t_25;
42435 5 : PyObject *__pyx_t_26 = NULL;
42436 5 : PyArrayObject *__pyx_t_27 = NULL;
42437 5 : PyArrayObject *__pyx_t_28 = NULL;
42438 5 : int __pyx_t_29;
42439 5 : npy_intp __pyx_t_30[1];
42440 5 : PyArrayObject *__pyx_t_31 = NULL;
42441 5 : __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
42442 5 : int __pyx_t_33;
42443 5 : __pyx_t_double_complex __pyx_t_34;
42444 5 : PyObject *__pyx_t_35 = NULL;
42445 5 : Py_ssize_t __pyx_t_36;
42446 5 : Py_ssize_t __pyx_t_37;
42447 5 : int __pyx_lineno = 0;
42448 5 : const char *__pyx_filename = NULL;
42449 5 : int __pyx_clineno = 0;
42450 5 : __Pyx_RefNannySetupContext("idz_estrank", 1);
42451 5 : __pyx_pybuffer_albetas.pybuffer.buf = NULL;
42452 5 : __pyx_pybuffer_albetas.refcount = 0;
42453 5 : __pyx_pybuffernd_albetas.data = NULL;
42454 5 : __pyx_pybuffernd_albetas.rcbuffer = &__pyx_pybuffer_albetas;
42455 5 : __pyx_pybuffer_tau_arr.pybuffer.buf = NULL;
42456 5 : __pyx_pybuffer_tau_arr.refcount = 0;
42457 5 : __pyx_pybuffernd_tau_arr.data = NULL;
42458 5 : __pyx_pybuffernd_tau_arr.rcbuffer = &__pyx_pybuffer_tau_arr;
42459 5 : __pyx_pybuffer_subselect.pybuffer.buf = NULL;
42460 5 : __pyx_pybuffer_subselect.refcount = 0;
42461 5 : __pyx_pybuffernd_subselect.data = NULL;
42462 5 : __pyx_pybuffernd_subselect.rcbuffer = &__pyx_pybuffer_subselect;
42463 5 : __pyx_pybuffer_giv2x2.pybuffer.buf = NULL;
42464 5 : __pyx_pybuffer_giv2x2.refcount = 0;
42465 5 : __pyx_pybuffernd_giv2x2.data = NULL;
42466 5 : __pyx_pybuffernd_giv2x2.rcbuffer = &__pyx_pybuffer_giv2x2;
42467 5 : __pyx_pybuffer_rta.pybuffer.buf = NULL;
42468 5 : __pyx_pybuffer_rta.refcount = 0;
42469 5 : __pyx_pybuffernd_rta.data = NULL;
42470 5 : __pyx_pybuffernd_rta.rcbuffer = &__pyx_pybuffer_rta;
42471 5 : __pyx_pybuffer_F.pybuffer.buf = NULL;
42472 5 : __pyx_pybuffer_F.refcount = 0;
42473 5 : __pyx_pybuffernd_F.data = NULL;
42474 5 : __pyx_pybuffernd_F.rcbuffer = &__pyx_pybuffer_F;
42475 5 : __pyx_pybuffer_a.pybuffer.buf = NULL;
42476 5 : __pyx_pybuffer_a.refcount = 0;
42477 5 : __pyx_pybuffernd_a.data = NULL;
42478 5 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
42479 : {
42480 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42481 5 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1136, __pyx_L1_error)
42482 : }
42483 5 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
42484 :
42485 : /* "scipy/linalg/_decomp_interpolative.pyx":1138
42486 : * def idz_estrank(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *,
42487 : * rng):
42488 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, cols, k # <<<<<<<<<<<<<<
42489 : * cdef cnp.float64_t h, alpha, beta
42490 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=3] albetas
42491 : */
42492 5 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
42493 5 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
42494 5 : __pyx_v_nsteps = 3;
42495 :
42496 : /* "scipy/linalg/_decomp_interpolative.pyx":1148
42497 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] F
42498 : *
42499 : * n2 = idd_poweroftwo(m) # <<<<<<<<<<<<<<
42500 : * # This part is the initialization that is done via idz_frmi
42501 : * # for a Subsampled Randomized Fourier Transform (SRFT).
42502 : */
42503 5 : __pyx_v_n2 = __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(__pyx_v_m);
42504 :
42505 : /* "scipy/linalg/_decomp_interpolative.pyx":1154
42506 : * # Draw (nsteps x m x 4) array from [0, 2)*pi uniformly for
42507 : * # random points on complex unit circle and unitary rotations
42508 : * albetas = np.empty([nsteps, m, 4]) # <<<<<<<<<<<<<<
42509 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
42510 : * albetas[:, :, 2:] *= np.pi
42511 : */
42512 5 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
42513 5 : __Pyx_GOTREF(__pyx_t_2);
42514 5 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
42515 5 : __Pyx_GOTREF(__pyx_t_3);
42516 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42517 5 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
42518 5 : __Pyx_GOTREF(__pyx_t_2);
42519 5 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error)
42520 5 : __Pyx_GOTREF(__pyx_t_4);
42521 5 : __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __pyx_L1_error)
42522 5 : __Pyx_GOTREF(__pyx_t_5);
42523 5 : __Pyx_GIVEREF(__pyx_t_2);
42524 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error);
42525 5 : __Pyx_GIVEREF(__pyx_t_4);
42526 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 1154, __pyx_L1_error);
42527 5 : __Pyx_INCREF(__pyx_int_4);
42528 5 : __Pyx_GIVEREF(__pyx_int_4);
42529 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_int_4)) __PYX_ERR(0, 1154, __pyx_L1_error);
42530 5 : __pyx_t_2 = 0;
42531 5 : __pyx_t_4 = 0;
42532 5 : __pyx_t_4 = NULL;
42533 5 : __pyx_t_6 = 0;
42534 : #if CYTHON_UNPACK_METHODS
42535 5 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
42536 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
42537 0 : if (likely(__pyx_t_4)) {
42538 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
42539 0 : __Pyx_INCREF(__pyx_t_4);
42540 0 : __Pyx_INCREF(function);
42541 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
42542 : __pyx_t_6 = 1;
42543 : }
42544 : }
42545 : #endif
42546 : {
42547 5 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
42548 5 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
42549 5 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42550 5 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42551 5 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
42552 5 : __Pyx_GOTREF(__pyx_t_1);
42553 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42554 : }
42555 5 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1154, __pyx_L1_error)
42556 5 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
42557 : {
42558 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42559 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
42560 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
42561 5 : if (unlikely(__pyx_t_8 < 0)) {
42562 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
42563 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_v_albetas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
42564 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
42565 : __Pyx_RaiseBufferFallbackError();
42566 : } else {
42567 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
42568 : }
42569 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
42570 : }
42571 5 : __pyx_pybuffernd_albetas.diminfo[0].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_albetas.diminfo[0].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_albetas.diminfo[1].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_albetas.diminfo[1].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_albetas.diminfo[2].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_albetas.diminfo[2].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[2];
42572 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1154, __pyx_L1_error)
42573 : }
42574 5 : __pyx_t_7 = 0;
42575 5 : __pyx_v_albetas = ((PyArrayObject *)__pyx_t_1);
42576 5 : __pyx_t_1 = 0;
42577 :
42578 : /* "scipy/linalg/_decomp_interpolative.pyx":1155
42579 : * # random points on complex unit circle and unitary rotations
42580 : * albetas = np.empty([nsteps, m, 4])
42581 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2]) # <<<<<<<<<<<<<<
42582 : * albetas[:, :, 2:] *= np.pi
42583 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
42584 : */
42585 5 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error)
42586 5 : __Pyx_GOTREF(__pyx_t_1);
42587 5 : __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error)
42588 5 : __Pyx_GOTREF(__pyx_t_3);
42589 5 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_low, __pyx_float_0_0) < 0) __PYX_ERR(0, 1155, __pyx_L1_error)
42590 5 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_high, __pyx_float_2_0) < 0) __PYX_ERR(0, 1155, __pyx_L1_error)
42591 5 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error)
42592 5 : __Pyx_GOTREF(__pyx_t_5);
42593 5 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error)
42594 5 : __Pyx_GOTREF(__pyx_t_4);
42595 5 : __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
42596 5 : __Pyx_GOTREF(__pyx_t_2);
42597 5 : __Pyx_GIVEREF(__pyx_t_5);
42598 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error);
42599 5 : __Pyx_GIVEREF(__pyx_t_4);
42600 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error);
42601 5 : __Pyx_INCREF(__pyx_int_2);
42602 5 : __Pyx_GIVEREF(__pyx_int_2);
42603 5 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_2)) __PYX_ERR(0, 1155, __pyx_L1_error);
42604 5 : __pyx_t_5 = 0;
42605 5 : __pyx_t_4 = 0;
42606 5 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(0, 1155, __pyx_L1_error)
42607 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42608 5 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
42609 5 : __Pyx_GOTREF(__pyx_t_2);
42610 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42611 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42612 5 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__17, __pyx_t_2) < 0))) __PYX_ERR(0, 1155, __pyx_L1_error)
42613 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42614 :
42615 : /* "scipy/linalg/_decomp_interpolative.pyx":1156
42616 : * albetas = np.empty([nsteps, m, 4])
42617 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
42618 : * albetas[:, :, 2:] *= np.pi # <<<<<<<<<<<<<<
42619 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
42620 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
42621 : */
42622 5 : __Pyx_INCREF(__pyx_tuple__17);
42623 5 : __pyx_t_12 = __pyx_tuple__17;
42624 5 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
42625 5 : __Pyx_GOTREF(__pyx_t_2);
42626 5 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error)
42627 5 : __Pyx_GOTREF(__pyx_t_3);
42628 5 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
42629 5 : __Pyx_GOTREF(__pyx_t_1);
42630 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42631 5 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error)
42632 5 : __Pyx_GOTREF(__pyx_t_3);
42633 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42634 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42635 5 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_albetas), __pyx_t_12, __pyx_t_3) < 0))) __PYX_ERR(0, 1156, __pyx_L1_error)
42636 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42637 5 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42638 :
42639 : /* "scipy/linalg/_decomp_interpolative.pyx":1157
42640 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
42641 : * albetas[:, :, 2:] *= np.pi
42642 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0]) # <<<<<<<<<<<<<<
42643 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
42644 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
42645 : */
42646 5 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
42647 5 : __Pyx_GOTREF(__pyx_t_3);
42648 5 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
42649 5 : __Pyx_GOTREF(__pyx_t_1);
42650 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42651 5 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
42652 5 : __Pyx_GOTREF(__pyx_t_3);
42653 5 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error)
42654 5 : __Pyx_GOTREF(__pyx_t_2);
42655 5 : __Pyx_GIVEREF(__pyx_t_3);
42656 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error);
42657 5 : __pyx_t_3 = 0;
42658 5 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
42659 5 : __Pyx_GOTREF(__pyx_t_3);
42660 5 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error)
42661 5 : __Pyx_GOTREF(__pyx_t_4);
42662 5 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out, __pyx_t_4) < 0) __PYX_ERR(0, 1157, __pyx_L1_error)
42663 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42664 5 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error)
42665 5 : __Pyx_GOTREF(__pyx_t_4);
42666 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42667 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42668 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42669 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42670 :
42671 : /* "scipy/linalg/_decomp_interpolative.pyx":1158
42672 : * albetas[:, :, 2:] *= np.pi
42673 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
42674 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1]) # <<<<<<<<<<<<<<
42675 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
42676 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
42677 : */
42678 5 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
42679 5 : __Pyx_GOTREF(__pyx_t_4);
42680 5 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error)
42681 5 : __Pyx_GOTREF(__pyx_t_3);
42682 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42683 5 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
42684 5 : __Pyx_GOTREF(__pyx_t_4);
42685 5 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error)
42686 5 : __Pyx_GOTREF(__pyx_t_2);
42687 5 : __Pyx_GIVEREF(__pyx_t_4);
42688 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error);
42689 5 : __pyx_t_4 = 0;
42690 5 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
42691 5 : __Pyx_GOTREF(__pyx_t_4);
42692 5 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error)
42693 5 : __Pyx_GOTREF(__pyx_t_1);
42694 5 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_out, __pyx_t_1) < 0) __PYX_ERR(0, 1158, __pyx_L1_error)
42695 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42696 5 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error)
42697 5 : __Pyx_GOTREF(__pyx_t_1);
42698 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42699 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42700 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42701 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42702 :
42703 : /* "scipy/linalg/_decomp_interpolative.pyx":1159
42704 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
42705 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
42706 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2]) # <<<<<<<<<<<<<<
42707 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
42708 : *
42709 : */
42710 5 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
42711 5 : __Pyx_GOTREF(__pyx_t_1);
42712 5 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
42713 5 : __Pyx_GOTREF(__pyx_t_4);
42714 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42715 5 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
42716 5 : __Pyx_GOTREF(__pyx_t_1);
42717 5 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error)
42718 5 : __Pyx_GOTREF(__pyx_t_2);
42719 5 : __Pyx_GIVEREF(__pyx_t_1);
42720 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error);
42721 5 : __pyx_t_1 = 0;
42722 5 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
42723 5 : __Pyx_GOTREF(__pyx_t_1);
42724 5 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error)
42725 5 : __Pyx_GOTREF(__pyx_t_3);
42726 5 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out, __pyx_t_3) < 0) __PYX_ERR(0, 1159, __pyx_L1_error)
42727 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42728 5 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error)
42729 5 : __Pyx_GOTREF(__pyx_t_3);
42730 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42731 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42732 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42733 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42734 :
42735 : /* "scipy/linalg/_decomp_interpolative.pyx":1160
42736 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
42737 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
42738 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3]) # <<<<<<<<<<<<<<
42739 : *
42740 : * # idd_random_transf
42741 : */
42742 5 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error)
42743 5 : __Pyx_GOTREF(__pyx_t_3);
42744 5 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
42745 5 : __Pyx_GOTREF(__pyx_t_1);
42746 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42747 5 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error)
42748 5 : __Pyx_GOTREF(__pyx_t_3);
42749 5 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
42750 5 : __Pyx_GOTREF(__pyx_t_2);
42751 5 : __Pyx_GIVEREF(__pyx_t_3);
42752 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error);
42753 5 : __pyx_t_3 = 0;
42754 5 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error)
42755 5 : __Pyx_GOTREF(__pyx_t_3);
42756 5 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error)
42757 5 : __Pyx_GOTREF(__pyx_t_4);
42758 5 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out, __pyx_t_4) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
42759 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42760 5 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error)
42761 5 : __Pyx_GOTREF(__pyx_t_4);
42762 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42763 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42764 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42765 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42766 :
42767 : /* "scipy/linalg/_decomp_interpolative.pyx":1163
42768 : *
42769 : * # idd_random_transf
42770 : * rta = a.copy() # <<<<<<<<<<<<<<
42771 : *
42772 : * # Rotate and shuffle "a" nsteps-many times
42773 : */
42774 5 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L1_error)
42775 5 : __Pyx_GOTREF(__pyx_t_3);
42776 5 : __pyx_t_2 = NULL;
42777 5 : __pyx_t_6 = 0;
42778 : #if CYTHON_UNPACK_METHODS
42779 5 : if (likely(PyMethod_Check(__pyx_t_3))) {
42780 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
42781 0 : if (likely(__pyx_t_2)) {
42782 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
42783 0 : __Pyx_INCREF(__pyx_t_2);
42784 0 : __Pyx_INCREF(function);
42785 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
42786 : __pyx_t_6 = 1;
42787 : }
42788 : }
42789 : #endif
42790 : {
42791 5 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
42792 5 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
42793 5 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
42794 5 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1163, __pyx_L1_error)
42795 5 : __Pyx_GOTREF(__pyx_t_4);
42796 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42797 : }
42798 5 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1163, __pyx_L1_error)
42799 5 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_4);
42800 : {
42801 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42802 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
42803 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
42804 5 : if (unlikely(__pyx_t_8 < 0)) {
42805 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
42806 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
42807 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
42808 : __Pyx_RaiseBufferFallbackError();
42809 : } else {
42810 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
42811 : }
42812 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
42813 : }
42814 5 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
42815 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1163, __pyx_L1_error)
42816 : }
42817 5 : __pyx_t_13 = 0;
42818 5 : __pyx_v_rta = ((PyArrayObject *)__pyx_t_4);
42819 5 : __pyx_t_4 = 0;
42820 :
42821 : /* "scipy/linalg/_decomp_interpolative.pyx":1166
42822 : *
42823 : * # Rotate and shuffle "a" nsteps-many times
42824 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
42825 : * for nstep in range(nsteps):
42826 : * # Multiply with a point on the unit circle
42827 : */
42828 5 : __pyx_t_14[0] = 2;
42829 5 : __pyx_t_14[1] = 2;
42830 5 : __pyx_t_4 = PyArray_ZEROS(2, __pyx_t_14, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1166, __pyx_L1_error)
42831 5 : __Pyx_GOTREF(__pyx_t_4);
42832 5 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1166, __pyx_L1_error)
42833 5 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
42834 : {
42835 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42836 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
42837 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
42838 5 : if (unlikely(__pyx_t_8 < 0)) {
42839 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
42840 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_v_giv2x2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
42841 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
42842 : __Pyx_RaiseBufferFallbackError();
42843 : } else {
42844 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
42845 : }
42846 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
42847 : }
42848 5 : __pyx_pybuffernd_giv2x2.diminfo[0].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_giv2x2.diminfo[0].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_giv2x2.diminfo[1].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_giv2x2.diminfo[1].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[1];
42849 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1166, __pyx_L1_error)
42850 : }
42851 5 : __pyx_t_15 = 0;
42852 5 : __pyx_v_giv2x2 = ((PyArrayObject *)__pyx_t_4);
42853 5 : __pyx_t_4 = 0;
42854 :
42855 : /* "scipy/linalg/_decomp_interpolative.pyx":1167
42856 : * # Rotate and shuffle "a" nsteps-many times
42857 : * giv2x2 = cnp.PyArray_ZEROS(2, [2, 2], cnp.NPY_FLOAT64, 0)
42858 : * for nstep in range(nsteps): # <<<<<<<<<<<<<<
42859 : * # Multiply with a point on the unit circle
42860 : * rta *= albetas[nstep, :, 2:].view(np.complex128)
42861 : */
42862 5 : __pyx_t_8 = __pyx_v_nsteps;
42863 5 : __pyx_t_16 = __pyx_t_8;
42864 20 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
42865 15 : __pyx_v_nstep = __pyx_t_17;
42866 :
42867 : /* "scipy/linalg/_decomp_interpolative.pyx":1169
42868 : * for nstep in range(nsteps):
42869 : * # Multiply with a point on the unit circle
42870 : * rta *= albetas[nstep, :, 2:].view(np.complex128) # <<<<<<<<<<<<<<
42871 : * # Rotate
42872 : * for row in range(m-1):
42873 : */
42874 15 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nstep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error)
42875 15 : __Pyx_GOTREF(__pyx_t_3);
42876 15 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
42877 15 : __Pyx_GOTREF(__pyx_t_2);
42878 15 : __Pyx_GIVEREF(__pyx_t_3);
42879 15 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error);
42880 15 : __Pyx_INCREF(__pyx_slice__5);
42881 15 : __Pyx_GIVEREF(__pyx_slice__5);
42882 15 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 1169, __pyx_L1_error);
42883 15 : __Pyx_INCREF(__pyx_slice__16);
42884 15 : __Pyx_GIVEREF(__pyx_slice__16);
42885 15 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_slice__16)) __PYX_ERR(0, 1169, __pyx_L1_error);
42886 15 : __pyx_t_3 = 0;
42887 15 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error)
42888 15 : __Pyx_GOTREF(__pyx_t_3);
42889 15 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42890 15 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
42891 15 : __Pyx_GOTREF(__pyx_t_2);
42892 15 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42893 15 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error)
42894 15 : __Pyx_GOTREF(__pyx_t_3);
42895 15 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_complex128); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error)
42896 15 : __Pyx_GOTREF(__pyx_t_1);
42897 15 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42898 15 : __pyx_t_3 = NULL;
42899 15 : __pyx_t_6 = 0;
42900 : #if CYTHON_UNPACK_METHODS
42901 15 : if (likely(PyMethod_Check(__pyx_t_2))) {
42902 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
42903 0 : if (likely(__pyx_t_3)) {
42904 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
42905 0 : __Pyx_INCREF(__pyx_t_3);
42906 0 : __Pyx_INCREF(function);
42907 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
42908 : __pyx_t_6 = 1;
42909 : }
42910 : }
42911 : #endif
42912 : {
42913 15 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
42914 15 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
42915 15 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
42916 15 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42917 15 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error)
42918 15 : __Pyx_GOTREF(__pyx_t_4);
42919 15 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42920 : }
42921 15 : __pyx_t_2 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_rta), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error)
42922 15 : __Pyx_GOTREF(__pyx_t_2);
42923 15 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
42924 15 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1169, __pyx_L1_error)
42925 15 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_2);
42926 : {
42927 15 : __Pyx_BufFmt_StackElem __pyx_stack[1];
42928 15 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
42929 15 : __pyx_t_18 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
42930 15 : if (unlikely(__pyx_t_18 < 0)) {
42931 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
42932 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
42933 0 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
42934 0 : __Pyx_RaiseBufferFallbackError();
42935 : } else {
42936 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
42937 : }
42938 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
42939 : }
42940 15 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
42941 15 : if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1169, __pyx_L1_error)
42942 : }
42943 15 : __pyx_t_13 = 0;
42944 15 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_2));
42945 15 : __pyx_t_2 = 0;
42946 :
42947 : /* "scipy/linalg/_decomp_interpolative.pyx":1171
42948 : * rta *= albetas[nstep, :, 2:].view(np.complex128)
42949 : * # Rotate
42950 : * for row in range(m-1): # <<<<<<<<<<<<<<
42951 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
42952 : * giv2x2[0, 0] = alpha
42953 : */
42954 15 : __pyx_t_19 = (__pyx_v_m - 1);
42955 15 : __pyx_t_20 = __pyx_t_19;
42956 2727 : for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_20; __pyx_t_18+=1) {
42957 2712 : __pyx_v_row = __pyx_t_18;
42958 :
42959 : /* "scipy/linalg/_decomp_interpolative.pyx":1172
42960 : * # Rotate
42961 : * for row in range(m-1):
42962 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1] # <<<<<<<<<<<<<<
42963 : * giv2x2[0, 0] = alpha
42964 : * giv2x2[0, 1] = beta
42965 : */
42966 2712 : __pyx_t_21 = __pyx_v_nstep;
42967 2712 : __pyx_t_22 = __pyx_v_row;
42968 2712 : __pyx_t_23 = 0;
42969 2712 : __pyx_t_24 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_albetas.diminfo[2].strides));
42970 2712 : __pyx_t_23 = __pyx_v_nstep;
42971 2712 : __pyx_t_22 = __pyx_v_row;
42972 2712 : __pyx_t_21 = 1;
42973 2712 : __pyx_t_25 = (*__Pyx_BufPtrCContig3d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_albetas.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_albetas.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_albetas.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_albetas.diminfo[2].strides));
42974 2712 : __pyx_v_alpha = __pyx_t_24;
42975 2712 : __pyx_v_beta = __pyx_t_25;
42976 :
42977 : /* "scipy/linalg/_decomp_interpolative.pyx":1173
42978 : * for row in range(m-1):
42979 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
42980 : * giv2x2[0, 0] = alpha # <<<<<<<<<<<<<<
42981 : * giv2x2[0, 1] = beta
42982 : * giv2x2[1, 0] = -beta
42983 : */
42984 2712 : __pyx_t_21 = 0;
42985 2712 : __pyx_t_22 = 0;
42986 2712 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
42987 :
42988 : /* "scipy/linalg/_decomp_interpolative.pyx":1174
42989 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
42990 : * giv2x2[0, 0] = alpha
42991 : * giv2x2[0, 1] = beta # <<<<<<<<<<<<<<
42992 : * giv2x2[1, 0] = -beta
42993 : * giv2x2[1, 1] = alpha
42994 : */
42995 2712 : __pyx_t_22 = 0;
42996 2712 : __pyx_t_21 = 1;
42997 2712 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_beta;
42998 :
42999 : /* "scipy/linalg/_decomp_interpolative.pyx":1175
43000 : * giv2x2[0, 0] = alpha
43001 : * giv2x2[0, 1] = beta
43002 : * giv2x2[1, 0] = -beta # <<<<<<<<<<<<<<
43003 : * giv2x2[1, 1] = alpha
43004 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
43005 : */
43006 2712 : __pyx_t_21 = 1;
43007 2712 : __pyx_t_22 = 0;
43008 2712 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = (-__pyx_v_beta);
43009 :
43010 : /* "scipy/linalg/_decomp_interpolative.pyx":1176
43011 : * giv2x2[0, 1] = beta
43012 : * giv2x2[1, 0] = -beta
43013 : * giv2x2[1, 1] = alpha # <<<<<<<<<<<<<<
43014 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
43015 : *
43016 : */
43017 2712 : __pyx_t_22 = 1;
43018 2712 : __pyx_t_21 = 1;
43019 2712 : *__Pyx_BufPtrCContig2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_v_alpha;
43020 :
43021 : /* "scipy/linalg/_decomp_interpolative.pyx":1177
43022 : * giv2x2[1, 0] = -beta
43023 : * giv2x2[1, 1] = alpha
43024 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :]) # <<<<<<<<<<<<<<
43025 : *
43026 : * rta = rta[rng.permutation(m), :]
43027 : */
43028 2712 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
43029 2712 : __Pyx_GOTREF(__pyx_t_2);
43030 2712 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_matmul); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L1_error)
43031 2712 : __Pyx_GOTREF(__pyx_t_4);
43032 2712 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43033 2712 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
43034 2712 : __Pyx_GOTREF(__pyx_t_2);
43035 2712 : __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
43036 2712 : __Pyx_GOTREF(__pyx_t_1);
43037 2712 : __pyx_t_3 = PySlice_New(__pyx_t_2, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
43038 2712 : __Pyx_GOTREF(__pyx_t_3);
43039 2712 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43040 2712 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43041 2712 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
43042 2712 : __Pyx_GOTREF(__pyx_t_1);
43043 2712 : __Pyx_GIVEREF(__pyx_t_3);
43044 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error);
43045 2712 : __Pyx_INCREF(__pyx_slice__5);
43046 2712 : __Pyx_GIVEREF(__pyx_slice__5);
43047 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__5)) __PYX_ERR(0, 1177, __pyx_L1_error);
43048 2712 : __pyx_t_3 = 0;
43049 2712 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
43050 2712 : __Pyx_GOTREF(__pyx_t_3);
43051 2712 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43052 2712 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
43053 2712 : __Pyx_GOTREF(__pyx_t_1);
43054 2712 : __Pyx_INCREF((PyObject *)__pyx_v_giv2x2);
43055 2712 : __Pyx_GIVEREF((PyObject *)__pyx_v_giv2x2);
43056 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_giv2x2))) __PYX_ERR(0, 1177, __pyx_L1_error);
43057 2712 : __Pyx_GIVEREF(__pyx_t_3);
43058 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error);
43059 2712 : __pyx_t_3 = 0;
43060 2712 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
43061 2712 : __Pyx_GOTREF(__pyx_t_3);
43062 2712 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_row); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
43063 2712 : __Pyx_GOTREF(__pyx_t_2);
43064 2712 : __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_row + 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L1_error)
43065 2712 : __Pyx_GOTREF(__pyx_t_5);
43066 2712 : __pyx_t_26 = PySlice_New(__pyx_t_2, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1177, __pyx_L1_error)
43067 2712 : __Pyx_GOTREF(__pyx_t_26);
43068 2712 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43069 2712 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43070 2712 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L1_error)
43071 2712 : __Pyx_GOTREF(__pyx_t_5);
43072 2712 : __Pyx_GIVEREF(__pyx_t_26);
43073 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_26)) __PYX_ERR(0, 1177, __pyx_L1_error);
43074 2712 : __Pyx_INCREF(__pyx_slice__5);
43075 2712 : __Pyx_GIVEREF(__pyx_slice__5);
43076 2712 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__5)) __PYX_ERR(0, 1177, __pyx_L1_error);
43077 2712 : __pyx_t_26 = 0;
43078 2712 : __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_5); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1177, __pyx_L1_error)
43079 2712 : __Pyx_GOTREF(__pyx_t_26);
43080 2712 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43081 2712 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out, __pyx_t_26) < 0) __PYX_ERR(0, 1177, __pyx_L1_error)
43082 2712 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43083 2712 : __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1177, __pyx_L1_error)
43084 2712 : __Pyx_GOTREF(__pyx_t_26);
43085 2712 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43086 2712 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43087 2712 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43088 5424 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43089 : }
43090 :
43091 : /* "scipy/linalg/_decomp_interpolative.pyx":1179
43092 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
43093 : *
43094 : * rta = rta[rng.permutation(m), :] # <<<<<<<<<<<<<<
43095 : *
43096 : * # idd_subselect pick randomly n2-many rows
43097 : */
43098 15 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
43099 15 : __Pyx_GOTREF(__pyx_t_3);
43100 15 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
43101 15 : __Pyx_GOTREF(__pyx_t_1);
43102 15 : __pyx_t_4 = NULL;
43103 15 : __pyx_t_6 = 0;
43104 : #if CYTHON_UNPACK_METHODS
43105 15 : if (likely(PyMethod_Check(__pyx_t_3))) {
43106 15 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
43107 15 : if (likely(__pyx_t_4)) {
43108 15 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
43109 15 : __Pyx_INCREF(__pyx_t_4);
43110 15 : __Pyx_INCREF(function);
43111 15 : __Pyx_DECREF_SET(__pyx_t_3, function);
43112 : __pyx_t_6 = 1;
43113 : }
43114 : }
43115 : #endif
43116 : {
43117 15 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
43118 15 : __pyx_t_26 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
43119 15 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
43120 15 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43121 15 : if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1179, __pyx_L1_error)
43122 15 : __Pyx_GOTREF(__pyx_t_26);
43123 15 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43124 : }
43125 15 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
43126 15 : __Pyx_GOTREF(__pyx_t_3);
43127 15 : __Pyx_GIVEREF(__pyx_t_26);
43128 15 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_26)) __PYX_ERR(0, 1179, __pyx_L1_error);
43129 15 : __Pyx_INCREF(__pyx_slice__5);
43130 15 : __Pyx_GIVEREF(__pyx_slice__5);
43131 15 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 1179, __pyx_L1_error);
43132 15 : __pyx_t_26 = 0;
43133 15 : __pyx_t_26 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1179, __pyx_L1_error)
43134 15 : __Pyx_GOTREF(__pyx_t_26);
43135 15 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43136 15 : if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1179, __pyx_L1_error)
43137 15 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_26);
43138 : {
43139 15 : __Pyx_BufFmt_StackElem __pyx_stack[1];
43140 15 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
43141 15 : __pyx_t_18 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
43142 15 : if (unlikely(__pyx_t_18 < 0)) {
43143 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
43144 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
43145 0 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
43146 0 : __Pyx_RaiseBufferFallbackError();
43147 : } else {
43148 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
43149 : }
43150 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
43151 : }
43152 15 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
43153 15 : if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1179, __pyx_L1_error)
43154 : }
43155 15 : __pyx_t_13 = 0;
43156 15 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_26));
43157 15 : __pyx_t_26 = 0;
43158 : }
43159 :
43160 : /* "scipy/linalg/_decomp_interpolative.pyx":1182
43161 : *
43162 : * # idd_subselect pick randomly n2-many rows
43163 : * subselect = rng.choice(m, n2, replace=False) # <<<<<<<<<<<<<<
43164 : * rta = rta[subselect, :]
43165 : * # Perform rfft on each column.
43166 : */
43167 5 : __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1182, __pyx_L1_error)
43168 5 : __Pyx_GOTREF(__pyx_t_26);
43169 5 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error)
43170 5 : __Pyx_GOTREF(__pyx_t_3);
43171 5 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
43172 5 : __Pyx_GOTREF(__pyx_t_1);
43173 5 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
43174 5 : __Pyx_GOTREF(__pyx_t_4);
43175 5 : __Pyx_GIVEREF(__pyx_t_3);
43176 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error);
43177 5 : __Pyx_GIVEREF(__pyx_t_1);
43178 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error);
43179 5 : __pyx_t_3 = 0;
43180 5 : __pyx_t_1 = 0;
43181 5 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error)
43182 5 : __Pyx_GOTREF(__pyx_t_1);
43183 5 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 1182, __pyx_L1_error)
43184 5 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_26, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error)
43185 5 : __Pyx_GOTREF(__pyx_t_3);
43186 5 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43187 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43188 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43189 5 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1182, __pyx_L1_error)
43190 5 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_3);
43191 : {
43192 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
43193 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
43194 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
43195 5 : if (unlikely(__pyx_t_8 < 0)) {
43196 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
43197 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_v_subselect, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
43198 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
43199 : __Pyx_RaiseBufferFallbackError();
43200 : } else {
43201 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
43202 : }
43203 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
43204 : }
43205 5 : __pyx_pybuffernd_subselect.diminfo[0].strides = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_subselect.diminfo[0].shape = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.shape[0];
43206 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error)
43207 : }
43208 5 : __pyx_t_27 = 0;
43209 5 : __pyx_v_subselect = ((PyArrayObject *)__pyx_t_3);
43210 5 : __pyx_t_3 = 0;
43211 :
43212 : /* "scipy/linalg/_decomp_interpolative.pyx":1183
43213 : * # idd_subselect pick randomly n2-many rows
43214 : * subselect = rng.choice(m, n2, replace=False)
43215 : * rta = rta[subselect, :] # <<<<<<<<<<<<<<
43216 : * # Perform rfft on each column.
43217 : * F = fft(rta, axis=0)[rng.permutation(n2), :]
43218 : */
43219 5 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L1_error)
43220 5 : __Pyx_GOTREF(__pyx_t_3);
43221 5 : __Pyx_INCREF((PyObject *)__pyx_v_subselect);
43222 5 : __Pyx_GIVEREF((PyObject *)__pyx_v_subselect);
43223 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_subselect))) __PYX_ERR(0, 1183, __pyx_L1_error);
43224 5 : __Pyx_INCREF(__pyx_slice__5);
43225 5 : __Pyx_GIVEREF(__pyx_slice__5);
43226 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 1183, __pyx_L1_error);
43227 5 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
43228 5 : __Pyx_GOTREF(__pyx_t_1);
43229 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43230 5 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1183, __pyx_L1_error)
43231 5 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
43232 : {
43233 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
43234 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
43235 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
43236 5 : if (unlikely(__pyx_t_8 < 0)) {
43237 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
43238 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
43239 0 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
43240 0 : __Pyx_RaiseBufferFallbackError();
43241 : } else {
43242 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
43243 : }
43244 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
43245 : }
43246 5 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
43247 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1183, __pyx_L1_error)
43248 : }
43249 5 : __pyx_t_13 = 0;
43250 5 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_1));
43251 5 : __pyx_t_1 = 0;
43252 :
43253 : /* "scipy/linalg/_decomp_interpolative.pyx":1185
43254 : * rta = rta[subselect, :]
43255 : * # Perform rfft on each column.
43256 : * F = fft(rta, axis=0)[rng.permutation(n2), :] # <<<<<<<<<<<<<<
43257 : *
43258 : * Fcopy = F.copy()
43259 : */
43260 5 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_fft); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
43261 5 : __Pyx_GOTREF(__pyx_t_1);
43262 5 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
43263 5 : __Pyx_GOTREF(__pyx_t_3);
43264 5 : __Pyx_INCREF((PyObject *)__pyx_v_rta);
43265 5 : __Pyx_GIVEREF((PyObject *)__pyx_v_rta);
43266 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rta))) __PYX_ERR(0, 1185, __pyx_L1_error);
43267 5 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
43268 5 : __Pyx_GOTREF(__pyx_t_4);
43269 5 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
43270 5 : __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1185, __pyx_L1_error)
43271 5 : __Pyx_GOTREF(__pyx_t_26);
43272 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43273 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43274 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43275 5 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
43276 5 : __Pyx_GOTREF(__pyx_t_3);
43277 5 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
43278 5 : __Pyx_GOTREF(__pyx_t_1);
43279 5 : __pyx_t_5 = NULL;
43280 5 : __pyx_t_6 = 0;
43281 : #if CYTHON_UNPACK_METHODS
43282 5 : if (likely(PyMethod_Check(__pyx_t_3))) {
43283 5 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
43284 5 : if (likely(__pyx_t_5)) {
43285 5 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
43286 5 : __Pyx_INCREF(__pyx_t_5);
43287 5 : __Pyx_INCREF(function);
43288 5 : __Pyx_DECREF_SET(__pyx_t_3, function);
43289 : __pyx_t_6 = 1;
43290 : }
43291 : }
43292 : #endif
43293 : {
43294 5 : PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
43295 5 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
43296 5 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
43297 5 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43298 5 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
43299 5 : __Pyx_GOTREF(__pyx_t_4);
43300 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43301 : }
43302 5 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
43303 5 : __Pyx_GOTREF(__pyx_t_3);
43304 5 : __Pyx_GIVEREF(__pyx_t_4);
43305 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error);
43306 5 : __Pyx_INCREF(__pyx_slice__5);
43307 5 : __Pyx_GIVEREF(__pyx_slice__5);
43308 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 1185, __pyx_L1_error);
43309 5 : __pyx_t_4 = 0;
43310 5 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_26, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
43311 5 : __Pyx_GOTREF(__pyx_t_4);
43312 5 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43313 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43314 5 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1185, __pyx_L1_error)
43315 5 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_4);
43316 : {
43317 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
43318 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
43319 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
43320 5 : if (unlikely(__pyx_t_8 < 0)) {
43321 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
43322 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_F.rcbuffer->pybuffer, (PyObject*)__pyx_v_F, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
43323 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
43324 : __Pyx_RaiseBufferFallbackError();
43325 : } else {
43326 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
43327 : }
43328 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
43329 : }
43330 5 : __pyx_pybuffernd_F.diminfo[0].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_F.diminfo[0].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_F.diminfo[1].strides = __pyx_pybuffernd_F.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_F.diminfo[1].shape = __pyx_pybuffernd_F.rcbuffer->pybuffer.shape[1];
43331 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1185, __pyx_L1_error)
43332 : }
43333 5 : __pyx_t_28 = 0;
43334 5 : __pyx_v_F = ((PyArrayObject *)__pyx_t_4);
43335 5 : __pyx_t_4 = 0;
43336 :
43337 : /* "scipy/linalg/_decomp_interpolative.pyx":1187
43338 : * F = fft(rta, axis=0)[rng.permutation(n2), :]
43339 : *
43340 : * Fcopy = F.copy() # <<<<<<<<<<<<<<
43341 : * cols = F.shape[1]
43342 : * row = F.shape[0]
43343 : */
43344 5 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_F), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1187, __pyx_L1_error)
43345 5 : __Pyx_GOTREF(__pyx_t_3);
43346 5 : __pyx_t_26 = NULL;
43347 5 : __pyx_t_6 = 0;
43348 : #if CYTHON_UNPACK_METHODS
43349 5 : if (likely(PyMethod_Check(__pyx_t_3))) {
43350 0 : __pyx_t_26 = PyMethod_GET_SELF(__pyx_t_3);
43351 0 : if (likely(__pyx_t_26)) {
43352 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
43353 0 : __Pyx_INCREF(__pyx_t_26);
43354 0 : __Pyx_INCREF(function);
43355 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
43356 : __pyx_t_6 = 1;
43357 : }
43358 : }
43359 : #endif
43360 : {
43361 5 : PyObject *__pyx_callargs[2] = {__pyx_t_26, NULL};
43362 5 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
43363 5 : __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
43364 5 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1187, __pyx_L1_error)
43365 5 : __Pyx_GOTREF(__pyx_t_4);
43366 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43367 : }
43368 5 : __pyx_v_Fcopy = __pyx_t_4;
43369 5 : __pyx_t_4 = 0;
43370 :
43371 : /* "scipy/linalg/_decomp_interpolative.pyx":1188
43372 : *
43373 : * Fcopy = F.copy()
43374 : * cols = F.shape[1] # <<<<<<<<<<<<<<
43375 : * row = F.shape[0]
43376 : * sssmax = 0.
43377 : */
43378 5 : __pyx_v_cols = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_F))[1]);
43379 :
43380 : /* "scipy/linalg/_decomp_interpolative.pyx":1189
43381 : * Fcopy = F.copy()
43382 : * cols = F.shape[1]
43383 : * row = F.shape[0] # <<<<<<<<<<<<<<
43384 : * sssmax = 0.
43385 : *
43386 : */
43387 5 : __pyx_v_row = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_F))[0]);
43388 :
43389 : /* "scipy/linalg/_decomp_interpolative.pyx":1190
43390 : * cols = F.shape[1]
43391 : * row = F.shape[0]
43392 : * sssmax = 0. # <<<<<<<<<<<<<<
43393 : *
43394 : * for r in range(cols):
43395 : */
43396 5 : __Pyx_INCREF(__pyx_float_0_);
43397 : __pyx_v_sssmax = __pyx_float_0_;
43398 :
43399 : /* "scipy/linalg/_decomp_interpolative.pyx":1192
43400 : * sssmax = 0.
43401 : *
43402 : * for r in range(cols): # <<<<<<<<<<<<<<
43403 : * h = dznrm2(&row, &F[0, r], &cols)
43404 : * if h > sssmax:
43405 : */
43406 913 : __pyx_t_8 = __pyx_v_cols;
43407 913 : __pyx_t_16 = __pyx_t_8;
43408 913 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
43409 908 : __pyx_v_r = __pyx_t_17;
43410 :
43411 : /* "scipy/linalg/_decomp_interpolative.pyx":1193
43412 : *
43413 : * for r in range(cols):
43414 : * h = dznrm2(&row, &F[0, r], &cols) # <<<<<<<<<<<<<<
43415 : * if h > sssmax:
43416 : * sssmax = h
43417 : */
43418 908 : __pyx_t_21 = 0;
43419 908 : __pyx_t_22 = __pyx_v_r;
43420 908 : __pyx_v_h = __pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_row), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_F.diminfo[1].strides))), (&__pyx_v_cols));
43421 :
43422 : /* "scipy/linalg/_decomp_interpolative.pyx":1194
43423 : * for r in range(cols):
43424 : * h = dznrm2(&row, &F[0, r], &cols)
43425 : * if h > sssmax: # <<<<<<<<<<<<<<
43426 : * sssmax = h
43427 : *
43428 : */
43429 908 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
43430 908 : __Pyx_GOTREF(__pyx_t_4);
43431 908 : __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_sssmax, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1194, __pyx_L1_error)
43432 908 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43433 908 : __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_29 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error)
43434 908 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43435 908 : if (__pyx_t_29) {
43436 :
43437 : /* "scipy/linalg/_decomp_interpolative.pyx":1195
43438 : * h = dznrm2(&row, &F[0, r], &cols)
43439 : * if h > sssmax:
43440 : * sssmax = h # <<<<<<<<<<<<<<
43441 : *
43442 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_COMPLEX128, 0)
43443 : */
43444 6 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error)
43445 6 : __Pyx_GOTREF(__pyx_t_3);
43446 914 : __Pyx_DECREF_SET(__pyx_v_sssmax, __pyx_t_3);
43447 : __pyx_t_3 = 0;
43448 :
43449 : /* "scipy/linalg/_decomp_interpolative.pyx":1194
43450 : * for r in range(cols):
43451 : * h = dznrm2(&row, &F[0, r], &cols)
43452 : * if h > sssmax: # <<<<<<<<<<<<<<
43453 : * sssmax = h
43454 : *
43455 : */
43456 : }
43457 : }
43458 :
43459 : /* "scipy/linalg/_decomp_interpolative.pyx":1197
43460 : * sssmax = h
43461 : *
43462 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
43463 : * k, nulls = 0, 0
43464 : * ff = F
43465 : */
43466 5 : __pyx_t_30[0] = __pyx_v_cols;
43467 5 : __pyx_t_3 = PyArray_ZEROS(1, __pyx_t_30, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __pyx_L1_error)
43468 5 : __Pyx_GOTREF(__pyx_t_3);
43469 5 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1197, __pyx_L1_error)
43470 5 : __pyx_t_31 = ((PyArrayObject *)__pyx_t_3);
43471 : {
43472 5 : __Pyx_BufFmt_StackElem __pyx_stack[1];
43473 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
43474 5 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
43475 5 : if (unlikely(__pyx_t_8 < 0)) {
43476 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
43477 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau_arr, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
43478 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
43479 : __Pyx_RaiseBufferFallbackError();
43480 : } else {
43481 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
43482 : }
43483 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
43484 : }
43485 5 : __pyx_pybuffernd_tau_arr.diminfo[0].strides = __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau_arr.diminfo[0].shape = __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.shape[0];
43486 5 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1197, __pyx_L1_error)
43487 : }
43488 5 : __pyx_t_31 = 0;
43489 5 : __pyx_v_tau_arr = ((PyArrayObject *)__pyx_t_3);
43490 5 : __pyx_t_3 = 0;
43491 :
43492 : /* "scipy/linalg/_decomp_interpolative.pyx":1198
43493 : *
43494 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_COMPLEX128, 0)
43495 : * k, nulls = 0, 0 # <<<<<<<<<<<<<<
43496 : * ff = F
43497 : * # Loop until nulls = 7, or krank+nulls = n2, or krank+nulls = n.
43498 : */
43499 5 : __pyx_t_8 = 0;
43500 5 : __pyx_t_3 = __pyx_int_0;
43501 5 : __Pyx_INCREF(__pyx_t_3);
43502 5 : __pyx_v_k = __pyx_t_8;
43503 5 : __pyx_v_nulls = __pyx_t_3;
43504 5 : __pyx_t_3 = 0;
43505 :
43506 : /* "scipy/linalg/_decomp_interpolative.pyx":1199
43507 : * tau_arr = cnp.PyArray_ZEROS(1, [cols], cnp.NPY_COMPLEX128, 0)
43508 : * k, nulls = 0, 0
43509 : * ff = F # <<<<<<<<<<<<<<
43510 : * # Loop until nulls = 7, or krank+nulls = n2, or krank+nulls = n.
43511 : * while (nulls < 7) and (k+nulls < min(n, n2)):
43512 : */
43513 5 : __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(((PyObject *)__pyx_v_F), PyBUF_WRITABLE); if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 1199, __pyx_L1_error)
43514 5 : __pyx_v_ff = __pyx_t_32;
43515 5 : __pyx_t_32.memview = NULL;
43516 5 : __pyx_t_32.data = NULL;
43517 :
43518 : /* "scipy/linalg/_decomp_interpolative.pyx":1201
43519 : * ff = F
43520 : * # Loop until nulls = 7, or krank+nulls = n2, or krank+nulls = n.
43521 : * while (nulls < 7) and (k+nulls < min(n, n2)): # <<<<<<<<<<<<<<
43522 : * # Apply previous Householder reflectors
43523 : * if k > 0:
43524 : */
43525 163 : while (1) {
43526 84 : __pyx_t_3 = PyObject_RichCompare(__pyx_v_nulls, __pyx_int_7, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
43527 84 : __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_33 < 0))) __PYX_ERR(0, 1201, __pyx_L1_error)
43528 84 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43529 84 : if (__pyx_t_33) {
43530 81 : } else {
43531 3 : __pyx_t_29 = __pyx_t_33;
43532 3 : goto __pyx_L12_bool_binop_done;
43533 : }
43534 81 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
43535 81 : __Pyx_GOTREF(__pyx_t_3);
43536 81 : __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_nulls); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error)
43537 81 : __Pyx_GOTREF(__pyx_t_4);
43538 81 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43539 81 : __pyx_t_8 = __pyx_v_n2;
43540 81 : __pyx_t_16 = __pyx_v_n;
43541 81 : __pyx_t_33 = (__pyx_t_8 < __pyx_t_16);
43542 81 : if (__pyx_t_33) {
43543 : __pyx_t_17 = __pyx_t_8;
43544 : } else {
43545 : __pyx_t_17 = __pyx_t_16;
43546 : }
43547 81 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
43548 81 : __Pyx_GOTREF(__pyx_t_3);
43549 81 : __pyx_t_26 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1201, __pyx_L1_error)
43550 81 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43551 81 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43552 81 : __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely((__pyx_t_33 < 0))) __PYX_ERR(0, 1201, __pyx_L1_error)
43553 81 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43554 81 : __pyx_t_29 = __pyx_t_33;
43555 84 : __pyx_L12_bool_binop_done:;
43556 84 : if (!__pyx_t_29) break;
43557 :
43558 : /* "scipy/linalg/_decomp_interpolative.pyx":1203
43559 : * while (nulls < 7) and (k+nulls < min(n, n2)):
43560 : * # Apply previous Householder reflectors
43561 : * if k > 0: # <<<<<<<<<<<<<<
43562 : * for kk in range(k):
43563 : * F[k, kk:] -= (
43564 : */
43565 79 : __pyx_t_29 = (__pyx_v_k > 0);
43566 79 : if (__pyx_t_29) {
43567 :
43568 : /* "scipy/linalg/_decomp_interpolative.pyx":1204
43569 : * # Apply previous Householder reflectors
43570 : * if k > 0:
43571 : * for kk in range(k): # <<<<<<<<<<<<<<
43572 : * F[k, kk:] -= (
43573 : * np.conj(tau_arr[kk])*
43574 : */
43575 941 : __pyx_t_17 = __pyx_v_k;
43576 941 : __pyx_t_8 = __pyx_t_17;
43577 941 : for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_8; __pyx_t_16+=1) {
43578 867 : __pyx_v_kk = __pyx_t_16;
43579 :
43580 : /* "scipy/linalg/_decomp_interpolative.pyx":1205
43581 : * if k > 0:
43582 : * for kk in range(k):
43583 : * F[k, kk:] -= ( # <<<<<<<<<<<<<<
43584 : * np.conj(tau_arr[kk])*
43585 : * (F[kk, kk:].conj() @ F[k, kk:])*
43586 : */
43587 867 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1205, __pyx_L1_error)
43588 867 : __Pyx_GOTREF(__pyx_t_26);
43589 867 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error)
43590 867 : __Pyx_GOTREF(__pyx_t_3);
43591 867 : __pyx_t_4 = PySlice_New(__pyx_t_3, Py_None, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error)
43592 867 : __Pyx_GOTREF(__pyx_t_4);
43593 867 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43594 867 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error)
43595 867 : __Pyx_GOTREF(__pyx_t_3);
43596 867 : __Pyx_GIVEREF(__pyx_t_26);
43597 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_26)) __PYX_ERR(0, 1205, __pyx_L1_error);
43598 867 : __Pyx_GIVEREF(__pyx_t_4);
43599 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error);
43600 867 : __pyx_t_26 = 0;
43601 867 : __pyx_t_4 = 0;
43602 867 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error)
43603 867 : __Pyx_GOTREF(__pyx_t_4);
43604 :
43605 : /* "scipy/linalg/_decomp_interpolative.pyx":1206
43606 : * for kk in range(k):
43607 : * F[k, kk:] -= (
43608 : * np.conj(tau_arr[kk])* # <<<<<<<<<<<<<<
43609 : * (F[kk, kk:].conj() @ F[k, kk:])*
43610 : * F[kk, kk:]
43611 : */
43612 867 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
43613 867 : __Pyx_GOTREF(__pyx_t_1);
43614 867 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_conj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1206, __pyx_L1_error)
43615 867 : __Pyx_GOTREF(__pyx_t_5);
43616 867 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43617 867 : __pyx_t_22 = __pyx_v_kk;
43618 867 : __pyx_t_34 = (*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_tau_arr.diminfo[0].strides));
43619 867 : __pyx_t_1 = __pyx_PyComplex_FromComplex(__pyx_t_34); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
43620 867 : __Pyx_GOTREF(__pyx_t_1);
43621 867 : __pyx_t_2 = NULL;
43622 867 : __pyx_t_6 = 0;
43623 : #if CYTHON_UNPACK_METHODS
43624 867 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
43625 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
43626 0 : if (likely(__pyx_t_2)) {
43627 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
43628 0 : __Pyx_INCREF(__pyx_t_2);
43629 0 : __Pyx_INCREF(function);
43630 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
43631 : __pyx_t_6 = 1;
43632 : }
43633 : }
43634 : #endif
43635 : {
43636 867 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
43637 867 : __pyx_t_26 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
43638 867 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
43639 867 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43640 867 : if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1206, __pyx_L1_error)
43641 867 : __Pyx_GOTREF(__pyx_t_26);
43642 867 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43643 : }
43644 :
43645 : /* "scipy/linalg/_decomp_interpolative.pyx":1207
43646 : * F[k, kk:] -= (
43647 : * np.conj(tau_arr[kk])*
43648 : * (F[kk, kk:].conj() @ F[k, kk:])* # <<<<<<<<<<<<<<
43649 : * F[kk, kk:]
43650 : * )
43651 : */
43652 867 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
43653 867 : __Pyx_GOTREF(__pyx_t_1);
43654 867 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
43655 867 : __Pyx_GOTREF(__pyx_t_2);
43656 867 : __pyx_t_35 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error)
43657 867 : __Pyx_GOTREF(__pyx_t_35);
43658 867 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43659 867 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
43660 867 : __Pyx_GOTREF(__pyx_t_2);
43661 867 : __Pyx_GIVEREF(__pyx_t_1);
43662 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error);
43663 867 : __Pyx_GIVEREF(__pyx_t_35);
43664 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error);
43665 867 : __pyx_t_1 = 0;
43666 867 : __pyx_t_35 = 0;
43667 867 : __pyx_t_35 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_2); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error)
43668 867 : __Pyx_GOTREF(__pyx_t_35);
43669 867 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43670 867 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_35, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
43671 867 : __Pyx_GOTREF(__pyx_t_2);
43672 867 : __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
43673 867 : __pyx_t_35 = NULL;
43674 867 : __pyx_t_6 = 0;
43675 : #if CYTHON_UNPACK_METHODS
43676 867 : if (likely(PyMethod_Check(__pyx_t_2))) {
43677 0 : __pyx_t_35 = PyMethod_GET_SELF(__pyx_t_2);
43678 0 : if (likely(__pyx_t_35)) {
43679 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
43680 0 : __Pyx_INCREF(__pyx_t_35);
43681 0 : __Pyx_INCREF(function);
43682 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
43683 : __pyx_t_6 = 1;
43684 : }
43685 : }
43686 : #endif
43687 : {
43688 867 : PyObject *__pyx_callargs[2] = {__pyx_t_35, NULL};
43689 867 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
43690 867 : __Pyx_XDECREF(__pyx_t_35); __pyx_t_35 = 0;
43691 867 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1207, __pyx_L1_error)
43692 867 : __Pyx_GOTREF(__pyx_t_5);
43693 867 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43694 : }
43695 867 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error)
43696 867 : __Pyx_GOTREF(__pyx_t_2);
43697 867 : __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error)
43698 867 : __Pyx_GOTREF(__pyx_t_35);
43699 867 : __pyx_t_1 = PySlice_New(__pyx_t_35, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
43700 867 : __Pyx_GOTREF(__pyx_t_1);
43701 867 : __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
43702 867 : __pyx_t_35 = PyTuple_New(2); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error)
43703 867 : __Pyx_GOTREF(__pyx_t_35);
43704 867 : __Pyx_GIVEREF(__pyx_t_2);
43705 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_2)) __PYX_ERR(0, 1207, __pyx_L1_error);
43706 867 : __Pyx_GIVEREF(__pyx_t_1);
43707 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_35, 1, __pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error);
43708 867 : __pyx_t_2 = 0;
43709 867 : __pyx_t_1 = 0;
43710 867 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_35); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error)
43711 867 : __Pyx_GOTREF(__pyx_t_1);
43712 867 : __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
43713 867 : __pyx_t_35 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1207, __pyx_L1_error)
43714 867 : __Pyx_GOTREF(__pyx_t_35);
43715 867 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43716 867 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43717 :
43718 : /* "scipy/linalg/_decomp_interpolative.pyx":1206
43719 : * for kk in range(k):
43720 : * F[k, kk:] -= (
43721 : * np.conj(tau_arr[kk])* # <<<<<<<<<<<<<<
43722 : * (F[kk, kk:].conj() @ F[k, kk:])*
43723 : * F[kk, kk:]
43724 : */
43725 867 : __pyx_t_1 = PyNumber_Multiply(__pyx_t_26, __pyx_t_35); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
43726 867 : __Pyx_GOTREF(__pyx_t_1);
43727 867 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43728 867 : __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
43729 :
43730 : /* "scipy/linalg/_decomp_interpolative.pyx":1208
43731 : * np.conj(tau_arr[kk])*
43732 : * (F[kk, kk:].conj() @ F[k, kk:])*
43733 : * F[kk, kk:] # <<<<<<<<<<<<<<
43734 : * )
43735 : *
43736 : */
43737 867 : __pyx_t_35 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 1208, __pyx_L1_error)
43738 867 : __Pyx_GOTREF(__pyx_t_35);
43739 867 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_kk); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1208, __pyx_L1_error)
43740 867 : __Pyx_GOTREF(__pyx_t_26);
43741 867 : __pyx_t_5 = PySlice_New(__pyx_t_26, Py_None, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error)
43742 867 : __Pyx_GOTREF(__pyx_t_5);
43743 867 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43744 867 : __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1208, __pyx_L1_error)
43745 867 : __Pyx_GOTREF(__pyx_t_26);
43746 867 : __Pyx_GIVEREF(__pyx_t_35);
43747 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_35)) __PYX_ERR(0, 1208, __pyx_L1_error);
43748 867 : __Pyx_GIVEREF(__pyx_t_5);
43749 867 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error);
43750 867 : __pyx_t_35 = 0;
43751 867 : __pyx_t_5 = 0;
43752 867 : __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_F), __pyx_t_26); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error)
43753 867 : __Pyx_GOTREF(__pyx_t_5);
43754 867 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43755 :
43756 : /* "scipy/linalg/_decomp_interpolative.pyx":1207
43757 : * F[k, kk:] -= (
43758 : * np.conj(tau_arr[kk])*
43759 : * (F[kk, kk:].conj() @ F[k, kk:])* # <<<<<<<<<<<<<<
43760 : * F[kk, kk:]
43761 : * )
43762 : */
43763 867 : __pyx_t_26 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1207, __pyx_L1_error)
43764 867 : __Pyx_GOTREF(__pyx_t_26);
43765 867 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43766 867 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43767 :
43768 : /* "scipy/linalg/_decomp_interpolative.pyx":1205
43769 : * if k > 0:
43770 : * for kk in range(k):
43771 : * F[k, kk:] -= ( # <<<<<<<<<<<<<<
43772 : * np.conj(tau_arr[kk])*
43773 : * (F[kk, kk:].conj() @ F[k, kk:])*
43774 : */
43775 867 : __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_26); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
43776 867 : __Pyx_GOTREF(__pyx_t_5);
43777 867 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
43778 867 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43779 867 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_F), __pyx_t_3, __pyx_t_5) < 0))) __PYX_ERR(0, 1205, __pyx_L1_error)
43780 867 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43781 1734 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43782 : }
43783 :
43784 : /* "scipy/linalg/_decomp_interpolative.pyx":1203
43785 : * while (nulls < 7) and (k+nulls < min(n, n2)):
43786 : * # Apply previous Householder reflectors
43787 : * if k > 0: # <<<<<<<<<<<<<<
43788 : * for kk in range(k):
43789 : * F[k, kk:] -= (
43790 : */
43791 : }
43792 :
43793 : /* "scipy/linalg/_decomp_interpolative.pyx":1212
43794 : *
43795 : * # Get the next Householder reflector and store in F
43796 : * r = cols-k # <<<<<<<<<<<<<<
43797 : * row = 1
43798 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k])
43799 : */
43800 79 : __pyx_v_r = (__pyx_v_cols - __pyx_v_k);
43801 :
43802 : /* "scipy/linalg/_decomp_interpolative.pyx":1213
43803 : * # Get the next Householder reflector and store in F
43804 : * r = cols-k
43805 : * row = 1 # <<<<<<<<<<<<<<
43806 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k])
43807 : * if (np.abs(F[k, k]) <= eps*sssmax):
43808 : */
43809 79 : __pyx_v_row = 1;
43810 :
43811 : /* "scipy/linalg/_decomp_interpolative.pyx":1214
43812 : * r = cols-k
43813 : * row = 1
43814 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k]) # <<<<<<<<<<<<<<
43815 : * if (np.abs(F[k, k]) <= eps*sssmax):
43816 : * nulls += 1
43817 : */
43818 79 : __pyx_t_22 = __pyx_v_k;
43819 79 : __pyx_t_21 = __pyx_v_k;
43820 79 : __pyx_t_23 = __pyx_v_k;
43821 79 : __pyx_t_36 = (__pyx_v_k + 1);
43822 79 : __pyx_t_37 = __pyx_v_k;
43823 79 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp((&__pyx_v_r), (&(*((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ff.data + __pyx_t_22 * __pyx_v_ff.strides[0]) )) + __pyx_t_21)) )))), (&(*((__pyx_t_double_complex *) ( /* dim=1 */ ((char *) (((__pyx_t_double_complex *) ( /* dim=0 */ (__pyx_v_ff.data + __pyx_t_23 * __pyx_v_ff.strides[0]) )) + __pyx_t_36)) )))), (&__pyx_v_row), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau_arr.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_tau_arr.diminfo[0].strides))));
43824 :
43825 : /* "scipy/linalg/_decomp_interpolative.pyx":1215
43826 : * row = 1
43827 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k])
43828 : * if (np.abs(F[k, k]) <= eps*sssmax): # <<<<<<<<<<<<<<
43829 : * nulls += 1
43830 : * F[k, k] = 1
43831 : */
43832 79 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1215, __pyx_L1_error)
43833 79 : __Pyx_GOTREF(__pyx_t_5);
43834 79 : __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_abs); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1215, __pyx_L1_error)
43835 79 : __Pyx_GOTREF(__pyx_t_26);
43836 79 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43837 79 : __pyx_t_37 = __pyx_v_k;
43838 79 : __pyx_t_36 = __pyx_v_k;
43839 79 : __pyx_t_34 = (*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_F.diminfo[1].strides));
43840 79 : __pyx_t_5 = __pyx_PyComplex_FromComplex(__pyx_t_34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1215, __pyx_L1_error)
43841 79 : __Pyx_GOTREF(__pyx_t_5);
43842 79 : __pyx_t_4 = NULL;
43843 79 : __pyx_t_6 = 0;
43844 : #if CYTHON_UNPACK_METHODS
43845 79 : if (unlikely(PyMethod_Check(__pyx_t_26))) {
43846 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_26);
43847 0 : if (likely(__pyx_t_4)) {
43848 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_26);
43849 0 : __Pyx_INCREF(__pyx_t_4);
43850 0 : __Pyx_INCREF(function);
43851 0 : __Pyx_DECREF_SET(__pyx_t_26, function);
43852 : __pyx_t_6 = 1;
43853 : }
43854 : }
43855 : #endif
43856 : {
43857 79 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
43858 79 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_26, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
43859 79 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
43860 79 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43861 79 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error)
43862 79 : __Pyx_GOTREF(__pyx_t_3);
43863 79 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43864 : }
43865 79 : __pyx_t_26 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1215, __pyx_L1_error)
43866 79 : __Pyx_GOTREF(__pyx_t_26);
43867 79 : __pyx_t_5 = PyNumber_Multiply(__pyx_t_26, __pyx_v_sssmax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1215, __pyx_L1_error)
43868 79 : __Pyx_GOTREF(__pyx_t_5);
43869 79 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43870 79 : __pyx_t_26 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1215, __pyx_L1_error)
43871 79 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
43872 79 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43873 79 : __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely((__pyx_t_29 < 0))) __PYX_ERR(0, 1215, __pyx_L1_error)
43874 79 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43875 79 : if (__pyx_t_29) {
43876 :
43877 : /* "scipy/linalg/_decomp_interpolative.pyx":1216
43878 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k])
43879 : * if (np.abs(F[k, k]) <= eps*sssmax):
43880 : * nulls += 1 # <<<<<<<<<<<<<<
43881 : * F[k, k] = 1
43882 : * k += 1
43883 : */
43884 21 : __pyx_t_26 = __Pyx_PyInt_AddObjC(__pyx_v_nulls, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1216, __pyx_L1_error)
43885 21 : __Pyx_GOTREF(__pyx_t_26);
43886 21 : __Pyx_DECREF_SET(__pyx_v_nulls, __pyx_t_26);
43887 : __pyx_t_26 = 0;
43888 :
43889 : /* "scipy/linalg/_decomp_interpolative.pyx":1215
43890 : * row = 1
43891 : * zlarfgp(&r, &ff[k, k], &ff[k, k+1], &row, &tau_arr[k])
43892 : * if (np.abs(F[k, k]) <= eps*sssmax): # <<<<<<<<<<<<<<
43893 : * nulls += 1
43894 : * F[k, k] = 1
43895 : */
43896 : }
43897 :
43898 : /* "scipy/linalg/_decomp_interpolative.pyx":1217
43899 : * if (np.abs(F[k, k]) <= eps*sssmax):
43900 : * nulls += 1
43901 : * F[k, k] = 1 # <<<<<<<<<<<<<<
43902 : * k += 1
43903 : *
43904 : */
43905 79 : __pyx_t_36 = __pyx_v_k;
43906 79 : __pyx_t_37 = __pyx_v_k;
43907 79 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_F.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_F.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_F.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1, 0);
43908 :
43909 : /* "scipy/linalg/_decomp_interpolative.pyx":1218
43910 : * nulls += 1
43911 : * F[k, k] = 1
43912 : * k += 1 # <<<<<<<<<<<<<<
43913 : *
43914 : * if nulls < 7:
43915 : */
43916 79 : __pyx_v_k = (__pyx_v_k + 1);
43917 : }
43918 :
43919 : /* "scipy/linalg/_decomp_interpolative.pyx":1220
43920 : * k += 1
43921 : *
43922 : * if nulls < 7: # <<<<<<<<<<<<<<
43923 : * k = 0
43924 : *
43925 : */
43926 5 : __pyx_t_26 = PyObject_RichCompare(__pyx_v_nulls, __pyx_int_7, Py_LT); __Pyx_XGOTREF(__pyx_t_26); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1220, __pyx_L1_error)
43927 5 : __pyx_t_29 = __Pyx_PyObject_IsTrue(__pyx_t_26); if (unlikely((__pyx_t_29 < 0))) __PYX_ERR(0, 1220, __pyx_L1_error)
43928 5 : __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43929 5 : if (__pyx_t_29) {
43930 :
43931 : /* "scipy/linalg/_decomp_interpolative.pyx":1221
43932 : *
43933 : * if nulls < 7:
43934 : * k = 0 # <<<<<<<<<<<<<<
43935 : *
43936 : * return k, Fcopy
43937 : */
43938 2 : __pyx_v_k = 0;
43939 :
43940 : /* "scipy/linalg/_decomp_interpolative.pyx":1220
43941 : * k += 1
43942 : *
43943 : * if nulls < 7: # <<<<<<<<<<<<<<
43944 : * k = 0
43945 : *
43946 : */
43947 : }
43948 :
43949 : /* "scipy/linalg/_decomp_interpolative.pyx":1223
43950 : * k = 0
43951 : *
43952 : * return k, Fcopy # <<<<<<<<<<<<<<
43953 : *
43954 : *
43955 : */
43956 5 : __Pyx_XDECREF(__pyx_r);
43957 5 : __pyx_t_26 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1223, __pyx_L1_error)
43958 5 : __Pyx_GOTREF(__pyx_t_26);
43959 5 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error)
43960 5 : __Pyx_GOTREF(__pyx_t_5);
43961 5 : __Pyx_GIVEREF(__pyx_t_26);
43962 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_26)) __PYX_ERR(0, 1223, __pyx_L1_error);
43963 5 : __Pyx_INCREF(__pyx_v_Fcopy);
43964 5 : __Pyx_GIVEREF(__pyx_v_Fcopy);
43965 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_Fcopy)) __PYX_ERR(0, 1223, __pyx_L1_error);
43966 5 : __pyx_t_26 = 0;
43967 5 : __pyx_r = __pyx_t_5;
43968 5 : __pyx_t_5 = 0;
43969 5 : goto __pyx_L0;
43970 :
43971 : /* "scipy/linalg/_decomp_interpolative.pyx":1136
43972 : *
43973 : *
43974 : * def idz_estrank(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
43975 : * rng):
43976 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, cols, k
43977 : */
43978 :
43979 : /* function exit code */
43980 0 : __pyx_L1_error:;
43981 0 : __Pyx_XDECREF(__pyx_t_1);
43982 0 : __Pyx_XDECREF(__pyx_t_2);
43983 0 : __Pyx_XDECREF(__pyx_t_3);
43984 0 : __Pyx_XDECREF(__pyx_t_4);
43985 0 : __Pyx_XDECREF(__pyx_t_5);
43986 0 : __Pyx_XDECREF(__pyx_t_12);
43987 0 : __Pyx_XDECREF(__pyx_t_26);
43988 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_32, 1);
43989 0 : __Pyx_XDECREF(__pyx_t_35);
43990 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
43991 0 : __Pyx_PyThreadState_declare
43992 0 : __Pyx_PyThreadState_assign
43993 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
43994 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
43995 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
43996 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
43997 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
43998 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
43999 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
44000 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
44001 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
44002 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_estrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
44003 0 : __pyx_r = NULL;
44004 0 : goto __pyx_L2;
44005 5 : __pyx_L0:;
44006 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_F.rcbuffer->pybuffer);
44007 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
44008 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
44009 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
44010 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
44011 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
44012 5 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau_arr.rcbuffer->pybuffer);
44013 5 : __pyx_L2:;
44014 5 : __Pyx_XDECREF((PyObject *)__pyx_v_albetas);
44015 5 : __Pyx_XDECREF((PyObject *)__pyx_v_tau_arr);
44016 5 : __Pyx_XDECREF((PyObject *)__pyx_v_subselect);
44017 5 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ff, 1);
44018 5 : __Pyx_XDECREF((PyObject *)__pyx_v_giv2x2);
44019 5 : __Pyx_XDECREF((PyObject *)__pyx_v_rta);
44020 5 : __Pyx_XDECREF((PyObject *)__pyx_v_F);
44021 5 : __Pyx_XDECREF(__pyx_v_Fcopy);
44022 5 : __Pyx_XDECREF(__pyx_v_sssmax);
44023 5 : __Pyx_XDECREF(__pyx_v_nulls);
44024 5 : __Pyx_XGIVEREF(__pyx_r);
44025 5 : __Pyx_RefNannyFinishContext();
44026 5 : return __pyx_r;
44027 : }
44028 :
44029 : /* "scipy/linalg/_decomp_interpolative.pyx":1226
44030 : *
44031 : *
44032 : * def idz_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
44033 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
44034 : *
44035 : */
44036 :
44037 : /* Python wrapper */
44038 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_45idz_findrank(PyObject *__pyx_self,
44039 : #if CYTHON_METH_FASTCALL
44040 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
44041 : #else
44042 : PyObject *__pyx_args, PyObject *__pyx_kwds
44043 : #endif
44044 : ); /*proto*/
44045 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_45idz_findrank = {"idz_findrank", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_45idz_findrank, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
44046 4 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_45idz_findrank(PyObject *__pyx_self,
44047 : #if CYTHON_METH_FASTCALL
44048 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
44049 : #else
44050 : PyObject *__pyx_args, PyObject *__pyx_kwds
44051 : #endif
44052 : ) {
44053 4 : PyObject *__pyx_v_A = 0;
44054 4 : __pyx_t_5numpy_float64_t __pyx_v_eps;
44055 4 : PyObject *__pyx_v_rng = 0;
44056 : #if !CYTHON_METH_FASTCALL
44057 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
44058 : #endif
44059 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
44060 4 : PyObject* values[3] = {0,0,0};
44061 4 : int __pyx_lineno = 0;
44062 4 : const char *__pyx_filename = NULL;
44063 4 : int __pyx_clineno = 0;
44064 4 : PyObject *__pyx_r = 0;
44065 : __Pyx_RefNannyDeclarations
44066 4 : __Pyx_RefNannySetupContext("idz_findrank (wrapper)", 0);
44067 : #if !CYTHON_METH_FASTCALL
44068 : #if CYTHON_ASSUME_SAFE_MACROS
44069 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
44070 : #else
44071 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
44072 : #endif
44073 : #endif
44074 4 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
44075 : {
44076 4 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
44077 4 : if (likely(__pyx_kwds)) {
44078 4 : Py_ssize_t kw_args;
44079 4 : switch (__pyx_nargs) {
44080 4 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
44081 4 : CYTHON_FALLTHROUGH;
44082 4 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
44083 4 : CYTHON_FALLTHROUGH;
44084 4 : case 0: break;
44085 0 : default: goto __pyx_L5_argtuple_error;
44086 : }
44087 4 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
44088 4 : switch (__pyx_nargs) {
44089 : case 0:
44090 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
44091 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
44092 0 : kw_args--;
44093 : }
44094 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L3_error)
44095 0 : else goto __pyx_L5_argtuple_error;
44096 0 : CYTHON_FALLTHROUGH;
44097 : case 1:
44098 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
44099 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
44100 0 : kw_args--;
44101 : }
44102 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L3_error)
44103 : else {
44104 0 : __Pyx_RaiseArgtupleInvalid("idz_findrank", 1, 2, 2, 1); __PYX_ERR(0, 1226, __pyx_L3_error)
44105 : }
44106 4 : CYTHON_FALLTHROUGH;
44107 : case 2:
44108 4 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
44109 4 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
44110 4 : kw_args--;
44111 : }
44112 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L3_error)
44113 : else {
44114 0 : __Pyx_RaiseKeywordRequired("idz_findrank", __pyx_n_s_rng); __PYX_ERR(0, 1226, __pyx_L3_error)
44115 : }
44116 : }
44117 4 : if (unlikely(kw_args > 0)) {
44118 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
44119 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_findrank") < 0)) __PYX_ERR(0, 1226, __pyx_L3_error)
44120 : }
44121 0 : } else if (unlikely(__pyx_nargs != 2)) {
44122 0 : goto __pyx_L5_argtuple_error;
44123 : } else {
44124 0 : __Pyx_RaiseKeywordRequired("idz_findrank", __pyx_n_s_rng); __PYX_ERR(0, 1226, __pyx_L3_error)
44125 : }
44126 4 : __pyx_v_A = values[0];
44127 4 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L3_error)
44128 4 : __pyx_v_rng = values[2];
44129 : }
44130 4 : goto __pyx_L6_skip;
44131 0 : __pyx_L5_argtuple_error:;
44132 0 : __Pyx_RaiseArgtupleInvalid("idz_findrank", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1226, __pyx_L3_error)
44133 4 : __pyx_L6_skip:;
44134 4 : goto __pyx_L4_argument_unpacking_done;
44135 0 : __pyx_L3_error:;
44136 : {
44137 0 : Py_ssize_t __pyx_temp;
44138 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
44139 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
44140 : }
44141 : }
44142 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_findrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
44143 0 : __Pyx_RefNannyFinishContext();
44144 0 : return NULL;
44145 4 : __pyx_L4_argument_unpacking_done:;
44146 4 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_44idz_findrank(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
44147 :
44148 : /* function exit code */
44149 : {
44150 4 : Py_ssize_t __pyx_temp;
44151 4 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
44152 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
44153 : }
44154 : }
44155 : __Pyx_RefNannyFinishContext();
44156 : return __pyx_r;
44157 : }
44158 :
44159 4 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_44idz_findrank(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
44160 4 : int __pyx_v_m;
44161 4 : int __pyx_v_n;
44162 4 : int __pyx_v_k;
44163 4 : int __pyx_v_kk;
44164 4 : int __pyx_v_r;
44165 4 : int __pyx_v_krank;
44166 4 : int __pyx_v_no_of_cols;
44167 4 : int __pyx_v_intone;
44168 4 : int __pyx_v_info;
44169 4 : __Pyx_memviewslice __pyx_v_tau = { 0, 0, { 0 }, { 0 }, { 0 } };
44170 4 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
44171 4 : PyArrayObject *__pyx_v_retarr = 0;
44172 4 : PyArrayObject *__pyx_v_x = 0;
44173 4 : __pyx_t_double_complex *__pyx_v_ra;
44174 4 : __pyx_t_double_complex *__pyx_v_reallocated_ra;
44175 4 : __pyx_t_double_complex *__pyx_v_ret;
44176 4 : __pyx_t_double_complex *__pyx_v_reallocated_ret;
44177 4 : __pyx_t_double_complex __pyx_v_enorm;
44178 4 : __Pyx_LocalBuf_ND __pyx_pybuffernd_retarr;
44179 4 : __Pyx_Buffer __pyx_pybuffer_retarr;
44180 4 : __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
44181 4 : __Pyx_Buffer __pyx_pybuffer_x;
44182 4 : PyObject *__pyx_r = NULL;
44183 : __Pyx_RefNannyDeclarations
44184 4 : PyObject *__pyx_t_1 = NULL;
44185 4 : PyObject *__pyx_t_2 = NULL;
44186 4 : int __pyx_t_3;
44187 4 : int __pyx_t_4;
44188 4 : int __pyx_t_5;
44189 4 : int __pyx_t_6;
44190 4 : npy_intp __pyx_t_7[1];
44191 4 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
44192 4 : npy_intp __pyx_t_9[1];
44193 4 : int __pyx_t_10;
44194 4 : Py_ssize_t __pyx_t_11;
44195 4 : Py_UCS4 __pyx_t_12;
44196 4 : PyObject *__pyx_t_13 = NULL;
44197 4 : PyObject *__pyx_t_14 = NULL;
44198 4 : PyObject *__pyx_t_15 = NULL;
44199 4 : PyObject *__pyx_t_16 = NULL;
44200 4 : unsigned int __pyx_t_17;
44201 4 : PyArrayObject *__pyx_t_18 = NULL;
44202 4 : PyObject *__pyx_t_19 = NULL;
44203 4 : PyObject *__pyx_t_20 = NULL;
44204 4 : PyObject *__pyx_t_21 = NULL;
44205 4 : Py_ssize_t __pyx_t_22;
44206 4 : Py_ssize_t __pyx_t_23;
44207 4 : Py_ssize_t __pyx_t_24;
44208 4 : __pyx_t_double_complex __pyx_t_25;
44209 4 : __pyx_t_npy_float64_complex __pyx_t_26;
44210 4 : npy_intp __pyx_t_27[2];
44211 4 : PyArrayObject *__pyx_t_28 = NULL;
44212 4 : int __pyx_t_29;
44213 4 : int __pyx_t_30;
44214 4 : int __pyx_t_31;
44215 4 : char const *__pyx_t_32;
44216 4 : PyObject *__pyx_t_33 = NULL;
44217 4 : PyObject *__pyx_t_34 = NULL;
44218 4 : PyObject *__pyx_t_35 = NULL;
44219 4 : npy_intp __pyx_t_36[2];
44220 4 : PyObject *__pyx_t_37 = NULL;
44221 4 : PyObject *__pyx_t_38 = NULL;
44222 4 : PyObject *__pyx_t_39 = NULL;
44223 4 : int __pyx_t_40;
44224 4 : int __pyx_t_41;
44225 4 : int __pyx_lineno = 0;
44226 4 : const char *__pyx_filename = NULL;
44227 4 : int __pyx_clineno = 0;
44228 4 : __Pyx_RefNannySetupContext("idz_findrank", 1);
44229 4 : __pyx_pybuffer_retarr.pybuffer.buf = NULL;
44230 4 : __pyx_pybuffer_retarr.refcount = 0;
44231 4 : __pyx_pybuffernd_retarr.data = NULL;
44232 4 : __pyx_pybuffernd_retarr.rcbuffer = &__pyx_pybuffer_retarr;
44233 4 : __pyx_pybuffer_x.pybuffer.buf = NULL;
44234 4 : __pyx_pybuffer_x.refcount = 0;
44235 4 : __pyx_pybuffernd_x.data = NULL;
44236 4 : __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
44237 :
44238 : /* "scipy/linalg/_decomp_interpolative.pyx":1229
44239 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
44240 : *
44241 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank # <<<<<<<<<<<<<<
44242 : * cdef int no_of_cols = 4, intone = 1, info = 0
44243 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)],
44244 : */
44245 4 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
44246 4 : __Pyx_GOTREF(__pyx_t_1);
44247 4 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
44248 4 : __Pyx_GOTREF(__pyx_t_2);
44249 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44250 4 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
44251 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44252 4 : __pyx_v_m = __pyx_t_3;
44253 4 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
44254 4 : __Pyx_GOTREF(__pyx_t_2);
44255 4 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
44256 4 : __Pyx_GOTREF(__pyx_t_1);
44257 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44258 4 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
44259 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44260 4 : __pyx_v_n = __pyx_t_3;
44261 4 : __pyx_v_k = 0;
44262 4 : __pyx_v_kk = 0;
44263 4 : __pyx_v_r = __pyx_v_n;
44264 :
44265 : /* "scipy/linalg/_decomp_interpolative.pyx":1230
44266 : *
44267 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank
44268 : * cdef int no_of_cols = 4, intone = 1, info = 0 # <<<<<<<<<<<<<<
44269 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)],
44270 : * cnp.NPY_COMPLEX128, 0)
44271 : */
44272 4 : __pyx_v_no_of_cols = 4;
44273 4 : __pyx_v_intone = 1;
44274 4 : __pyx_v_info = 0;
44275 :
44276 : /* "scipy/linalg/_decomp_interpolative.pyx":1231
44277 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank
44278 : * cdef int no_of_cols = 4, intone = 1, info = 0
44279 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], # <<<<<<<<<<<<<<
44280 : * cnp.NPY_COMPLEX128, 0)
44281 : * cdef cnp.complex128_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
44282 : */
44283 4 : __pyx_t_3 = __pyx_v_n;
44284 4 : __pyx_t_4 = __pyx_v_m;
44285 4 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
44286 4 : if (__pyx_t_6) {
44287 : __pyx_t_5 = __pyx_t_3;
44288 : } else {
44289 : __pyx_t_5 = __pyx_t_4;
44290 : }
44291 4 : __pyx_t_7[0] = __pyx_t_5;
44292 :
44293 : /* "scipy/linalg/_decomp_interpolative.pyx":1232
44294 : * cdef int no_of_cols = 4, intone = 1, info = 0
44295 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)],
44296 : * cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
44297 : * cdef cnp.complex128_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
44298 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] retarr
44299 : */
44300 4 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_7, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
44301 4 : __Pyx_GOTREF(__pyx_t_1);
44302 :
44303 : /* "scipy/linalg/_decomp_interpolative.pyx":1231
44304 : * cdef int m = A.shape[0], n = A.shape[1], k = 0, kk = 0,r = n, krank
44305 : * cdef int no_of_cols = 4, intone = 1, info = 0
44306 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)], # <<<<<<<<<<<<<<
44307 : * cnp.NPY_COMPLEX128, 0)
44308 : * cdef cnp.complex128_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
44309 : */
44310 4 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1231, __pyx_L1_error)
44311 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44312 4 : __pyx_v_tau = __pyx_t_8;
44313 4 : __pyx_t_8.memview = NULL;
44314 4 : __pyx_t_8.data = NULL;
44315 :
44316 : /* "scipy/linalg/_decomp_interpolative.pyx":1233
44317 : * cdef cnp.complex128_t[::1] tau = cnp.PyArray_ZEROS(1, [min(m, n)],
44318 : * cnp.NPY_COMPLEX128, 0)
44319 : * cdef cnp.complex128_t[::1] y = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
44320 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] retarr
44321 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] x
44322 : */
44323 4 : __pyx_t_9[0] = __pyx_v_n;
44324 4 : __pyx_t_1 = PyArray_ZEROS(1, __pyx_t_9, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error)
44325 4 : __Pyx_GOTREF(__pyx_t_1);
44326 4 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1233, __pyx_L1_error)
44327 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44328 4 : __pyx_v_y = __pyx_t_8;
44329 4 : __pyx_t_8.memview = NULL;
44330 4 : __pyx_t_8.data = NULL;
44331 :
44332 : /* "scipy/linalg/_decomp_interpolative.pyx":1243
44333 : * # Also, we hold the A.T @ x results in a separate array to return
44334 : * # and do the same for that too.
44335 : * cdef cnp.complex128_t *ra = <cnp.complex128_t*>PyMem_Malloc( # <<<<<<<<<<<<<<
44336 : * sizeof(cnp.complex128_t)*no_of_cols*n
44337 : * )
44338 : */
44339 4 : __pyx_v_ra = ((__pyx_t_double_complex *)PyMem_Malloc((((sizeof(__pyx_t_double_complex)) * __pyx_v_no_of_cols) * __pyx_v_n)));
44340 :
44341 : /* "scipy/linalg/_decomp_interpolative.pyx":1247
44342 : * )
44343 : * cdef cnp.complex128_t *reallocated_ra
44344 : * cdef cnp.complex128_t *ret = <cnp.complex128_t*>PyMem_Malloc( # <<<<<<<<<<<<<<
44345 : * sizeof(cnp.complex128_t)*no_of_cols*n
44346 : * )
44347 : */
44348 4 : __pyx_v_ret = ((__pyx_t_double_complex *)PyMem_Malloc((((sizeof(__pyx_t_double_complex)) * __pyx_v_no_of_cols) * __pyx_v_n)));
44349 :
44350 : /* "scipy/linalg/_decomp_interpolative.pyx":1251
44351 : * )
44352 : * cdef cnp.complex128_t *reallocated_ret
44353 : * cdef cnp.complex128_t enorm = 0.0 # <<<<<<<<<<<<<<
44354 : *
44355 : * if (not ra) or (not ret):
44356 : */
44357 4 : __pyx_v_enorm = __pyx_t_double_complex_from_parts(0.0, 0);
44358 :
44359 : /* "scipy/linalg/_decomp_interpolative.pyx":1253
44360 : * cdef cnp.complex128_t enorm = 0.0
44361 : *
44362 : * if (not ra) or (not ret): # <<<<<<<<<<<<<<
44363 : * raise MemoryError("Failed to allocate at least required memory "
44364 : * f"{no_of_cols*n*8} bytes for"
44365 : */
44366 4 : __pyx_t_10 = (!(__pyx_v_ra != 0));
44367 4 : if (!__pyx_t_10) {
44368 4 : } else {
44369 0 : __pyx_t_6 = __pyx_t_10;
44370 0 : goto __pyx_L4_bool_binop_done;
44371 : }
44372 4 : __pyx_t_10 = (!(__pyx_v_ret != 0));
44373 4 : __pyx_t_6 = __pyx_t_10;
44374 4 : __pyx_L4_bool_binop_done:;
44375 4 : if (unlikely(__pyx_t_6)) {
44376 :
44377 : /* "scipy/linalg/_decomp_interpolative.pyx":1254
44378 : *
44379 : * if (not ra) or (not ret):
44380 : * raise MemoryError("Failed to allocate at least required memory " # <<<<<<<<<<<<<<
44381 : * f"{no_of_cols*n*8} bytes for"
44382 : * "'scipy.linalg.interpolative.idz_findrank()' "
44383 : */
44384 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
44385 0 : __Pyx_GOTREF(__pyx_t_1);
44386 0 : __pyx_t_11 = 0;
44387 0 : __pyx_t_12 = 127;
44388 0 : __Pyx_INCREF(__pyx_kp_u_Failed_to_allocate_at_least_requ);
44389 0 : __pyx_t_11 += 44;
44390 0 : __Pyx_GIVEREF(__pyx_kp_u_Failed_to_allocate_at_least_requ);
44391 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Failed_to_allocate_at_least_requ);
44392 :
44393 : /* "scipy/linalg/_decomp_interpolative.pyx":1255
44394 : * if (not ra) or (not ret):
44395 : * raise MemoryError("Failed to allocate at least required memory "
44396 : * f"{no_of_cols*n*8} bytes for" # <<<<<<<<<<<<<<
44397 : * "'scipy.linalg.interpolative.idz_findrank()' "
44398 : * "function.")
44399 : */
44400 0 : __pyx_t_2 = __Pyx_PyUnicode_From_long(((__pyx_v_no_of_cols * __pyx_v_n) * 8), 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
44401 0 : __Pyx_GOTREF(__pyx_t_2);
44402 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
44403 0 : __Pyx_GIVEREF(__pyx_t_2);
44404 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
44405 0 : __pyx_t_2 = 0;
44406 0 : __Pyx_INCREF(__pyx_kp_u_bytes_for_scipy_linalg_interpol_2);
44407 0 : __pyx_t_11 += 63;
44408 0 : __Pyx_GIVEREF(__pyx_kp_u_bytes_for_scipy_linalg_interpol_2);
44409 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes_for_scipy_linalg_interpol_2);
44410 :
44411 : /* "scipy/linalg/_decomp_interpolative.pyx":1254
44412 : *
44413 : * if (not ra) or (not ret):
44414 : * raise MemoryError("Failed to allocate at least required memory " # <<<<<<<<<<<<<<
44415 : * f"{no_of_cols*n*8} bytes for"
44416 : * "'scipy.linalg.interpolative.idz_findrank()' "
44417 : */
44418 0 : __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
44419 0 : __Pyx_GOTREF(__pyx_t_2);
44420 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44421 0 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
44422 0 : __Pyx_GOTREF(__pyx_t_1);
44423 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44424 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
44425 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44426 0 : __PYX_ERR(0, 1254, __pyx_L1_error)
44427 :
44428 : /* "scipy/linalg/_decomp_interpolative.pyx":1253
44429 : * cdef cnp.complex128_t enorm = 0.0
44430 : *
44431 : * if (not ra) or (not ret): # <<<<<<<<<<<<<<
44432 : * raise MemoryError("Failed to allocate at least required memory "
44433 : * f"{no_of_cols*n*8} bytes for"
44434 : */
44435 : }
44436 :
44437 : /* "scipy/linalg/_decomp_interpolative.pyx":1259
44438 : * "function.")
44439 : *
44440 : * krank = 0 # <<<<<<<<<<<<<<
44441 : * try:
44442 : * while True:
44443 : */
44444 4 : __pyx_v_krank = 0;
44445 :
44446 : /* "scipy/linalg/_decomp_interpolative.pyx":1260
44447 : *
44448 : * krank = 0
44449 : * try: # <<<<<<<<<<<<<<
44450 : * while True:
44451 : *
44452 : */
44453 : /*try:*/ {
44454 :
44455 : /* "scipy/linalg/_decomp_interpolative.pyx":1261
44456 : * krank = 0
44457 : * try:
44458 : * while True: # <<<<<<<<<<<<<<
44459 : *
44460 : * # Generate random vector and rmatvec then save the result
44461 : */
44462 56 : while (1) {
44463 :
44464 : /* "scipy/linalg/_decomp_interpolative.pyx":1264
44465 : *
44466 : * # Generate random vector and rmatvec then save the result
44467 : * x = rng.uniform(size=(m,2)).view(np.complex128).ravel() # <<<<<<<<<<<<<<
44468 : * y = A.rmatvec(x)
44469 : *
44470 : */
44471 56 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1264, __pyx_L7_error)
44472 56 : __Pyx_GOTREF(__pyx_t_13);
44473 56 : __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1264, __pyx_L7_error)
44474 56 : __Pyx_GOTREF(__pyx_t_14);
44475 56 : __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1264, __pyx_L7_error)
44476 56 : __Pyx_GOTREF(__pyx_t_15);
44477 56 : __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1264, __pyx_L7_error)
44478 56 : __Pyx_GOTREF(__pyx_t_16);
44479 56 : __Pyx_GIVEREF(__pyx_t_15);
44480 56 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15)) __PYX_ERR(0, 1264, __pyx_L7_error);
44481 56 : __Pyx_INCREF(__pyx_int_2);
44482 56 : __Pyx_GIVEREF(__pyx_int_2);
44483 56 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_int_2)) __PYX_ERR(0, 1264, __pyx_L7_error);
44484 56 : __pyx_t_15 = 0;
44485 56 : if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_size, __pyx_t_16) < 0) __PYX_ERR(0, 1264, __pyx_L7_error)
44486 56 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
44487 56 : __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_empty_tuple, __pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1264, __pyx_L7_error)
44488 56 : __Pyx_GOTREF(__pyx_t_16);
44489 56 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
44490 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44491 56 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_view); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1264, __pyx_L7_error)
44492 56 : __Pyx_GOTREF(__pyx_t_14);
44493 56 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
44494 56 : __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1264, __pyx_L7_error)
44495 56 : __Pyx_GOTREF(__pyx_t_16);
44496 56 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_complex128); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1264, __pyx_L7_error)
44497 56 : __Pyx_GOTREF(__pyx_t_13);
44498 56 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
44499 56 : __pyx_t_16 = NULL;
44500 56 : __pyx_t_17 = 0;
44501 : #if CYTHON_UNPACK_METHODS
44502 56 : if (likely(PyMethod_Check(__pyx_t_14))) {
44503 0 : __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
44504 0 : if (likely(__pyx_t_16)) {
44505 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
44506 0 : __Pyx_INCREF(__pyx_t_16);
44507 0 : __Pyx_INCREF(function);
44508 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
44509 : __pyx_t_17 = 1;
44510 : }
44511 : }
44512 : #endif
44513 : {
44514 56 : PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_13};
44515 56 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
44516 56 : __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
44517 56 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
44518 56 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L7_error)
44519 56 : __Pyx_GOTREF(__pyx_t_2);
44520 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44521 : }
44522 56 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1264, __pyx_L7_error)
44523 56 : __Pyx_GOTREF(__pyx_t_14);
44524 56 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44525 56 : __pyx_t_2 = NULL;
44526 56 : __pyx_t_17 = 0;
44527 : #if CYTHON_UNPACK_METHODS
44528 56 : if (likely(PyMethod_Check(__pyx_t_14))) {
44529 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
44530 0 : if (likely(__pyx_t_2)) {
44531 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
44532 0 : __Pyx_INCREF(__pyx_t_2);
44533 0 : __Pyx_INCREF(function);
44534 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
44535 : __pyx_t_17 = 1;
44536 : }
44537 : }
44538 : #endif
44539 : {
44540 56 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
44541 56 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_17, 0+__pyx_t_17);
44542 56 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
44543 56 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L7_error)
44544 56 : __Pyx_GOTREF(__pyx_t_1);
44545 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44546 : }
44547 56 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1264, __pyx_L7_error)
44548 56 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
44549 : {
44550 56 : __Pyx_BufFmt_StackElem __pyx_stack[1];
44551 56 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
44552 56 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
44553 56 : if (unlikely(__pyx_t_5 < 0)) {
44554 0 : PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
44555 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
44556 0 : Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
44557 0 : __Pyx_RaiseBufferFallbackError();
44558 : } else {
44559 0 : PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
44560 : }
44561 0 : __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
44562 : }
44563 56 : __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
44564 56 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1264, __pyx_L7_error)
44565 : }
44566 56 : __pyx_t_18 = 0;
44567 56 : __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_1));
44568 56 : __pyx_t_1 = 0;
44569 :
44570 : /* "scipy/linalg/_decomp_interpolative.pyx":1265
44571 : * # Generate random vector and rmatvec then save the result
44572 : * x = rng.uniform(size=(m,2)).view(np.complex128).ravel()
44573 : * y = A.rmatvec(x) # <<<<<<<<<<<<<<
44574 : *
44575 : * for kk in range(n):
44576 : */
44577 56 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1265, __pyx_L7_error)
44578 56 : __Pyx_GOTREF(__pyx_t_14);
44579 56 : __pyx_t_2 = NULL;
44580 56 : __pyx_t_17 = 0;
44581 : #if CYTHON_UNPACK_METHODS
44582 56 : if (likely(PyMethod_Check(__pyx_t_14))) {
44583 56 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
44584 56 : if (likely(__pyx_t_2)) {
44585 56 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
44586 56 : __Pyx_INCREF(__pyx_t_2);
44587 56 : __Pyx_INCREF(function);
44588 56 : __Pyx_DECREF_SET(__pyx_t_14, function);
44589 : __pyx_t_17 = 1;
44590 : }
44591 : }
44592 : #endif
44593 : {
44594 56 : PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_x)};
44595 56 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
44596 56 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
44597 56 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L7_error)
44598 56 : __Pyx_GOTREF(__pyx_t_1);
44599 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44600 : }
44601 56 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1265, __pyx_L7_error)
44602 56 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44603 56 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
44604 56 : __pyx_v_y = __pyx_t_8;
44605 56 : __pyx_t_8.memview = NULL;
44606 56 : __pyx_t_8.data = NULL;
44607 :
44608 : /* "scipy/linalg/_decomp_interpolative.pyx":1267
44609 : * y = A.rmatvec(x)
44610 : *
44611 : * for kk in range(n): # <<<<<<<<<<<<<<
44612 : * ret[krank*n + kk] = y[kk]
44613 : *
44614 : */
44615 56 : __pyx_t_5 = __pyx_v_n;
44616 56 : __pyx_t_3 = __pyx_t_5;
44617 15965 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
44618 15909 : __pyx_v_kk = __pyx_t_4;
44619 :
44620 : /* "scipy/linalg/_decomp_interpolative.pyx":1268
44621 : *
44622 : * for kk in range(n):
44623 : * ret[krank*n + kk] = y[kk] # <<<<<<<<<<<<<<
44624 : *
44625 : * if krank == 0:
44626 : */
44627 15909 : __pyx_t_22 = __pyx_v_kk;
44628 15909 : (__pyx_v_ret[((__pyx_v_krank * __pyx_v_n) + __pyx_v_kk)]) = (*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_22)) )));
44629 : }
44630 :
44631 : /* "scipy/linalg/_decomp_interpolative.pyx":1270
44632 : * ret[krank*n + kk] = y[kk]
44633 : *
44634 : * if krank == 0: # <<<<<<<<<<<<<<
44635 : * enorm = dznrm2(&n, &y[0], &intone)
44636 : * else: # krank > 0
44637 : */
44638 56 : __pyx_t_6 = (__pyx_v_krank == 0);
44639 56 : if (__pyx_t_6) {
44640 :
44641 : /* "scipy/linalg/_decomp_interpolative.pyx":1271
44642 : *
44643 : * if krank == 0:
44644 : * enorm = dznrm2(&n, &y[0], &intone) # <<<<<<<<<<<<<<
44645 : * else: # krank > 0
44646 : * # Transpose-Apply previous Householder reflectors, if any
44647 : */
44648 4 : __pyx_t_22 = 0;
44649 4 : __pyx_v_enorm = __pyx_t_double_complex_from_parts(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_22)) )))), (&__pyx_v_intone)), 0);
44650 :
44651 : /* "scipy/linalg/_decomp_interpolative.pyx":1270
44652 : * ret[krank*n + kk] = y[kk]
44653 : *
44654 : * if krank == 0: # <<<<<<<<<<<<<<
44655 : * enorm = dznrm2(&n, &y[0], &intone)
44656 : * else: # krank > 0
44657 : */
44658 4 : goto __pyx_L13;
44659 : }
44660 :
44661 : /* "scipy/linalg/_decomp_interpolative.pyx":1275
44662 : * # Transpose-Apply previous Householder reflectors, if any
44663 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
44664 : * zunm2r(<char*>'L',<char*>'C', &n, &intone, &krank, &ra[0], &n, # <<<<<<<<<<<<<<
44665 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info)
44666 : *
44667 : */
44668 : /*else*/ {
44669 :
44670 : /* "scipy/linalg/_decomp_interpolative.pyx":1276
44671 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
44672 : * zunm2r(<char*>'L',<char*>'C', &n, &intone, &krank, &ra[0], &n,
44673 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info) # <<<<<<<<<<<<<<
44674 : *
44675 : * # Get the next Householder reflector
44676 : */
44677 52 : __pyx_t_22 = 0;
44678 52 : __pyx_t_23 = 0;
44679 :
44680 : /* "scipy/linalg/_decomp_interpolative.pyx":1275
44681 : * # Transpose-Apply previous Householder reflectors, if any
44682 : * # SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO
44683 : * zunm2r(<char*>'L',<char*>'C', &n, &intone, &krank, &ra[0], &n, # <<<<<<<<<<<<<<
44684 : * &tau[0], &y[0], &n, &ra[(no_of_cols-1)*n], &info)
44685 : *
44686 : */
44687 52 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"L")), ((char *)((char *)"C")), (&__pyx_v_n), (&__pyx_v_intone), (&__pyx_v_krank), (&(__pyx_v_ra[0])), (&__pyx_v_n), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_tau.data) + __pyx_t_22)) )))), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_23)) )))), (&__pyx_v_n), (&(__pyx_v_ra[((__pyx_v_no_of_cols - 1) * __pyx_v_n)])), (&__pyx_v_info));
44688 : }
44689 56 : __pyx_L13:;
44690 :
44691 : /* "scipy/linalg/_decomp_interpolative.pyx":1279
44692 : *
44693 : * # Get the next Householder reflector
44694 : * r = n-krank # <<<<<<<<<<<<<<
44695 : * # N, ALPHA, X, INCX, TAU
44696 : * zlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank])
44697 : */
44698 56 : __pyx_v_r = (__pyx_v_n - __pyx_v_krank);
44699 :
44700 : /* "scipy/linalg/_decomp_interpolative.pyx":1281
44701 : * r = n-krank
44702 : * # N, ALPHA, X, INCX, TAU
44703 : * zlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank]) # <<<<<<<<<<<<<<
44704 : *
44705 : * for kk in range(n):
44706 : */
44707 56 : __pyx_t_23 = __pyx_v_krank;
44708 56 : __pyx_t_22 = (__pyx_v_krank + 1);
44709 56 : __pyx_t_24 = __pyx_v_krank;
44710 56 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp((&__pyx_v_r), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_23)) )))), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_22)) )))), (&__pyx_v_intone), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_tau.data) + __pyx_t_24)) )))));
44711 :
44712 : /* "scipy/linalg/_decomp_interpolative.pyx":1283
44713 : * zlarfgp(&r, &y[krank], &y[krank+1], &intone, &tau[krank])
44714 : *
44715 : * for kk in range(n): # <<<<<<<<<<<<<<
44716 : * ra[krank*n + kk] = y[kk]
44717 : *
44718 : */
44719 56 : __pyx_t_5 = __pyx_v_n;
44720 56 : __pyx_t_3 = __pyx_t_5;
44721 15965 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
44722 15909 : __pyx_v_kk = __pyx_t_4;
44723 :
44724 : /* "scipy/linalg/_decomp_interpolative.pyx":1284
44725 : *
44726 : * for kk in range(n):
44727 : * ra[krank*n + kk] = y[kk] # <<<<<<<<<<<<<<
44728 : *
44729 : * # Running out of space; try to double the size of ra
44730 : */
44731 15909 : __pyx_t_24 = __pyx_v_kk;
44732 15909 : (__pyx_v_ra[((__pyx_v_krank * __pyx_v_n) + __pyx_v_kk)]) = (*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_24)) )));
44733 : }
44734 :
44735 : /* "scipy/linalg/_decomp_interpolative.pyx":1287
44736 : *
44737 : * # Running out of space; try to double the size of ra
44738 : * if krank == (no_of_cols-2): # <<<<<<<<<<<<<<
44739 : * reallocated_ra = <cnp.complex128_t *>PyMem_Realloc(
44740 : * ra, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44741 : */
44742 56 : __pyx_t_6 = (__pyx_v_krank == (__pyx_v_no_of_cols - 2));
44743 56 : if (__pyx_t_6) {
44744 :
44745 : /* "scipy/linalg/_decomp_interpolative.pyx":1288
44746 : * # Running out of space; try to double the size of ra
44747 : * if krank == (no_of_cols-2):
44748 : * reallocated_ra = <cnp.complex128_t *>PyMem_Realloc( # <<<<<<<<<<<<<<
44749 : * ra, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44750 : * reallocated_ret = <cnp.complex128_t *>PyMem_Realloc(
44751 : */
44752 10 : __pyx_v_reallocated_ra = ((__pyx_t_double_complex *)PyMem_Realloc(__pyx_v_ra, ((((sizeof(__pyx_t_double_complex)) * __pyx_v_no_of_cols) * __pyx_v_n) * 2)));
44753 :
44754 : /* "scipy/linalg/_decomp_interpolative.pyx":1290
44755 : * reallocated_ra = <cnp.complex128_t *>PyMem_Realloc(
44756 : * ra, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44757 : * reallocated_ret = <cnp.complex128_t *>PyMem_Realloc( # <<<<<<<<<<<<<<
44758 : * ret, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44759 : *
44760 : */
44761 10 : __pyx_v_reallocated_ret = ((__pyx_t_double_complex *)PyMem_Realloc(__pyx_v_ret, ((((sizeof(__pyx_t_double_complex)) * __pyx_v_no_of_cols) * __pyx_v_n) * 2)));
44762 :
44763 : /* "scipy/linalg/_decomp_interpolative.pyx":1293
44764 : * ret, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44765 : *
44766 : * if reallocated_ra and reallocated_ret: # <<<<<<<<<<<<<<
44767 : * ra = reallocated_ra
44768 : * ret = reallocated_ret
44769 : */
44770 10 : __pyx_t_10 = (__pyx_v_reallocated_ra != 0);
44771 10 : if (__pyx_t_10) {
44772 10 : } else {
44773 0 : __pyx_t_6 = __pyx_t_10;
44774 0 : goto __pyx_L18_bool_binop_done;
44775 : }
44776 10 : __pyx_t_10 = (__pyx_v_reallocated_ret != 0);
44777 10 : __pyx_t_6 = __pyx_t_10;
44778 10 : __pyx_L18_bool_binop_done:;
44779 10 : if (likely(__pyx_t_6)) {
44780 :
44781 : /* "scipy/linalg/_decomp_interpolative.pyx":1294
44782 : *
44783 : * if reallocated_ra and reallocated_ret:
44784 : * ra = reallocated_ra # <<<<<<<<<<<<<<
44785 : * ret = reallocated_ret
44786 : * no_of_cols *= 2
44787 : */
44788 10 : __pyx_v_ra = __pyx_v_reallocated_ra;
44789 :
44790 : /* "scipy/linalg/_decomp_interpolative.pyx":1295
44791 : * if reallocated_ra and reallocated_ret:
44792 : * ra = reallocated_ra
44793 : * ret = reallocated_ret # <<<<<<<<<<<<<<
44794 : * no_of_cols *= 2
44795 : * else:
44796 : */
44797 10 : __pyx_v_ret = __pyx_v_reallocated_ret;
44798 :
44799 : /* "scipy/linalg/_decomp_interpolative.pyx":1296
44800 : * ra = reallocated_ra
44801 : * ret = reallocated_ret
44802 : * no_of_cols *= 2 # <<<<<<<<<<<<<<
44803 : * else:
44804 : * raise MemoryError(
44805 : */
44806 10 : __pyx_v_no_of_cols = (__pyx_v_no_of_cols * 2);
44807 :
44808 : /* "scipy/linalg/_decomp_interpolative.pyx":1293
44809 : * ret, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44810 : *
44811 : * if reallocated_ra and reallocated_ret: # <<<<<<<<<<<<<<
44812 : * ra = reallocated_ra
44813 : * ret = reallocated_ret
44814 : */
44815 10 : goto __pyx_L17;
44816 : }
44817 :
44818 : /* "scipy/linalg/_decomp_interpolative.pyx":1298
44819 : * no_of_cols *= 2
44820 : * else:
44821 : * raise MemoryError( # <<<<<<<<<<<<<<
44822 : * "'scipy.linalg.interpolative.idz_findrank()' failed to "
44823 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
44824 : */
44825 : /*else*/ {
44826 :
44827 : /* "scipy/linalg/_decomp_interpolative.pyx":1299
44828 : * else:
44829 : * raise MemoryError(
44830 : * "'scipy.linalg.interpolative.idz_findrank()' failed to " # <<<<<<<<<<<<<<
44831 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
44832 : * "while trying to determine the rank (currently "
44833 : */
44834 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L7_error)
44835 0 : __Pyx_GOTREF(__pyx_t_1);
44836 0 : __pyx_t_11 = 0;
44837 0 : __pyx_t_12 = 127;
44838 0 : __Pyx_INCREF(__pyx_kp_u_scipy_linalg_interpolative_idz);
44839 0 : __pyx_t_11 += 83;
44840 0 : __Pyx_GIVEREF(__pyx_kp_u_scipy_linalg_interpolative_idz);
44841 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_scipy_linalg_interpolative_idz);
44842 :
44843 : /* "scipy/linalg/_decomp_interpolative.pyx":1300
44844 : * raise MemoryError(
44845 : * "'scipy.linalg.interpolative.idz_findrank()' failed to "
44846 : * f"allocate the required memory,{no_of_cols*n*16} bytes " # <<<<<<<<<<<<<<
44847 : * "while trying to determine the rank (currently "
44848 : * f"{krank}) of a LinearOperator with precision {eps}."
44849 : */
44850 0 : __pyx_t_14 = __Pyx_PyUnicode_From_long(((__pyx_v_no_of_cols * __pyx_v_n) * 16), 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1300, __pyx_L7_error)
44851 0 : __Pyx_GOTREF(__pyx_t_14);
44852 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
44853 0 : __Pyx_GIVEREF(__pyx_t_14);
44854 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_14);
44855 0 : __pyx_t_14 = 0;
44856 0 : __Pyx_INCREF(__pyx_kp_u_bytes_while_trying_to_determine);
44857 0 : __pyx_t_11 += 53;
44858 0 : __Pyx_GIVEREF(__pyx_kp_u_bytes_while_trying_to_determine);
44859 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes_while_trying_to_determine);
44860 :
44861 : /* "scipy/linalg/_decomp_interpolative.pyx":1302
44862 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
44863 : * "while trying to determine the rank (currently "
44864 : * f"{krank}) of a LinearOperator with precision {eps}." # <<<<<<<<<<<<<<
44865 : * )
44866 : * krank += 1
44867 : */
44868 0 : __pyx_t_14 = __Pyx_PyUnicode_From_int(__pyx_v_krank, 0, ' ', 'd'); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1302, __pyx_L7_error)
44869 0 : __Pyx_GOTREF(__pyx_t_14);
44870 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
44871 0 : __Pyx_GIVEREF(__pyx_t_14);
44872 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_14);
44873 0 : __pyx_t_14 = 0;
44874 0 : __Pyx_INCREF(__pyx_kp_u_of_a_LinearOperator_with_precis);
44875 0 : __pyx_t_11 += 37;
44876 0 : __Pyx_GIVEREF(__pyx_kp_u_of_a_LinearOperator_with_precis);
44877 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_of_a_LinearOperator_with_precis);
44878 0 : __pyx_t_14 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1302, __pyx_L7_error)
44879 0 : __Pyx_GOTREF(__pyx_t_14);
44880 0 : __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L7_error)
44881 0 : __Pyx_GOTREF(__pyx_t_2);
44882 0 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44883 0 : __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_12;
44884 0 : __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
44885 0 : __Pyx_GIVEREF(__pyx_t_2);
44886 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
44887 0 : __pyx_t_2 = 0;
44888 0 : __Pyx_INCREF(__pyx_kp_u__2);
44889 0 : __pyx_t_11 += 1;
44890 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
44891 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__2);
44892 :
44893 : /* "scipy/linalg/_decomp_interpolative.pyx":1299
44894 : * else:
44895 : * raise MemoryError(
44896 : * "'scipy.linalg.interpolative.idz_findrank()' failed to " # <<<<<<<<<<<<<<
44897 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
44898 : * "while trying to determine the rank (currently "
44899 : */
44900 0 : __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L7_error)
44901 0 : __Pyx_GOTREF(__pyx_t_2);
44902 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44903 :
44904 : /* "scipy/linalg/_decomp_interpolative.pyx":1298
44905 : * no_of_cols *= 2
44906 : * else:
44907 : * raise MemoryError( # <<<<<<<<<<<<<<
44908 : * "'scipy.linalg.interpolative.idz_findrank()' failed to "
44909 : * f"allocate the required memory,{no_of_cols*n*16} bytes "
44910 : */
44911 0 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L7_error)
44912 0 : __Pyx_GOTREF(__pyx_t_1);
44913 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44914 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
44915 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44916 0 : __PYX_ERR(0, 1298, __pyx_L7_error)
44917 : }
44918 10 : __pyx_L17:;
44919 :
44920 : /* "scipy/linalg/_decomp_interpolative.pyx":1287
44921 : *
44922 : * # Running out of space; try to double the size of ra
44923 : * if krank == (no_of_cols-2): # <<<<<<<<<<<<<<
44924 : * reallocated_ra = <cnp.complex128_t *>PyMem_Realloc(
44925 : * ra, sizeof(cnp.complex128_t)*no_of_cols*n*2)
44926 : */
44927 : }
44928 :
44929 : /* "scipy/linalg/_decomp_interpolative.pyx":1304
44930 : * f"{krank}) of a LinearOperator with precision {eps}."
44931 : * )
44932 : * krank += 1 # <<<<<<<<<<<<<<
44933 : * if (np.abs(y[krank-1]) < eps*enorm) or (krank >= min(m, n)):
44934 : * break
44935 : */
44936 56 : __pyx_v_krank = (__pyx_v_krank + 1);
44937 :
44938 : /* "scipy/linalg/_decomp_interpolative.pyx":1305
44939 : * )
44940 : * krank += 1
44941 : * if (np.abs(y[krank-1]) < eps*enorm) or (krank >= min(m, n)): # <<<<<<<<<<<<<<
44942 : * break
44943 : * finally:
44944 : */
44945 56 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L7_error)
44946 56 : __Pyx_GOTREF(__pyx_t_2);
44947 56 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_abs); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1305, __pyx_L7_error)
44948 56 : __Pyx_GOTREF(__pyx_t_14);
44949 56 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44950 56 : __pyx_t_24 = (__pyx_v_krank - 1);
44951 56 : __pyx_t_25 = (*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_y.data) + __pyx_t_24)) )));
44952 56 : __pyx_t_2 = __pyx_PyComplex_FromComplex(__pyx_t_25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L7_error)
44953 56 : __Pyx_GOTREF(__pyx_t_2);
44954 56 : __pyx_t_13 = NULL;
44955 56 : __pyx_t_17 = 0;
44956 : #if CYTHON_UNPACK_METHODS
44957 56 : if (unlikely(PyMethod_Check(__pyx_t_14))) {
44958 0 : __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
44959 0 : if (likely(__pyx_t_13)) {
44960 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
44961 0 : __Pyx_INCREF(__pyx_t_13);
44962 0 : __Pyx_INCREF(function);
44963 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
44964 : __pyx_t_17 = 1;
44965 : }
44966 : }
44967 : #endif
44968 : {
44969 56 : PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2};
44970 56 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_17, 1+__pyx_t_17);
44971 56 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
44972 56 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44973 56 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L7_error)
44974 56 : __Pyx_GOTREF(__pyx_t_1);
44975 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44976 : }
44977 56 : __pyx_t_26 = __Pyx_c_prod_npy_float64(__pyx_t_npy_float64_complex_from_parts(__pyx_v_eps, 0), __pyx_t_npy_float64_complex_from_parts(__Pyx_CREAL(__pyx_v_enorm), __Pyx_CIMAG(__pyx_v_enorm)));
44978 56 : __pyx_t_14 = __pyx_PyComplex_FromComplex_CyTypedef(__pyx_t_26); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1305, __pyx_L7_error)
44979 56 : __Pyx_GOTREF(__pyx_t_14);
44980 56 : __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L7_error)
44981 56 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44982 56 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44983 56 : __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1305, __pyx_L7_error)
44984 56 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
44985 56 : if (!__pyx_t_10) {
44986 52 : } else {
44987 4 : __pyx_t_6 = __pyx_t_10;
44988 4 : goto __pyx_L21_bool_binop_done;
44989 : }
44990 52 : __pyx_t_5 = __pyx_v_n;
44991 52 : __pyx_t_3 = __pyx_v_m;
44992 52 : __pyx_t_10 = (__pyx_t_5 < __pyx_t_3);
44993 52 : if (__pyx_t_10) {
44994 : __pyx_t_4 = __pyx_t_5;
44995 : } else {
44996 : __pyx_t_4 = __pyx_t_3;
44997 : }
44998 52 : __pyx_t_10 = (__pyx_v_krank >= __pyx_t_4);
44999 52 : __pyx_t_6 = __pyx_t_10;
45000 56 : __pyx_L21_bool_binop_done:;
45001 56 : if (__pyx_t_6) {
45002 :
45003 : /* "scipy/linalg/_decomp_interpolative.pyx":1306
45004 : * krank += 1
45005 : * if (np.abs(y[krank-1]) < eps*enorm) or (krank >= min(m, n)):
45006 : * break # <<<<<<<<<<<<<<
45007 : * finally:
45008 : * # Crashed or successfully ended up here
45009 : */
45010 4 : goto __pyx_L10_break;
45011 :
45012 : /* "scipy/linalg/_decomp_interpolative.pyx":1305
45013 : * )
45014 : * krank += 1
45015 : * if (np.abs(y[krank-1]) < eps*enorm) or (krank >= min(m, n)): # <<<<<<<<<<<<<<
45016 : * break
45017 : * finally:
45018 : */
45019 : }
45020 : }
45021 4 : __pyx_L10_break:;
45022 : }
45023 :
45024 : /* "scipy/linalg/_decomp_interpolative.pyx":1310
45025 : * # Crashed or successfully ended up here
45026 : * # Discard Householder vectors
45027 : * PyMem_Free(ra) # <<<<<<<<<<<<<<
45028 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45029 : * for k in range(krank):
45030 : */
45031 : /*finally:*/ {
45032 : /*normal exit:*/{
45033 4 : PyMem_Free(__pyx_v_ra);
45034 :
45035 : /* "scipy/linalg/_decomp_interpolative.pyx":1311
45036 : * # Discard Householder vectors
45037 : * PyMem_Free(ra)
45038 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
45039 : * for k in range(krank):
45040 : * for kk in range(n):
45041 : */
45042 4 : __pyx_t_27[0] = __pyx_v_krank;
45043 4 : __pyx_t_27[1] = __pyx_v_n;
45044 4 : __pyx_t_2 = PyArray_EMPTY(2, __pyx_t_27, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error)
45045 4 : __Pyx_GOTREF(__pyx_t_2);
45046 4 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1311, __pyx_L1_error)
45047 4 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_2);
45048 : {
45049 4 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45050 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
45051 4 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
45052 4 : if (unlikely(__pyx_t_4 < 0)) {
45053 0 : PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
45054 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_retarr, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
45055 : Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
45056 : __Pyx_RaiseBufferFallbackError();
45057 : } else {
45058 0 : PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
45059 : }
45060 0 : __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
45061 : }
45062 4 : __pyx_pybuffernd_retarr.diminfo[0].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_retarr.diminfo[0].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_retarr.diminfo[1].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_retarr.diminfo[1].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[1];
45063 4 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1311, __pyx_L1_error)
45064 : }
45065 4 : __pyx_t_28 = 0;
45066 4 : __pyx_v_retarr = ((PyArrayObject *)__pyx_t_2);
45067 4 : __pyx_t_2 = 0;
45068 :
45069 : /* "scipy/linalg/_decomp_interpolative.pyx":1312
45070 : * PyMem_Free(ra)
45071 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45072 : * for k in range(krank): # <<<<<<<<<<<<<<
45073 : * for kk in range(n):
45074 : * retarr[k, kk] = ret[k*n+kk]
45075 : */
45076 4 : __pyx_t_4 = __pyx_v_krank;
45077 4 : __pyx_t_5 = __pyx_t_4;
45078 60 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
45079 56 : __pyx_v_k = __pyx_t_3;
45080 :
45081 : /* "scipy/linalg/_decomp_interpolative.pyx":1313
45082 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45083 : * for k in range(krank):
45084 : * for kk in range(n): # <<<<<<<<<<<<<<
45085 : * retarr[k, kk] = ret[k*n+kk]
45086 : * PyMem_Free(ret)
45087 : */
45088 56 : __pyx_t_29 = __pyx_v_n;
45089 56 : __pyx_t_30 = __pyx_t_29;
45090 15965 : for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
45091 15909 : __pyx_v_kk = __pyx_t_31;
45092 :
45093 : /* "scipy/linalg/_decomp_interpolative.pyx":1314
45094 : * for k in range(krank):
45095 : * for kk in range(n):
45096 : * retarr[k, kk] = ret[k*n+kk] # <<<<<<<<<<<<<<
45097 : * PyMem_Free(ret)
45098 : *
45099 : */
45100 15909 : __pyx_t_24 = __pyx_v_k;
45101 15909 : __pyx_t_22 = __pyx_v_kk;
45102 15909 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_retarr.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_retarr.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_retarr.diminfo[1].strides) = (__pyx_v_ret[((__pyx_v_k * __pyx_v_n) + __pyx_v_kk)]);
45103 : }
45104 : }
45105 :
45106 : /* "scipy/linalg/_decomp_interpolative.pyx":1315
45107 : * for kk in range(n):
45108 : * retarr[k, kk] = ret[k*n+kk]
45109 : * PyMem_Free(ret) # <<<<<<<<<<<<<<
45110 : *
45111 : * return krank, retarr
45112 : */
45113 4 : PyMem_Free(__pyx_v_ret);
45114 4 : goto __pyx_L8;
45115 : }
45116 0 : __pyx_L7_error:;
45117 : /*exception exit:*/{
45118 0 : __Pyx_PyThreadState_declare
45119 0 : __Pyx_PyThreadState_assign
45120 0 : __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; __pyx_t_35 = 0;
45121 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
45122 0 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
45123 0 : __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
45124 0 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
45125 0 : __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
45126 0 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
45127 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
45128 0 : __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL;
45129 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_33, &__pyx_t_34, &__pyx_t_35);
45130 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
45131 0 : __Pyx_XGOTREF(__pyx_t_19);
45132 0 : __Pyx_XGOTREF(__pyx_t_20);
45133 0 : __Pyx_XGOTREF(__pyx_t_21);
45134 0 : __Pyx_XGOTREF(__pyx_t_33);
45135 0 : __Pyx_XGOTREF(__pyx_t_34);
45136 0 : __Pyx_XGOTREF(__pyx_t_35);
45137 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
45138 : {
45139 :
45140 : /* "scipy/linalg/_decomp_interpolative.pyx":1310
45141 : * # Crashed or successfully ended up here
45142 : * # Discard Householder vectors
45143 : * PyMem_Free(ra) # <<<<<<<<<<<<<<
45144 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45145 : * for k in range(krank):
45146 : */
45147 0 : PyMem_Free(__pyx_v_ra);
45148 :
45149 : /* "scipy/linalg/_decomp_interpolative.pyx":1311
45150 : * # Discard Householder vectors
45151 : * PyMem_Free(ra)
45152 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
45153 : * for k in range(krank):
45154 : * for kk in range(n):
45155 : */
45156 0 : __pyx_t_36[0] = __pyx_v_krank;
45157 0 : __pyx_t_36[1] = __pyx_v_n;
45158 0 : __pyx_t_2 = PyArray_EMPTY(2, __pyx_t_36, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L28_error)
45159 0 : __Pyx_GOTREF(__pyx_t_2);
45160 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1311, __pyx_L28_error)
45161 0 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_2);
45162 : {
45163 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45164 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
45165 0 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
45166 0 : if (unlikely(__pyx_t_3 < 0)) {
45167 0 : PyErr_Fetch(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39);
45168 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer, (PyObject*)__pyx_v_retarr, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
45169 : Py_XDECREF(__pyx_t_37); Py_XDECREF(__pyx_t_38); Py_XDECREF(__pyx_t_39);
45170 : __Pyx_RaiseBufferFallbackError();
45171 : } else {
45172 0 : PyErr_Restore(__pyx_t_37, __pyx_t_38, __pyx_t_39);
45173 : }
45174 0 : __pyx_t_37 = __pyx_t_38 = __pyx_t_39 = 0;
45175 : }
45176 0 : __pyx_pybuffernd_retarr.diminfo[0].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_retarr.diminfo[0].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_retarr.diminfo[1].strides = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_retarr.diminfo[1].shape = __pyx_pybuffernd_retarr.rcbuffer->pybuffer.shape[1];
45177 0 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1311, __pyx_L28_error)
45178 : }
45179 0 : __pyx_t_28 = 0;
45180 0 : __pyx_v_retarr = ((PyArrayObject *)__pyx_t_2);
45181 0 : __pyx_t_2 = 0;
45182 :
45183 : /* "scipy/linalg/_decomp_interpolative.pyx":1312
45184 : * PyMem_Free(ra)
45185 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45186 : * for k in range(krank): # <<<<<<<<<<<<<<
45187 : * for kk in range(n):
45188 : * retarr[k, kk] = ret[k*n+kk]
45189 : */
45190 0 : __pyx_t_3 = __pyx_v_krank;
45191 0 : __pyx_t_29 = __pyx_t_3;
45192 0 : for (__pyx_t_30 = 0; __pyx_t_30 < __pyx_t_29; __pyx_t_30+=1) {
45193 0 : __pyx_v_k = __pyx_t_30;
45194 :
45195 : /* "scipy/linalg/_decomp_interpolative.pyx":1313
45196 : * retarr = cnp.PyArray_EMPTY(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45197 : * for k in range(krank):
45198 : * for kk in range(n): # <<<<<<<<<<<<<<
45199 : * retarr[k, kk] = ret[k*n+kk]
45200 : * PyMem_Free(ret)
45201 : */
45202 0 : __pyx_t_31 = __pyx_v_n;
45203 0 : __pyx_t_40 = __pyx_t_31;
45204 0 : for (__pyx_t_41 = 0; __pyx_t_41 < __pyx_t_40; __pyx_t_41+=1) {
45205 0 : __pyx_v_kk = __pyx_t_41;
45206 :
45207 : /* "scipy/linalg/_decomp_interpolative.pyx":1314
45208 : * for k in range(krank):
45209 : * for kk in range(n):
45210 : * retarr[k, kk] = ret[k*n+kk] # <<<<<<<<<<<<<<
45211 : * PyMem_Free(ret)
45212 : *
45213 : */
45214 0 : __pyx_t_22 = __pyx_v_k;
45215 0 : __pyx_t_24 = __pyx_v_kk;
45216 0 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_retarr.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_retarr.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_retarr.diminfo[1].strides) = (__pyx_v_ret[((__pyx_v_k * __pyx_v_n) + __pyx_v_kk)]);
45217 : }
45218 : }
45219 :
45220 : /* "scipy/linalg/_decomp_interpolative.pyx":1315
45221 : * for kk in range(n):
45222 : * retarr[k, kk] = ret[k*n+kk]
45223 : * PyMem_Free(ret) # <<<<<<<<<<<<<<
45224 : *
45225 : * return krank, retarr
45226 : */
45227 0 : PyMem_Free(__pyx_v_ret);
45228 : }
45229 0 : if (PY_MAJOR_VERSION >= 3) {
45230 0 : __Pyx_XGIVEREF(__pyx_t_33);
45231 0 : __Pyx_XGIVEREF(__pyx_t_34);
45232 0 : __Pyx_XGIVEREF(__pyx_t_35);
45233 0 : __Pyx_ExceptionReset(__pyx_t_33, __pyx_t_34, __pyx_t_35);
45234 : }
45235 0 : __Pyx_XGIVEREF(__pyx_t_19);
45236 0 : __Pyx_XGIVEREF(__pyx_t_20);
45237 0 : __Pyx_XGIVEREF(__pyx_t_21);
45238 0 : __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
45239 0 : __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; __pyx_t_35 = 0;
45240 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_32;
45241 0 : goto __pyx_L1_error;
45242 0 : __pyx_L28_error:;
45243 0 : if (PY_MAJOR_VERSION >= 3) {
45244 0 : __Pyx_XGIVEREF(__pyx_t_33);
45245 0 : __Pyx_XGIVEREF(__pyx_t_34);
45246 0 : __Pyx_XGIVEREF(__pyx_t_35);
45247 0 : __Pyx_ExceptionReset(__pyx_t_33, __pyx_t_34, __pyx_t_35);
45248 : }
45249 0 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
45250 0 : __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
45251 0 : __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
45252 0 : __pyx_t_33 = 0; __pyx_t_34 = 0; __pyx_t_35 = 0;
45253 0 : goto __pyx_L1_error;
45254 : }
45255 4 : __pyx_L8:;
45256 : }
45257 :
45258 : /* "scipy/linalg/_decomp_interpolative.pyx":1317
45259 : * PyMem_Free(ret)
45260 : *
45261 : * return krank, retarr # <<<<<<<<<<<<<<
45262 : *
45263 : *
45264 : */
45265 4 : __Pyx_XDECREF(__pyx_r);
45266 4 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error)
45267 4 : __Pyx_GOTREF(__pyx_t_2);
45268 4 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1317, __pyx_L1_error)
45269 4 : __Pyx_GOTREF(__pyx_t_14);
45270 4 : __Pyx_GIVEREF(__pyx_t_2);
45271 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error);
45272 4 : __Pyx_INCREF((PyObject *)__pyx_v_retarr);
45273 4 : __Pyx_GIVEREF((PyObject *)__pyx_v_retarr);
45274 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_v_retarr))) __PYX_ERR(0, 1317, __pyx_L1_error);
45275 4 : __pyx_t_2 = 0;
45276 4 : __pyx_r = __pyx_t_14;
45277 4 : __pyx_t_14 = 0;
45278 4 : goto __pyx_L0;
45279 :
45280 : /* "scipy/linalg/_decomp_interpolative.pyx":1226
45281 : *
45282 : *
45283 : * def idz_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
45284 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
45285 : *
45286 : */
45287 :
45288 : /* function exit code */
45289 0 : __pyx_L1_error:;
45290 0 : __Pyx_XDECREF(__pyx_t_1);
45291 0 : __Pyx_XDECREF(__pyx_t_2);
45292 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
45293 0 : __Pyx_XDECREF(__pyx_t_13);
45294 0 : __Pyx_XDECREF(__pyx_t_14);
45295 0 : __Pyx_XDECREF(__pyx_t_15);
45296 0 : __Pyx_XDECREF(__pyx_t_16);
45297 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
45298 0 : __Pyx_PyThreadState_declare
45299 0 : __Pyx_PyThreadState_assign
45300 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
45301 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
45302 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
45303 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
45304 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_findrank", __pyx_clineno, __pyx_lineno, __pyx_filename);
45305 0 : __pyx_r = NULL;
45306 0 : goto __pyx_L2;
45307 4 : __pyx_L0:;
45308 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_retarr.rcbuffer->pybuffer);
45309 4 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
45310 4 : __pyx_L2:;
45311 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_tau, 1);
45312 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
45313 4 : __Pyx_XDECREF((PyObject *)__pyx_v_retarr);
45314 4 : __Pyx_XDECREF((PyObject *)__pyx_v_x);
45315 4 : __Pyx_XGIVEREF(__pyx_r);
45316 4 : __Pyx_RefNannyFinishContext();
45317 4 : return __pyx_r;
45318 : }
45319 :
45320 : /* "scipy/linalg/_decomp_interpolative.pyx":1320
45321 : *
45322 : *
45323 : * def idz_id2svd( # <<<<<<<<<<<<<<
45324 : * cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] cols,
45325 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
45326 : */
45327 :
45328 : /* Python wrapper */
45329 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_47idz_id2svd(PyObject *__pyx_self,
45330 : #if CYTHON_METH_FASTCALL
45331 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
45332 : #else
45333 : PyObject *__pyx_args, PyObject *__pyx_kwds
45334 : #endif
45335 : ); /*proto*/
45336 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_47idz_id2svd = {"idz_id2svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_47idz_id2svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
45337 3 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_47idz_id2svd(PyObject *__pyx_self,
45338 : #if CYTHON_METH_FASTCALL
45339 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
45340 : #else
45341 : PyObject *__pyx_args, PyObject *__pyx_kwds
45342 : #endif
45343 : ) {
45344 3 : PyArrayObject *__pyx_v_cols = 0;
45345 3 : PyArrayObject *__pyx_v_perms = 0;
45346 3 : PyArrayObject *__pyx_v_proj = 0;
45347 : #if !CYTHON_METH_FASTCALL
45348 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
45349 : #endif
45350 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
45351 3 : PyObject* values[3] = {0,0,0};
45352 3 : int __pyx_lineno = 0;
45353 3 : const char *__pyx_filename = NULL;
45354 3 : int __pyx_clineno = 0;
45355 3 : PyObject *__pyx_r = 0;
45356 : __Pyx_RefNannyDeclarations
45357 3 : __Pyx_RefNannySetupContext("idz_id2svd (wrapper)", 0);
45358 : #if !CYTHON_METH_FASTCALL
45359 : #if CYTHON_ASSUME_SAFE_MACROS
45360 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
45361 : #else
45362 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
45363 : #endif
45364 : #endif
45365 3 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
45366 : {
45367 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cols,&__pyx_n_s_perms,&__pyx_n_s_proj,0};
45368 3 : if (__pyx_kwds) {
45369 2 : Py_ssize_t kw_args;
45370 2 : switch (__pyx_nargs) {
45371 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
45372 0 : CYTHON_FALLTHROUGH;
45373 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
45374 0 : CYTHON_FALLTHROUGH;
45375 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
45376 2 : CYTHON_FALLTHROUGH;
45377 2 : case 0: break;
45378 0 : default: goto __pyx_L5_argtuple_error;
45379 : }
45380 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
45381 2 : switch (__pyx_nargs) {
45382 2 : case 0:
45383 2 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cols)) != 0)) {
45384 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
45385 2 : kw_args--;
45386 : }
45387 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1320, __pyx_L3_error)
45388 0 : else goto __pyx_L5_argtuple_error;
45389 2 : CYTHON_FALLTHROUGH;
45390 : case 1:
45391 2 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_perms)) != 0)) {
45392 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
45393 2 : kw_args--;
45394 : }
45395 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1320, __pyx_L3_error)
45396 : else {
45397 0 : __Pyx_RaiseArgtupleInvalid("idz_id2svd", 1, 3, 3, 1); __PYX_ERR(0, 1320, __pyx_L3_error)
45398 : }
45399 2 : CYTHON_FALLTHROUGH;
45400 : case 2:
45401 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proj)) != 0)) {
45402 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
45403 2 : kw_args--;
45404 : }
45405 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1320, __pyx_L3_error)
45406 : else {
45407 0 : __Pyx_RaiseArgtupleInvalid("idz_id2svd", 1, 3, 3, 2); __PYX_ERR(0, 1320, __pyx_L3_error)
45408 : }
45409 : }
45410 2 : if (unlikely(kw_args > 0)) {
45411 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
45412 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_id2svd") < 0)) __PYX_ERR(0, 1320, __pyx_L3_error)
45413 : }
45414 1 : } else if (unlikely(__pyx_nargs != 3)) {
45415 0 : goto __pyx_L5_argtuple_error;
45416 : } else {
45417 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
45418 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
45419 1 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
45420 : }
45421 3 : __pyx_v_cols = ((PyArrayObject *)values[0]);
45422 3 : __pyx_v_perms = ((PyArrayObject *)values[1]);
45423 3 : __pyx_v_proj = ((PyArrayObject *)values[2]);
45424 : }
45425 3 : goto __pyx_L6_skip;
45426 0 : __pyx_L5_argtuple_error:;
45427 0 : __Pyx_RaiseArgtupleInvalid("idz_id2svd", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1320, __pyx_L3_error)
45428 3 : __pyx_L6_skip:;
45429 3 : goto __pyx_L4_argument_unpacking_done;
45430 0 : __pyx_L3_error:;
45431 : {
45432 0 : Py_ssize_t __pyx_temp;
45433 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
45434 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
45435 : }
45436 : }
45437 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_id2svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
45438 0 : __Pyx_RefNannyFinishContext();
45439 0 : return NULL;
45440 3 : __pyx_L4_argument_unpacking_done:;
45441 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cols), __pyx_ptype_5numpy_ndarray, 1, "cols", 0))) __PYX_ERR(0, 1321, __pyx_L1_error)
45442 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perms), __pyx_ptype_5numpy_ndarray, 1, "perms", 0))) __PYX_ERR(0, 1322, __pyx_L1_error)
45443 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_proj), __pyx_ptype_5numpy_ndarray, 1, "proj", 0))) __PYX_ERR(0, 1323, __pyx_L1_error)
45444 3 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_46idz_id2svd(__pyx_self, __pyx_v_cols, __pyx_v_perms, __pyx_v_proj);
45445 :
45446 : /* function exit code */
45447 3 : goto __pyx_L0;
45448 : __pyx_L1_error:;
45449 : __pyx_r = NULL;
45450 3 : __pyx_L0:;
45451 : {
45452 3 : Py_ssize_t __pyx_temp;
45453 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
45454 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
45455 : }
45456 : }
45457 : __Pyx_RefNannyFinishContext();
45458 : return __pyx_r;
45459 : }
45460 :
45461 3 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_46idz_id2svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_cols, PyArrayObject *__pyx_v_perms, PyArrayObject *__pyx_v_proj) {
45462 3 : int __pyx_v_m;
45463 3 : int __pyx_v_krank;
45464 3 : int __pyx_v_n;
45465 3 : int __pyx_v_info;
45466 3 : int __pyx_v_ci;
45467 3 : PyArrayObject *__pyx_v_C = 0;
45468 3 : PyArrayObject *__pyx_v_tau1 = 0;
45469 3 : PyArrayObject *__pyx_v_tau2 = 0;
45470 3 : PyArrayObject *__pyx_v_UU = 0;
45471 3 : PyArrayObject *__pyx_v_S = 0;
45472 3 : PyArrayObject *__pyx_v_V = 0;
45473 3 : PyArrayObject *__pyx_v_VV = 0;
45474 3 : PyArrayObject *__pyx_v_inds1 = 0;
45475 3 : PyArrayObject *__pyx_v_inds2 = 0;
45476 3 : PyArrayObject *__pyx_v_p = 0;
45477 3 : PyObject *__pyx_v_r = NULL;
45478 3 : PyObject *__pyx_v_t = NULL;
45479 3 : PyObject *__pyx_v_r2 = NULL;
45480 3 : PyObject *__pyx_v_r3 = NULL;
45481 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
45482 3 : __Pyx_Buffer __pyx_pybuffer_C;
45483 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
45484 3 : __Pyx_Buffer __pyx_pybuffer_S;
45485 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
45486 3 : __Pyx_Buffer __pyx_pybuffer_UU;
45487 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
45488 3 : __Pyx_Buffer __pyx_pybuffer_V;
45489 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
45490 3 : __Pyx_Buffer __pyx_pybuffer_VV;
45491 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_cols;
45492 3 : __Pyx_Buffer __pyx_pybuffer_cols;
45493 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
45494 3 : __Pyx_Buffer __pyx_pybuffer_inds1;
45495 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
45496 3 : __Pyx_Buffer __pyx_pybuffer_inds2;
45497 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
45498 3 : __Pyx_Buffer __pyx_pybuffer_p;
45499 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
45500 3 : __Pyx_Buffer __pyx_pybuffer_perms;
45501 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
45502 3 : __Pyx_Buffer __pyx_pybuffer_proj;
45503 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
45504 3 : __Pyx_Buffer __pyx_pybuffer_tau1;
45505 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
45506 3 : __Pyx_Buffer __pyx_pybuffer_tau2;
45507 3 : PyObject *__pyx_r = NULL;
45508 : __Pyx_RefNannyDeclarations
45509 3 : int __pyx_t_1;
45510 3 : npy_intp __pyx_t_2[2];
45511 3 : PyObject *__pyx_t_3 = NULL;
45512 3 : PyArrayObject *__pyx_t_4 = NULL;
45513 3 : int __pyx_t_5;
45514 3 : PyObject *__pyx_t_6 = NULL;
45515 3 : PyObject *__pyx_t_7 = NULL;
45516 3 : PyObject *__pyx_t_8 = NULL;
45517 3 : npy_intp __pyx_t_9[2];
45518 3 : PyArrayObject *__pyx_t_10 = NULL;
45519 3 : npy_intp __pyx_t_11[2];
45520 3 : PyArrayObject *__pyx_t_12 = NULL;
45521 3 : int __pyx_t_13;
45522 3 : int __pyx_t_14;
45523 3 : Py_ssize_t __pyx_t_15;
45524 3 : Py_ssize_t __pyx_t_16;
45525 3 : __pyx_t_5numpy_int64_t __pyx_t_17;
45526 3 : PyObject *__pyx_t_18 = NULL;
45527 3 : PyObject *__pyx_t_19 = NULL;
45528 3 : PyObject *__pyx_t_20 = NULL;
45529 3 : unsigned int __pyx_t_21;
45530 3 : PyObject *(*__pyx_t_22)(PyObject *);
45531 3 : PyArrayObject *__pyx_t_23 = NULL;
45532 3 : PyArrayObject *__pyx_t_24 = NULL;
45533 3 : PyArrayObject *__pyx_t_25 = NULL;
45534 3 : PyArrayObject *__pyx_t_26 = NULL;
45535 3 : PyObject *__pyx_t_27 = NULL;
45536 3 : PyObject *__pyx_t_28 = NULL;
45537 3 : PyObject *__pyx_t_29 = NULL;
45538 3 : PyArrayObject *__pyx_t_30 = NULL;
45539 3 : PyArrayObject *__pyx_t_31 = NULL;
45540 3 : PyArrayObject *__pyx_t_32 = NULL;
45541 3 : Py_ssize_t __pyx_t_33;
45542 3 : Py_ssize_t __pyx_t_34;
45543 3 : Py_ssize_t __pyx_t_35;
45544 3 : Py_ssize_t __pyx_t_36;
45545 3 : Py_ssize_t __pyx_t_37;
45546 3 : int __pyx_lineno = 0;
45547 3 : const char *__pyx_filename = NULL;
45548 3 : int __pyx_clineno = 0;
45549 3 : __Pyx_RefNannySetupContext("idz_id2svd", 1);
45550 3 : __pyx_pybuffer_C.pybuffer.buf = NULL;
45551 3 : __pyx_pybuffer_C.refcount = 0;
45552 3 : __pyx_pybuffernd_C.data = NULL;
45553 3 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
45554 3 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
45555 3 : __pyx_pybuffer_tau1.refcount = 0;
45556 3 : __pyx_pybuffernd_tau1.data = NULL;
45557 3 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
45558 3 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
45559 3 : __pyx_pybuffer_tau2.refcount = 0;
45560 3 : __pyx_pybuffernd_tau2.data = NULL;
45561 3 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
45562 3 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
45563 3 : __pyx_pybuffer_UU.refcount = 0;
45564 3 : __pyx_pybuffernd_UU.data = NULL;
45565 3 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
45566 3 : __pyx_pybuffer_S.pybuffer.buf = NULL;
45567 3 : __pyx_pybuffer_S.refcount = 0;
45568 3 : __pyx_pybuffernd_S.data = NULL;
45569 3 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
45570 3 : __pyx_pybuffer_V.pybuffer.buf = NULL;
45571 3 : __pyx_pybuffer_V.refcount = 0;
45572 3 : __pyx_pybuffernd_V.data = NULL;
45573 3 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
45574 3 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
45575 3 : __pyx_pybuffer_VV.refcount = 0;
45576 3 : __pyx_pybuffernd_VV.data = NULL;
45577 3 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
45578 3 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
45579 3 : __pyx_pybuffer_inds1.refcount = 0;
45580 3 : __pyx_pybuffernd_inds1.data = NULL;
45581 3 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
45582 3 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
45583 3 : __pyx_pybuffer_inds2.refcount = 0;
45584 3 : __pyx_pybuffernd_inds2.data = NULL;
45585 3 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
45586 3 : __pyx_pybuffer_p.pybuffer.buf = NULL;
45587 3 : __pyx_pybuffer_p.refcount = 0;
45588 3 : __pyx_pybuffernd_p.data = NULL;
45589 3 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
45590 3 : __pyx_pybuffer_cols.pybuffer.buf = NULL;
45591 3 : __pyx_pybuffer_cols.refcount = 0;
45592 3 : __pyx_pybuffernd_cols.data = NULL;
45593 3 : __pyx_pybuffernd_cols.rcbuffer = &__pyx_pybuffer_cols;
45594 3 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
45595 3 : __pyx_pybuffer_perms.refcount = 0;
45596 3 : __pyx_pybuffernd_perms.data = NULL;
45597 3 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
45598 3 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
45599 3 : __pyx_pybuffer_proj.refcount = 0;
45600 3 : __pyx_pybuffernd_proj.data = NULL;
45601 3 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
45602 : {
45603 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45604 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cols.rcbuffer->pybuffer, (PyObject*)__pyx_v_cols, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1320, __pyx_L1_error)
45605 : }
45606 3 : __pyx_pybuffernd_cols.diminfo[0].strides = __pyx_pybuffernd_cols.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cols.diminfo[0].shape = __pyx_pybuffernd_cols.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_cols.diminfo[1].strides = __pyx_pybuffernd_cols.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_cols.diminfo[1].shape = __pyx_pybuffernd_cols.rcbuffer->pybuffer.shape[1];
45607 : {
45608 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45609 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1320, __pyx_L1_error)
45610 : }
45611 3 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
45612 : {
45613 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45614 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1320, __pyx_L1_error)
45615 : }
45616 3 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
45617 :
45618 : /* "scipy/linalg/_decomp_interpolative.pyx":1325
45619 : * cnp.ndarray[cnp.complex128_t, ndim=2] proj,
45620 : * ):
45621 : * cdef int m = cols.shape[0], krank = cols.shape[1] # <<<<<<<<<<<<<<
45622 : * cdef int n = proj.shape[1] + krank, info, ci
45623 : * cdef cnp.ndarray[cnp.complex128_t, mode='fortran', ndim=2] C
45624 : */
45625 3 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_cols))[0]);
45626 3 : __pyx_v_krank = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_cols))[1]);
45627 :
45628 : /* "scipy/linalg/_decomp_interpolative.pyx":1326
45629 : * ):
45630 : * cdef int m = cols.shape[0], krank = cols.shape[1]
45631 : * cdef int n = proj.shape[1] + krank, info, ci # <<<<<<<<<<<<<<
45632 : * cdef cnp.ndarray[cnp.complex128_t, mode='fortran', ndim=2] C
45633 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] tau1
45634 : */
45635 3 : __pyx_v_n = ((__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_proj))[1]) + __pyx_v_krank);
45636 :
45637 : /* "scipy/linalg/_decomp_interpolative.pyx":1338
45638 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] p
45639 : *
45640 : * if krank > 0: # <<<<<<<<<<<<<<
45641 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
45642 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
45643 : */
45644 3 : __pyx_t_1 = (__pyx_v_krank > 0);
45645 3 : if (__pyx_t_1) {
45646 :
45647 : /* "scipy/linalg/_decomp_interpolative.pyx":1339
45648 : *
45649 : * if krank > 0:
45650 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
45651 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
45652 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45653 : */
45654 3 : __pyx_t_2[0] = __pyx_v_m;
45655 3 : __pyx_t_2[1] = __pyx_v_krank;
45656 3 : __pyx_t_3 = PyArray_ZEROS(2, __pyx_t_2, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1339, __pyx_L1_error)
45657 3 : __Pyx_GOTREF(__pyx_t_3);
45658 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1339, __pyx_L1_error)
45659 3 : __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
45660 : {
45661 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45662 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
45663 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
45664 3 : if (unlikely(__pyx_t_5 < 0)) {
45665 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
45666 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
45667 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
45668 : __Pyx_RaiseBufferFallbackError();
45669 : } else {
45670 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
45671 : }
45672 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
45673 : }
45674 3 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
45675 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1339, __pyx_L1_error)
45676 : }
45677 3 : __pyx_t_4 = 0;
45678 3 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_3);
45679 3 : __pyx_t_3 = 0;
45680 :
45681 : /* "scipy/linalg/_decomp_interpolative.pyx":1340
45682 : * if krank > 0:
45683 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
45684 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
45685 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
45686 : *
45687 : */
45688 3 : __pyx_t_9[0] = __pyx_v_n;
45689 3 : __pyx_t_9[1] = __pyx_v_krank;
45690 3 : __pyx_t_3 = PyArray_ZEROS(2, __pyx_t_9, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error)
45691 3 : __Pyx_GOTREF(__pyx_t_3);
45692 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1340, __pyx_L1_error)
45693 3 : __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
45694 : {
45695 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45696 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
45697 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
45698 3 : if (unlikely(__pyx_t_5 < 0)) {
45699 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
45700 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
45701 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
45702 : __Pyx_RaiseBufferFallbackError();
45703 : } else {
45704 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
45705 : }
45706 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
45707 : }
45708 3 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
45709 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1340, __pyx_L1_error)
45710 : }
45711 3 : __pyx_t_10 = 0;
45712 3 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_3);
45713 3 : __pyx_t_3 = 0;
45714 :
45715 : /* "scipy/linalg/_decomp_interpolative.pyx":1341
45716 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
45717 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
45718 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
45719 : *
45720 : * # idd_reconint
45721 : */
45722 3 : __pyx_t_11[0] = __pyx_v_krank;
45723 3 : __pyx_t_11[1] = __pyx_v_n;
45724 3 : __pyx_t_3 = PyArray_ZEROS(2, __pyx_t_11, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
45725 3 : __Pyx_GOTREF(__pyx_t_3);
45726 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1341, __pyx_L1_error)
45727 3 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
45728 : {
45729 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45730 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
45731 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
45732 3 : if (unlikely(__pyx_t_5 < 0)) {
45733 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
45734 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
45735 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
45736 : __Pyx_RaiseBufferFallbackError();
45737 : } else {
45738 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
45739 : }
45740 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
45741 : }
45742 3 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
45743 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1341, __pyx_L1_error)
45744 : }
45745 3 : __pyx_t_12 = 0;
45746 3 : __pyx_v_p = ((PyArrayObject *)__pyx_t_3);
45747 3 : __pyx_t_3 = 0;
45748 :
45749 : /* "scipy/linalg/_decomp_interpolative.pyx":1344
45750 : *
45751 : * # idd_reconint
45752 : * for ci in range(krank): # <<<<<<<<<<<<<<
45753 : * p[ci, perms[ci]] = 1.0
45754 : *
45755 : */
45756 3 : __pyx_t_5 = __pyx_v_krank;
45757 3 : __pyx_t_13 = __pyx_t_5;
45758 60 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
45759 57 : __pyx_v_ci = __pyx_t_14;
45760 :
45761 : /* "scipy/linalg/_decomp_interpolative.pyx":1345
45762 : * # idd_reconint
45763 : * for ci in range(krank):
45764 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
45765 : *
45766 : * p[:, perms[krank:]] = proj[:, :]
45767 : */
45768 57 : __pyx_t_15 = __pyx_v_ci;
45769 57 : __pyx_t_16 = __pyx_v_ci;
45770 57 : __pyx_t_17 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_perms.diminfo[0].strides));
45771 57 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_p.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1.0, 0);
45772 : }
45773 :
45774 : /* "scipy/linalg/_decomp_interpolative.pyx":1347
45775 : * p[ci, perms[ci]] = 1.0
45776 : *
45777 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
45778 : * inds1, tau1 = idzr_qrpiv(cols, krank)
45779 : * # idz_rinqr and idz_rearr
45780 : */
45781 3 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error)
45782 3 : __Pyx_GOTREF(__pyx_t_3);
45783 3 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1347, __pyx_L1_error)
45784 3 : __Pyx_GOTREF(__pyx_t_18);
45785 3 : __pyx_t_19 = PySlice_New(__pyx_t_18, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1347, __pyx_L1_error)
45786 3 : __Pyx_GOTREF(__pyx_t_19);
45787 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
45788 3 : __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1347, __pyx_L1_error)
45789 3 : __Pyx_GOTREF(__pyx_t_18);
45790 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
45791 3 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1347, __pyx_L1_error)
45792 3 : __Pyx_GOTREF(__pyx_t_19);
45793 3 : __Pyx_INCREF(__pyx_slice__5);
45794 3 : __Pyx_GIVEREF(__pyx_slice__5);
45795 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__5)) __PYX_ERR(0, 1347, __pyx_L1_error);
45796 3 : __Pyx_GIVEREF(__pyx_t_18);
45797 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18)) __PYX_ERR(0, 1347, __pyx_L1_error);
45798 3 : __pyx_t_18 = 0;
45799 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_19, __pyx_t_3) < 0))) __PYX_ERR(0, 1347, __pyx_L1_error)
45800 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
45801 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
45802 :
45803 : /* "scipy/linalg/_decomp_interpolative.pyx":1348
45804 : *
45805 : * p[:, perms[krank:]] = proj[:, :]
45806 : * inds1, tau1 = idzr_qrpiv(cols, krank) # <<<<<<<<<<<<<<
45807 : * # idz_rinqr and idz_rearr
45808 : * r = np.triu(cols[:krank, :])
45809 : */
45810 3 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1348, __pyx_L1_error)
45811 3 : __Pyx_GOTREF(__pyx_t_19);
45812 3 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1348, __pyx_L1_error)
45813 3 : __Pyx_GOTREF(__pyx_t_18);
45814 3 : __pyx_t_20 = NULL;
45815 3 : __pyx_t_21 = 0;
45816 : #if CYTHON_UNPACK_METHODS
45817 3 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
45818 0 : __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
45819 0 : if (likely(__pyx_t_20)) {
45820 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
45821 0 : __Pyx_INCREF(__pyx_t_20);
45822 0 : __Pyx_INCREF(function);
45823 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
45824 : __pyx_t_21 = 1;
45825 : }
45826 : }
45827 : #endif
45828 : {
45829 3 : PyObject *__pyx_callargs[3] = {__pyx_t_20, ((PyObject *)__pyx_v_cols), __pyx_t_18};
45830 3 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 2+__pyx_t_21);
45831 3 : __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
45832 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
45833 3 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1348, __pyx_L1_error)
45834 3 : __Pyx_GOTREF(__pyx_t_3);
45835 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
45836 : }
45837 3 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
45838 3 : PyObject* sequence = __pyx_t_3;
45839 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
45840 3 : if (unlikely(size != 2)) {
45841 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
45842 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
45843 0 : __PYX_ERR(0, 1348, __pyx_L1_error)
45844 : }
45845 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45846 3 : if (likely(PyTuple_CheckExact(sequence))) {
45847 3 : __pyx_t_19 = PyTuple_GET_ITEM(sequence, 0);
45848 3 : __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
45849 : } else {
45850 0 : __pyx_t_19 = PyList_GET_ITEM(sequence, 0);
45851 0 : __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
45852 : }
45853 3 : __Pyx_INCREF(__pyx_t_19);
45854 3 : __Pyx_INCREF(__pyx_t_18);
45855 : #else
45856 : __pyx_t_19 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1348, __pyx_L1_error)
45857 : __Pyx_GOTREF(__pyx_t_19);
45858 : __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1348, __pyx_L1_error)
45859 : __Pyx_GOTREF(__pyx_t_18);
45860 : #endif
45861 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
45862 : } else {
45863 0 : Py_ssize_t index = -1;
45864 0 : __pyx_t_20 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1348, __pyx_L1_error)
45865 0 : __Pyx_GOTREF(__pyx_t_20);
45866 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
45867 0 : __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_20);
45868 0 : index = 0; __pyx_t_19 = __pyx_t_22(__pyx_t_20); if (unlikely(!__pyx_t_19)) goto __pyx_L6_unpacking_failed;
45869 0 : __Pyx_GOTREF(__pyx_t_19);
45870 0 : index = 1; __pyx_t_18 = __pyx_t_22(__pyx_t_20); if (unlikely(!__pyx_t_18)) goto __pyx_L6_unpacking_failed;
45871 0 : __Pyx_GOTREF(__pyx_t_18);
45872 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_20), 2) < 0) __PYX_ERR(0, 1348, __pyx_L1_error)
45873 0 : __pyx_t_22 = NULL;
45874 0 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
45875 0 : goto __pyx_L7_unpacking_done;
45876 0 : __pyx_L6_unpacking_failed:;
45877 0 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
45878 0 : __pyx_t_22 = NULL;
45879 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
45880 0 : __PYX_ERR(0, 1348, __pyx_L1_error)
45881 0 : __pyx_L7_unpacking_done:;
45882 : }
45883 3 : if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1348, __pyx_L1_error)
45884 3 : if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1348, __pyx_L1_error)
45885 3 : __pyx_t_23 = ((PyArrayObject *)__pyx_t_19);
45886 : {
45887 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45888 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
45889 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
45890 3 : if (unlikely(__pyx_t_5 < 0)) {
45891 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
45892 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
45893 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
45894 : __Pyx_RaiseBufferFallbackError();
45895 : } else {
45896 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
45897 : }
45898 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
45899 : }
45900 3 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
45901 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error)
45902 : }
45903 3 : __pyx_t_23 = 0;
45904 3 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_19);
45905 3 : __pyx_t_19 = 0;
45906 3 : __pyx_t_24 = ((PyArrayObject *)__pyx_t_18);
45907 : {
45908 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
45909 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
45910 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
45911 3 : if (unlikely(__pyx_t_5 < 0)) {
45912 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
45913 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
45914 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
45915 : __Pyx_RaiseBufferFallbackError();
45916 : } else {
45917 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
45918 : }
45919 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
45920 : }
45921 3 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
45922 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error)
45923 : }
45924 3 : __pyx_t_24 = 0;
45925 3 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_18);
45926 3 : __pyx_t_18 = 0;
45927 :
45928 : /* "scipy/linalg/_decomp_interpolative.pyx":1350
45929 : * inds1, tau1 = idzr_qrpiv(cols, krank)
45930 : * # idz_rinqr and idz_rearr
45931 : * r = np.triu(cols[:krank, :]) # <<<<<<<<<<<<<<
45932 : * for ci in range(krank-1, -1, -1):
45933 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
45934 : */
45935 3 : __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1350, __pyx_L1_error)
45936 3 : __Pyx_GOTREF(__pyx_t_18);
45937 3 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_triu); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1350, __pyx_L1_error)
45938 3 : __Pyx_GOTREF(__pyx_t_19);
45939 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
45940 3 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1350, __pyx_L1_error)
45941 3 : __Pyx_GOTREF(__pyx_t_18);
45942 3 : __pyx_t_20 = PySlice_New(Py_None, __pyx_t_18, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1350, __pyx_L1_error)
45943 3 : __Pyx_GOTREF(__pyx_t_20);
45944 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
45945 3 : __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1350, __pyx_L1_error)
45946 3 : __Pyx_GOTREF(__pyx_t_18);
45947 3 : __Pyx_GIVEREF(__pyx_t_20);
45948 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20)) __PYX_ERR(0, 1350, __pyx_L1_error);
45949 3 : __Pyx_INCREF(__pyx_slice__5);
45950 3 : __Pyx_GIVEREF(__pyx_slice__5);
45951 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_slice__5)) __PYX_ERR(0, 1350, __pyx_L1_error);
45952 3 : __pyx_t_20 = 0;
45953 3 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_cols), __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1350, __pyx_L1_error)
45954 3 : __Pyx_GOTREF(__pyx_t_20);
45955 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
45956 3 : __pyx_t_18 = NULL;
45957 3 : __pyx_t_21 = 0;
45958 : #if CYTHON_UNPACK_METHODS
45959 3 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
45960 0 : __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
45961 0 : if (likely(__pyx_t_18)) {
45962 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
45963 0 : __Pyx_INCREF(__pyx_t_18);
45964 0 : __Pyx_INCREF(function);
45965 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
45966 : __pyx_t_21 = 1;
45967 : }
45968 : }
45969 : #endif
45970 : {
45971 3 : PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_20};
45972 3 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 1+__pyx_t_21);
45973 3 : __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
45974 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
45975 3 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L1_error)
45976 3 : __Pyx_GOTREF(__pyx_t_3);
45977 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
45978 : }
45979 3 : __pyx_v_r = __pyx_t_3;
45980 3 : __pyx_t_3 = 0;
45981 :
45982 : /* "scipy/linalg/_decomp_interpolative.pyx":1351
45983 : * # idz_rinqr and idz_rearr
45984 : * r = np.triu(cols[:krank, :])
45985 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
45986 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
45987 : *
45988 : */
45989 60 : for (__pyx_t_5 = (__pyx_v_krank - 1); __pyx_t_5 > -1; __pyx_t_5-=1) {
45990 57 : __pyx_v_ci = __pyx_t_5;
45991 :
45992 : /* "scipy/linalg/_decomp_interpolative.pyx":1352
45993 : * r = np.triu(cols[:krank, :])
45994 : * for ci in range(krank-1, -1, -1):
45995 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
45996 : *
45997 : * t = p.T.conj().copy()
45998 : */
45999 57 : __pyx_t_15 = __pyx_v_ci;
46000 57 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
46001 57 : __Pyx_GOTREF(__pyx_t_3);
46002 57 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1352, __pyx_L1_error)
46003 57 : __Pyx_GOTREF(__pyx_t_19);
46004 57 : __pyx_t_20 = PyList_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1352, __pyx_L1_error)
46005 57 : __Pyx_GOTREF(__pyx_t_20);
46006 57 : __Pyx_GIVEREF(__pyx_t_3);
46007 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error);
46008 57 : __Pyx_GIVEREF(__pyx_t_19);
46009 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_20, 1, __pyx_t_19)) __PYX_ERR(0, 1352, __pyx_L1_error);
46010 57 : __pyx_t_3 = 0;
46011 57 : __pyx_t_19 = 0;
46012 57 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1352, __pyx_L1_error)
46013 57 : __Pyx_GOTREF(__pyx_t_19);
46014 57 : __Pyx_INCREF(__pyx_slice__5);
46015 57 : __Pyx_GIVEREF(__pyx_slice__5);
46016 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__5)) __PYX_ERR(0, 1352, __pyx_L1_error);
46017 57 : __Pyx_GIVEREF(__pyx_t_20);
46018 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_20)) __PYX_ERR(0, 1352, __pyx_L1_error);
46019 57 : __pyx_t_20 = 0;
46020 57 : __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1352, __pyx_L1_error)
46021 57 : __Pyx_GOTREF(__pyx_t_20);
46022 57 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46023 57 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1352, __pyx_L1_error)
46024 57 : __Pyx_GOTREF(__pyx_t_19);
46025 57 : __pyx_t_15 = __pyx_v_ci;
46026 57 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
46027 57 : __Pyx_GOTREF(__pyx_t_3);
46028 57 : __pyx_t_18 = PyList_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1352, __pyx_L1_error)
46029 57 : __Pyx_GOTREF(__pyx_t_18);
46030 57 : __Pyx_GIVEREF(__pyx_t_19);
46031 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_19)) __PYX_ERR(0, 1352, __pyx_L1_error);
46032 57 : __Pyx_GIVEREF(__pyx_t_3);
46033 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 1, __pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error);
46034 57 : __pyx_t_19 = 0;
46035 57 : __pyx_t_3 = 0;
46036 57 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
46037 57 : __Pyx_GOTREF(__pyx_t_3);
46038 57 : __Pyx_INCREF(__pyx_slice__5);
46039 57 : __Pyx_GIVEREF(__pyx_slice__5);
46040 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 1352, __pyx_L1_error);
46041 57 : __Pyx_GIVEREF(__pyx_t_18);
46042 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_18)) __PYX_ERR(0, 1352, __pyx_L1_error);
46043 57 : __pyx_t_18 = 0;
46044 57 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_3, __pyx_t_20) < 0))) __PYX_ERR(0, 1352, __pyx_L1_error)
46045 57 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46046 114 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46047 : }
46048 :
46049 : /* "scipy/linalg/_decomp_interpolative.pyx":1354
46050 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
46051 : *
46052 : * t = p.T.conj().copy() # <<<<<<<<<<<<<<
46053 : * inds2, tau2 = idzr_qrpiv(t, krank)
46054 : * r2 = np.triu(t[:krank, :])
46055 : */
46056 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1354, __pyx_L1_error)
46057 3 : __Pyx_GOTREF(__pyx_t_18);
46058 3 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_conj); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1354, __pyx_L1_error)
46059 3 : __Pyx_GOTREF(__pyx_t_19);
46060 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46061 3 : __pyx_t_18 = NULL;
46062 3 : __pyx_t_21 = 0;
46063 : #if CYTHON_UNPACK_METHODS
46064 3 : if (likely(PyMethod_Check(__pyx_t_19))) {
46065 0 : __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
46066 0 : if (likely(__pyx_t_18)) {
46067 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
46068 0 : __Pyx_INCREF(__pyx_t_18);
46069 0 : __Pyx_INCREF(function);
46070 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
46071 : __pyx_t_21 = 1;
46072 : }
46073 : }
46074 : #endif
46075 : {
46076 3 : PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL};
46077 3 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46078 3 : __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
46079 3 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
46080 3 : __Pyx_GOTREF(__pyx_t_3);
46081 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46082 : }
46083 3 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1354, __pyx_L1_error)
46084 3 : __Pyx_GOTREF(__pyx_t_19);
46085 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46086 3 : __pyx_t_3 = NULL;
46087 3 : __pyx_t_21 = 0;
46088 : #if CYTHON_UNPACK_METHODS
46089 3 : if (likely(PyMethod_Check(__pyx_t_19))) {
46090 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_19);
46091 0 : if (likely(__pyx_t_3)) {
46092 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
46093 0 : __Pyx_INCREF(__pyx_t_3);
46094 0 : __Pyx_INCREF(function);
46095 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
46096 : __pyx_t_21 = 1;
46097 : }
46098 : }
46099 : #endif
46100 : {
46101 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
46102 3 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46103 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
46104 3 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1354, __pyx_L1_error)
46105 3 : __Pyx_GOTREF(__pyx_t_20);
46106 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46107 : }
46108 3 : __pyx_v_t = __pyx_t_20;
46109 3 : __pyx_t_20 = 0;
46110 :
46111 : /* "scipy/linalg/_decomp_interpolative.pyx":1355
46112 : *
46113 : * t = p.T.conj().copy()
46114 : * inds2, tau2 = idzr_qrpiv(t, krank) # <<<<<<<<<<<<<<
46115 : * r2 = np.triu(t[:krank, :])
46116 : * for ci in range(krank-1, -1, -1):
46117 : */
46118 3 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1355, __pyx_L1_error)
46119 3 : __Pyx_GOTREF(__pyx_t_19);
46120 3 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __pyx_L1_error)
46121 3 : __Pyx_GOTREF(__pyx_t_3);
46122 3 : __pyx_t_18 = NULL;
46123 3 : __pyx_t_21 = 0;
46124 : #if CYTHON_UNPACK_METHODS
46125 3 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
46126 0 : __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19);
46127 0 : if (likely(__pyx_t_18)) {
46128 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
46129 0 : __Pyx_INCREF(__pyx_t_18);
46130 0 : __Pyx_INCREF(function);
46131 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
46132 : __pyx_t_21 = 1;
46133 : }
46134 : }
46135 : #endif
46136 : {
46137 3 : PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_v_t, __pyx_t_3};
46138 3 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 2+__pyx_t_21);
46139 3 : __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
46140 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46141 3 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1355, __pyx_L1_error)
46142 3 : __Pyx_GOTREF(__pyx_t_20);
46143 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46144 : }
46145 3 : if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
46146 3 : PyObject* sequence = __pyx_t_20;
46147 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
46148 3 : if (unlikely(size != 2)) {
46149 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
46150 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
46151 0 : __PYX_ERR(0, 1355, __pyx_L1_error)
46152 : }
46153 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46154 3 : if (likely(PyTuple_CheckExact(sequence))) {
46155 3 : __pyx_t_19 = PyTuple_GET_ITEM(sequence, 0);
46156 3 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
46157 : } else {
46158 0 : __pyx_t_19 = PyList_GET_ITEM(sequence, 0);
46159 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
46160 : }
46161 3 : __Pyx_INCREF(__pyx_t_19);
46162 3 : __Pyx_INCREF(__pyx_t_3);
46163 : #else
46164 : __pyx_t_19 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1355, __pyx_L1_error)
46165 : __Pyx_GOTREF(__pyx_t_19);
46166 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1355, __pyx_L1_error)
46167 : __Pyx_GOTREF(__pyx_t_3);
46168 : #endif
46169 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46170 : } else {
46171 0 : Py_ssize_t index = -1;
46172 0 : __pyx_t_18 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1355, __pyx_L1_error)
46173 0 : __Pyx_GOTREF(__pyx_t_18);
46174 0 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46175 0 : __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_18);
46176 0 : index = 0; __pyx_t_19 = __pyx_t_22(__pyx_t_18); if (unlikely(!__pyx_t_19)) goto __pyx_L10_unpacking_failed;
46177 0 : __Pyx_GOTREF(__pyx_t_19);
46178 0 : index = 1; __pyx_t_3 = __pyx_t_22(__pyx_t_18); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
46179 0 : __Pyx_GOTREF(__pyx_t_3);
46180 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_18), 2) < 0) __PYX_ERR(0, 1355, __pyx_L1_error)
46181 0 : __pyx_t_22 = NULL;
46182 0 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46183 0 : goto __pyx_L11_unpacking_done;
46184 0 : __pyx_L10_unpacking_failed:;
46185 0 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46186 0 : __pyx_t_22 = NULL;
46187 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
46188 0 : __PYX_ERR(0, 1355, __pyx_L1_error)
46189 0 : __pyx_L11_unpacking_done:;
46190 : }
46191 3 : if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1355, __pyx_L1_error)
46192 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1355, __pyx_L1_error)
46193 3 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_19);
46194 : {
46195 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46196 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
46197 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
46198 3 : if (unlikely(__pyx_t_5 < 0)) {
46199 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
46200 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
46201 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
46202 : __Pyx_RaiseBufferFallbackError();
46203 : } else {
46204 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
46205 : }
46206 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
46207 : }
46208 3 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
46209 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1355, __pyx_L1_error)
46210 : }
46211 3 : __pyx_t_25 = 0;
46212 3 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_19);
46213 3 : __pyx_t_19 = 0;
46214 3 : __pyx_t_26 = ((PyArrayObject *)__pyx_t_3);
46215 : {
46216 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46217 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
46218 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
46219 3 : if (unlikely(__pyx_t_5 < 0)) {
46220 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
46221 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
46222 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
46223 : __Pyx_RaiseBufferFallbackError();
46224 : } else {
46225 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
46226 : }
46227 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
46228 : }
46229 3 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
46230 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1355, __pyx_L1_error)
46231 : }
46232 3 : __pyx_t_26 = 0;
46233 3 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_3);
46234 3 : __pyx_t_3 = 0;
46235 :
46236 : /* "scipy/linalg/_decomp_interpolative.pyx":1356
46237 : * t = p.T.conj().copy()
46238 : * inds2, tau2 = idzr_qrpiv(t, krank)
46239 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
46240 : * for ci in range(krank-1, -1, -1):
46241 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
46242 : */
46243 3 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
46244 3 : __Pyx_GOTREF(__pyx_t_3);
46245 3 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_triu); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1356, __pyx_L1_error)
46246 3 : __Pyx_GOTREF(__pyx_t_19);
46247 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46248 3 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
46249 3 : __Pyx_GOTREF(__pyx_t_3);
46250 3 : __pyx_t_18 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1356, __pyx_L1_error)
46251 3 : __Pyx_GOTREF(__pyx_t_18);
46252 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46253 3 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1356, __pyx_L1_error)
46254 3 : __Pyx_GOTREF(__pyx_t_3);
46255 3 : __Pyx_GIVEREF(__pyx_t_18);
46256 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_18)) __PYX_ERR(0, 1356, __pyx_L1_error);
46257 3 : __Pyx_INCREF(__pyx_slice__5);
46258 3 : __Pyx_GIVEREF(__pyx_slice__5);
46259 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__5)) __PYX_ERR(0, 1356, __pyx_L1_error);
46260 3 : __pyx_t_18 = 0;
46261 3 : __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1356, __pyx_L1_error)
46262 3 : __Pyx_GOTREF(__pyx_t_18);
46263 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46264 3 : __pyx_t_3 = NULL;
46265 3 : __pyx_t_21 = 0;
46266 : #if CYTHON_UNPACK_METHODS
46267 3 : if (unlikely(PyMethod_Check(__pyx_t_19))) {
46268 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_19);
46269 0 : if (likely(__pyx_t_3)) {
46270 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
46271 0 : __Pyx_INCREF(__pyx_t_3);
46272 0 : __Pyx_INCREF(function);
46273 0 : __Pyx_DECREF_SET(__pyx_t_19, function);
46274 : __pyx_t_21 = 1;
46275 : }
46276 : }
46277 : #endif
46278 : {
46279 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_18};
46280 3 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_21, 1+__pyx_t_21);
46281 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
46282 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46283 3 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1356, __pyx_L1_error)
46284 3 : __Pyx_GOTREF(__pyx_t_20);
46285 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46286 : }
46287 3 : __pyx_v_r2 = __pyx_t_20;
46288 3 : __pyx_t_20 = 0;
46289 :
46290 : /* "scipy/linalg/_decomp_interpolative.pyx":1357
46291 : * inds2, tau2 = idzr_qrpiv(t, krank)
46292 : * r2 = np.triu(t[:krank, :])
46293 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
46294 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
46295 : *
46296 : */
46297 60 : for (__pyx_t_5 = (__pyx_v_krank - 1); __pyx_t_5 > -1; __pyx_t_5-=1) {
46298 57 : __pyx_v_ci = __pyx_t_5;
46299 :
46300 : /* "scipy/linalg/_decomp_interpolative.pyx":1358
46301 : * r2 = np.triu(t[:krank, :])
46302 : * for ci in range(krank-1, -1, -1):
46303 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
46304 : *
46305 : * r3 = r @ r2.T.conj()
46306 : */
46307 57 : __pyx_t_15 = __pyx_v_ci;
46308 57 : __pyx_t_20 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1358, __pyx_L1_error)
46309 57 : __Pyx_GOTREF(__pyx_t_20);
46310 57 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1358, __pyx_L1_error)
46311 57 : __Pyx_GOTREF(__pyx_t_19);
46312 57 : __pyx_t_18 = PyList_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1358, __pyx_L1_error)
46313 57 : __Pyx_GOTREF(__pyx_t_18);
46314 57 : __Pyx_GIVEREF(__pyx_t_20);
46315 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 0, __pyx_t_20)) __PYX_ERR(0, 1358, __pyx_L1_error);
46316 57 : __Pyx_GIVEREF(__pyx_t_19);
46317 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_18, 1, __pyx_t_19)) __PYX_ERR(0, 1358, __pyx_L1_error);
46318 57 : __pyx_t_20 = 0;
46319 57 : __pyx_t_19 = 0;
46320 57 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1358, __pyx_L1_error)
46321 57 : __Pyx_GOTREF(__pyx_t_19);
46322 57 : __Pyx_INCREF(__pyx_slice__5);
46323 57 : __Pyx_GIVEREF(__pyx_slice__5);
46324 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_slice__5)) __PYX_ERR(0, 1358, __pyx_L1_error);
46325 57 : __Pyx_GIVEREF(__pyx_t_18);
46326 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18)) __PYX_ERR(0, 1358, __pyx_L1_error);
46327 57 : __pyx_t_18 = 0;
46328 57 : __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1358, __pyx_L1_error)
46329 57 : __Pyx_GOTREF(__pyx_t_18);
46330 57 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46331 57 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1358, __pyx_L1_error)
46332 57 : __Pyx_GOTREF(__pyx_t_19);
46333 57 : __pyx_t_15 = __pyx_v_ci;
46334 57 : __pyx_t_20 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1358, __pyx_L1_error)
46335 57 : __Pyx_GOTREF(__pyx_t_20);
46336 57 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
46337 57 : __Pyx_GOTREF(__pyx_t_3);
46338 57 : __Pyx_GIVEREF(__pyx_t_19);
46339 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_19)) __PYX_ERR(0, 1358, __pyx_L1_error);
46340 57 : __Pyx_GIVEREF(__pyx_t_20);
46341 57 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_20)) __PYX_ERR(0, 1358, __pyx_L1_error);
46342 57 : __pyx_t_19 = 0;
46343 57 : __pyx_t_20 = 0;
46344 57 : __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1358, __pyx_L1_error)
46345 57 : __Pyx_GOTREF(__pyx_t_20);
46346 57 : __Pyx_INCREF(__pyx_slice__5);
46347 57 : __Pyx_GIVEREF(__pyx_slice__5);
46348 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_slice__5)) __PYX_ERR(0, 1358, __pyx_L1_error);
46349 57 : __Pyx_GIVEREF(__pyx_t_3);
46350 57 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error);
46351 57 : __pyx_t_3 = 0;
46352 57 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_20, __pyx_t_18) < 0))) __PYX_ERR(0, 1358, __pyx_L1_error)
46353 57 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46354 114 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46355 : }
46356 :
46357 : /* "scipy/linalg/_decomp_interpolative.pyx":1360
46358 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
46359 : *
46360 : * r3 = r @ r2.T.conj() # <<<<<<<<<<<<<<
46361 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False)
46362 : *
46363 : */
46364 3 : __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1360, __pyx_L1_error)
46365 3 : __Pyx_GOTREF(__pyx_t_20);
46366 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_conj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error)
46367 3 : __Pyx_GOTREF(__pyx_t_3);
46368 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46369 3 : __pyx_t_20 = NULL;
46370 3 : __pyx_t_21 = 0;
46371 : #if CYTHON_UNPACK_METHODS
46372 3 : if (likely(PyMethod_Check(__pyx_t_3))) {
46373 0 : __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3);
46374 0 : if (likely(__pyx_t_20)) {
46375 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
46376 0 : __Pyx_INCREF(__pyx_t_20);
46377 0 : __Pyx_INCREF(function);
46378 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
46379 : __pyx_t_21 = 1;
46380 : }
46381 : }
46382 : #endif
46383 : {
46384 3 : PyObject *__pyx_callargs[2] = {__pyx_t_20, NULL};
46385 3 : __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46386 3 : __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
46387 3 : if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1360, __pyx_L1_error)
46388 3 : __Pyx_GOTREF(__pyx_t_18);
46389 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46390 : }
46391 3 : __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L1_error)
46392 3 : __Pyx_GOTREF(__pyx_t_3);
46393 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46394 3 : __pyx_v_r3 = __pyx_t_3;
46395 3 : __pyx_t_3 = 0;
46396 :
46397 : /* "scipy/linalg/_decomp_interpolative.pyx":1361
46398 : *
46399 : * r3 = r @ r2.T.conj()
46400 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False) # <<<<<<<<<<<<<<
46401 : *
46402 : * # Apply Q of col to U from the left
46403 : */
46404 3 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_la); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
46405 3 : __Pyx_GOTREF(__pyx_t_3);
46406 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_svd); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1361, __pyx_L1_error)
46407 3 : __Pyx_GOTREF(__pyx_t_18);
46408 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46409 3 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
46410 3 : __Pyx_GOTREF(__pyx_t_3);
46411 3 : __Pyx_INCREF(__pyx_v_r3);
46412 3 : __Pyx_GIVEREF(__pyx_v_r3);
46413 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_r3)) __PYX_ERR(0, 1361, __pyx_L1_error);
46414 3 : __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1361, __pyx_L1_error)
46415 3 : __Pyx_GOTREF(__pyx_t_20);
46416 3 : if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1361, __pyx_L1_error)
46417 3 : __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1361, __pyx_L1_error)
46418 3 : __Pyx_GOTREF(__pyx_t_19);
46419 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46420 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46421 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46422 3 : if ((likely(PyTuple_CheckExact(__pyx_t_19))) || (PyList_CheckExact(__pyx_t_19))) {
46423 3 : PyObject* sequence = __pyx_t_19;
46424 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
46425 3 : if (unlikely(size != 3)) {
46426 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
46427 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
46428 0 : __PYX_ERR(0, 1361, __pyx_L1_error)
46429 : }
46430 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46431 3 : if (likely(PyTuple_CheckExact(sequence))) {
46432 3 : __pyx_t_20 = PyTuple_GET_ITEM(sequence, 0);
46433 3 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
46434 3 : __pyx_t_18 = PyTuple_GET_ITEM(sequence, 2);
46435 : } else {
46436 0 : __pyx_t_20 = PyList_GET_ITEM(sequence, 0);
46437 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
46438 0 : __pyx_t_18 = PyList_GET_ITEM(sequence, 2);
46439 : }
46440 3 : __Pyx_INCREF(__pyx_t_20);
46441 3 : __Pyx_INCREF(__pyx_t_3);
46442 3 : __Pyx_INCREF(__pyx_t_18);
46443 : #else
46444 : __pyx_t_20 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1361, __pyx_L1_error)
46445 : __Pyx_GOTREF(__pyx_t_20);
46446 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error)
46447 : __Pyx_GOTREF(__pyx_t_3);
46448 : __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1361, __pyx_L1_error)
46449 : __Pyx_GOTREF(__pyx_t_18);
46450 : #endif
46451 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46452 : } else {
46453 0 : Py_ssize_t index = -1;
46454 0 : __pyx_t_27 = PyObject_GetIter(__pyx_t_19); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1361, __pyx_L1_error)
46455 0 : __Pyx_GOTREF(__pyx_t_27);
46456 0 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46457 0 : __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_27);
46458 0 : index = 0; __pyx_t_20 = __pyx_t_22(__pyx_t_27); if (unlikely(!__pyx_t_20)) goto __pyx_L14_unpacking_failed;
46459 0 : __Pyx_GOTREF(__pyx_t_20);
46460 0 : index = 1; __pyx_t_3 = __pyx_t_22(__pyx_t_27); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed;
46461 0 : __Pyx_GOTREF(__pyx_t_3);
46462 0 : index = 2; __pyx_t_18 = __pyx_t_22(__pyx_t_27); if (unlikely(!__pyx_t_18)) goto __pyx_L14_unpacking_failed;
46463 0 : __Pyx_GOTREF(__pyx_t_18);
46464 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_27), 3) < 0) __PYX_ERR(0, 1361, __pyx_L1_error)
46465 0 : __pyx_t_22 = NULL;
46466 0 : __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
46467 0 : goto __pyx_L15_unpacking_done;
46468 0 : __pyx_L14_unpacking_failed:;
46469 0 : __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
46470 0 : __pyx_t_22 = NULL;
46471 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
46472 0 : __PYX_ERR(0, 1361, __pyx_L1_error)
46473 0 : __pyx_L15_unpacking_done:;
46474 : }
46475 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1361, __pyx_L1_error)
46476 3 : if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1361, __pyx_L1_error)
46477 3 : __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1361, __pyx_L1_error)
46478 3 : __Pyx_GOTREF(__pyx_t_27);
46479 3 : __pyx_t_28 = PySlice_New(Py_None, __pyx_t_27, Py_None); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 1361, __pyx_L1_error)
46480 3 : __Pyx_GOTREF(__pyx_t_28);
46481 3 : __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
46482 3 : __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1361, __pyx_L1_error)
46483 3 : __Pyx_GOTREF(__pyx_t_27);
46484 3 : __pyx_t_29 = PySlice_New(Py_None, __pyx_t_27, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1361, __pyx_L1_error)
46485 3 : __Pyx_GOTREF(__pyx_t_29);
46486 3 : __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
46487 3 : __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1361, __pyx_L1_error)
46488 3 : __Pyx_GOTREF(__pyx_t_27);
46489 3 : __Pyx_GIVEREF(__pyx_t_28);
46490 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_28)) __PYX_ERR(0, 1361, __pyx_L1_error);
46491 3 : __Pyx_GIVEREF(__pyx_t_29);
46492 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_t_29)) __PYX_ERR(0, 1361, __pyx_L1_error);
46493 3 : __pyx_t_28 = 0;
46494 3 : __pyx_t_29 = 0;
46495 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_27, __pyx_t_20) < 0))) __PYX_ERR(0, 1361, __pyx_L1_error)
46496 3 : __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
46497 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46498 3 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_3);
46499 : {
46500 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46501 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
46502 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
46503 3 : if (unlikely(__pyx_t_5 < 0)) {
46504 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
46505 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
46506 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
46507 : __Pyx_RaiseBufferFallbackError();
46508 : } else {
46509 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
46510 : }
46511 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
46512 : }
46513 3 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
46514 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error)
46515 : }
46516 3 : __pyx_t_30 = 0;
46517 3 : __pyx_v_S = ((PyArrayObject *)__pyx_t_3);
46518 3 : __pyx_t_3 = 0;
46519 3 : __pyx_t_31 = ((PyArrayObject *)__pyx_t_18);
46520 : {
46521 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46522 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
46523 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
46524 3 : if (unlikely(__pyx_t_5 < 0)) {
46525 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
46526 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
46527 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
46528 : __Pyx_RaiseBufferFallbackError();
46529 : } else {
46530 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
46531 : }
46532 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
46533 : }
46534 3 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
46535 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1361, __pyx_L1_error)
46536 : }
46537 3 : __pyx_t_31 = 0;
46538 3 : __pyx_v_V = ((PyArrayObject *)__pyx_t_18);
46539 3 : __pyx_t_18 = 0;
46540 :
46541 : /* "scipy/linalg/_decomp_interpolative.pyx":1365
46542 : * # Apply Q of col to U from the left
46543 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
46544 : * np.conjugate(tau1, out=tau1) # <<<<<<<<<<<<<<
46545 : * C = cols[:, :krank].conj().copy(order='F')
46546 : * zunm2r(<char*>'R', <char*>'C',
46547 : */
46548 3 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1365, __pyx_L1_error)
46549 3 : __Pyx_GOTREF(__pyx_t_19);
46550 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1365, __pyx_L1_error)
46551 3 : __Pyx_GOTREF(__pyx_t_18);
46552 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46553 3 : __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1365, __pyx_L1_error)
46554 3 : __Pyx_GOTREF(__pyx_t_19);
46555 3 : __Pyx_INCREF((PyObject *)__pyx_v_tau1);
46556 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau1);
46557 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_tau1))) __PYX_ERR(0, 1365, __pyx_L1_error);
46558 3 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error)
46559 3 : __Pyx_GOTREF(__pyx_t_3);
46560 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out, ((PyObject *)__pyx_v_tau1)) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
46561 3 : __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_19, __pyx_t_3); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1365, __pyx_L1_error)
46562 3 : __Pyx_GOTREF(__pyx_t_20);
46563 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46564 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46565 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46566 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46567 :
46568 : /* "scipy/linalg/_decomp_interpolative.pyx":1366
46569 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
46570 : * np.conjugate(tau1, out=tau1)
46571 : * C = cols[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
46572 : * zunm2r(<char*>'R', <char*>'C',
46573 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
46574 : */
46575 3 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
46576 3 : __Pyx_GOTREF(__pyx_t_3);
46577 3 : __pyx_t_19 = PySlice_New(Py_None, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1366, __pyx_L1_error)
46578 3 : __Pyx_GOTREF(__pyx_t_19);
46579 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46580 3 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
46581 3 : __Pyx_GOTREF(__pyx_t_3);
46582 3 : __Pyx_INCREF(__pyx_slice__5);
46583 3 : __Pyx_GIVEREF(__pyx_slice__5);
46584 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 1366, __pyx_L1_error);
46585 3 : __Pyx_GIVEREF(__pyx_t_19);
46586 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_19)) __PYX_ERR(0, 1366, __pyx_L1_error);
46587 3 : __pyx_t_19 = 0;
46588 3 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_cols), __pyx_t_3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1366, __pyx_L1_error)
46589 3 : __Pyx_GOTREF(__pyx_t_19);
46590 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46591 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
46592 3 : __Pyx_GOTREF(__pyx_t_3);
46593 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46594 3 : __pyx_t_19 = NULL;
46595 3 : __pyx_t_21 = 0;
46596 : #if CYTHON_UNPACK_METHODS
46597 3 : if (likely(PyMethod_Check(__pyx_t_3))) {
46598 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_3);
46599 0 : if (likely(__pyx_t_19)) {
46600 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
46601 0 : __Pyx_INCREF(__pyx_t_19);
46602 0 : __Pyx_INCREF(function);
46603 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
46604 : __pyx_t_21 = 1;
46605 : }
46606 : }
46607 : #endif
46608 : {
46609 3 : PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
46610 3 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46611 3 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
46612 3 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1366, __pyx_L1_error)
46613 3 : __Pyx_GOTREF(__pyx_t_20);
46614 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46615 : }
46616 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
46617 3 : __Pyx_GOTREF(__pyx_t_3);
46618 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46619 3 : __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1366, __pyx_L1_error)
46620 3 : __Pyx_GOTREF(__pyx_t_20);
46621 3 : if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1366, __pyx_L1_error)
46622 3 : __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1366, __pyx_L1_error)
46623 3 : __Pyx_GOTREF(__pyx_t_19);
46624 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46625 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46626 3 : if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1366, __pyx_L1_error)
46627 3 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_19);
46628 : {
46629 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46630 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
46631 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
46632 3 : if (unlikely(__pyx_t_5 < 0)) {
46633 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
46634 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
46635 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
46636 : __Pyx_RaiseBufferFallbackError();
46637 : } else {
46638 0 : PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
46639 : }
46640 0 : __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
46641 : }
46642 3 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
46643 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1366, __pyx_L1_error)
46644 : }
46645 3 : __pyx_t_32 = 0;
46646 3 : __pyx_v_C = ((PyArrayObject *)__pyx_t_19);
46647 3 : __pyx_t_19 = 0;
46648 :
46649 : /* "scipy/linalg/_decomp_interpolative.pyx":1368
46650 : * C = cols[:, :krank].conj().copy(order='F')
46651 : * zunm2r(<char*>'R', <char*>'C',
46652 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
46653 : * &UU[0,0], &krank, &cols[0, 0], &info)
46654 : *
46655 : */
46656 3 : __pyx_t_15 = 0;
46657 3 : __pyx_t_16 = 0;
46658 3 : __pyx_t_33 = 0;
46659 :
46660 : /* "scipy/linalg/_decomp_interpolative.pyx":1369
46661 : * zunm2r(<char*>'R', <char*>'C',
46662 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
46663 : * &UU[0,0], &krank, &cols[0, 0], &info) # <<<<<<<<<<<<<<
46664 : *
46665 : * VV[:krank, :krank] = V[:, :].conj().T
46666 : */
46667 3 : __pyx_t_34 = 0;
46668 3 : __pyx_t_35 = 0;
46669 3 : __pyx_t_36 = 0;
46670 3 : __pyx_t_37 = 0;
46671 :
46672 : /* "scipy/linalg/_decomp_interpolative.pyx":1367
46673 : * np.conjugate(tau1, out=tau1)
46674 : * C = cols[:, :krank].conj().copy(order='F')
46675 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
46676 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
46677 : * &UU[0,0], &krank, &cols[0, 0], &info)
46678 : */
46679 3 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_cols.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_cols.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_cols.diminfo[1].strides))), (&__pyx_v_info));
46680 :
46681 : /* "scipy/linalg/_decomp_interpolative.pyx":1371
46682 : * &UU[0,0], &krank, &cols[0, 0], &info)
46683 : *
46684 : * VV[:krank, :krank] = V[:, :].conj().T # <<<<<<<<<<<<<<
46685 : *
46686 : * # Apply Q of t to V from the left
46687 : */
46688 3 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1371, __pyx_L1_error)
46689 3 : __Pyx_GOTREF(__pyx_t_20);
46690 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_conj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
46691 3 : __Pyx_GOTREF(__pyx_t_3);
46692 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46693 3 : __pyx_t_20 = NULL;
46694 3 : __pyx_t_21 = 0;
46695 : #if CYTHON_UNPACK_METHODS
46696 3 : if (likely(PyMethod_Check(__pyx_t_3))) {
46697 0 : __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3);
46698 0 : if (likely(__pyx_t_20)) {
46699 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
46700 0 : __Pyx_INCREF(__pyx_t_20);
46701 0 : __Pyx_INCREF(function);
46702 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
46703 : __pyx_t_21 = 1;
46704 : }
46705 : }
46706 : #endif
46707 : {
46708 3 : PyObject *__pyx_callargs[2] = {__pyx_t_20, NULL};
46709 3 : __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46710 3 : __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
46711 3 : if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1371, __pyx_L1_error)
46712 3 : __Pyx_GOTREF(__pyx_t_19);
46713 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46714 : }
46715 3 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
46716 3 : __Pyx_GOTREF(__pyx_t_3);
46717 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46718 3 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1371, __pyx_L1_error)
46719 3 : __Pyx_GOTREF(__pyx_t_19);
46720 3 : __pyx_t_20 = PySlice_New(Py_None, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1371, __pyx_L1_error)
46721 3 : __Pyx_GOTREF(__pyx_t_20);
46722 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46723 3 : __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1371, __pyx_L1_error)
46724 3 : __Pyx_GOTREF(__pyx_t_19);
46725 3 : __pyx_t_18 = PySlice_New(Py_None, __pyx_t_19, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1371, __pyx_L1_error)
46726 3 : __Pyx_GOTREF(__pyx_t_18);
46727 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46728 3 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1371, __pyx_L1_error)
46729 3 : __Pyx_GOTREF(__pyx_t_19);
46730 3 : __Pyx_GIVEREF(__pyx_t_20);
46731 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20)) __PYX_ERR(0, 1371, __pyx_L1_error);
46732 3 : __Pyx_GIVEREF(__pyx_t_18);
46733 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18)) __PYX_ERR(0, 1371, __pyx_L1_error);
46734 3 : __pyx_t_20 = 0;
46735 3 : __pyx_t_18 = 0;
46736 3 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_19, __pyx_t_3) < 0))) __PYX_ERR(0, 1371, __pyx_L1_error)
46737 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46738 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46739 :
46740 : /* "scipy/linalg/_decomp_interpolative.pyx":1375
46741 : * # Apply Q of t to V from the left
46742 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
46743 : * np.conjugate(tau2, out=tau2) # <<<<<<<<<<<<<<
46744 : * C = t[:, :krank].conj().copy(order='F')
46745 : * zunm2r(<char*>'R', <char*>'C',
46746 : */
46747 3 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
46748 3 : __Pyx_GOTREF(__pyx_t_3);
46749 3 : __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1375, __pyx_L1_error)
46750 3 : __Pyx_GOTREF(__pyx_t_19);
46751 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46752 3 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
46753 3 : __Pyx_GOTREF(__pyx_t_3);
46754 3 : __Pyx_INCREF((PyObject *)__pyx_v_tau2);
46755 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau2);
46756 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_tau2))) __PYX_ERR(0, 1375, __pyx_L1_error);
46757 3 : __pyx_t_18 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1375, __pyx_L1_error)
46758 3 : __Pyx_GOTREF(__pyx_t_18);
46759 3 : if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_out, ((PyObject *)__pyx_v_tau2)) < 0) __PYX_ERR(0, 1375, __pyx_L1_error)
46760 3 : __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_3, __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1375, __pyx_L1_error)
46761 3 : __Pyx_GOTREF(__pyx_t_20);
46762 3 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
46763 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46764 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46765 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46766 :
46767 : /* "scipy/linalg/_decomp_interpolative.pyx":1376
46768 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
46769 : * np.conjugate(tau2, out=tau2)
46770 : * C = t[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
46771 : * zunm2r(<char*>'R', <char*>'C',
46772 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
46773 : */
46774 3 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1376, __pyx_L1_error)
46775 3 : __Pyx_GOTREF(__pyx_t_18);
46776 3 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_18, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
46777 3 : __Pyx_GOTREF(__pyx_t_3);
46778 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46779 3 : __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1376, __pyx_L1_error)
46780 3 : __Pyx_GOTREF(__pyx_t_18);
46781 3 : __Pyx_INCREF(__pyx_slice__5);
46782 3 : __Pyx_GIVEREF(__pyx_slice__5);
46783 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_slice__5)) __PYX_ERR(0, 1376, __pyx_L1_error);
46784 3 : __Pyx_GIVEREF(__pyx_t_3);
46785 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error);
46786 3 : __pyx_t_3 = 0;
46787 3 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
46788 3 : __Pyx_GOTREF(__pyx_t_3);
46789 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46790 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conj); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1376, __pyx_L1_error)
46791 3 : __Pyx_GOTREF(__pyx_t_18);
46792 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46793 3 : __pyx_t_3 = NULL;
46794 3 : __pyx_t_21 = 0;
46795 : #if CYTHON_UNPACK_METHODS
46796 3 : if (likely(PyMethod_Check(__pyx_t_18))) {
46797 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_18);
46798 0 : if (likely(__pyx_t_3)) {
46799 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
46800 0 : __Pyx_INCREF(__pyx_t_3);
46801 0 : __Pyx_INCREF(function);
46802 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
46803 : __pyx_t_21 = 1;
46804 : }
46805 : }
46806 : #endif
46807 : {
46808 3 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
46809 3 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_21, 0+__pyx_t_21);
46810 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
46811 3 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1376, __pyx_L1_error)
46812 3 : __Pyx_GOTREF(__pyx_t_20);
46813 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46814 : }
46815 3 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_copy); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1376, __pyx_L1_error)
46816 3 : __Pyx_GOTREF(__pyx_t_18);
46817 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46818 3 : __pyx_t_20 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1376, __pyx_L1_error)
46819 3 : __Pyx_GOTREF(__pyx_t_20);
46820 3 : if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1376, __pyx_L1_error)
46821 3 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_empty_tuple, __pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
46822 3 : __Pyx_GOTREF(__pyx_t_3);
46823 3 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
46824 3 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
46825 3 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1376, __pyx_L1_error)
46826 3 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_3);
46827 : {
46828 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
46829 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
46830 3 : __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
46831 3 : if (unlikely(__pyx_t_5 < 0)) {
46832 0 : PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
46833 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
46834 0 : Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
46835 0 : __Pyx_RaiseBufferFallbackError();
46836 : } else {
46837 0 : PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
46838 : }
46839 0 : __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
46840 : }
46841 3 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
46842 3 : if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1376, __pyx_L1_error)
46843 : }
46844 3 : __pyx_t_32 = 0;
46845 3 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_3));
46846 3 : __pyx_t_3 = 0;
46847 :
46848 : /* "scipy/linalg/_decomp_interpolative.pyx":1378
46849 : * C = t[:, :krank].conj().copy(order='F')
46850 : * zunm2r(<char*>'R', <char*>'C',
46851 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
46852 : * &VV[0, 0], &krank, &cols[0, 0], &info)
46853 : *
46854 : */
46855 3 : __pyx_t_37 = 0;
46856 3 : __pyx_t_36 = 0;
46857 3 : __pyx_t_35 = 0;
46858 :
46859 : /* "scipy/linalg/_decomp_interpolative.pyx":1379
46860 : * zunm2r(<char*>'R', <char*>'C',
46861 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
46862 : * &VV[0, 0], &krank, &cols[0, 0], &info) # <<<<<<<<<<<<<<
46863 : *
46864 : * return UU, S, VV
46865 : */
46866 3 : __pyx_t_34 = 0;
46867 3 : __pyx_t_33 = 0;
46868 3 : __pyx_t_16 = 0;
46869 3 : __pyx_t_15 = 0;
46870 :
46871 : /* "scipy/linalg/_decomp_interpolative.pyx":1377
46872 : * np.conjugate(tau2, out=tau2)
46873 : * C = t[:, :krank].conj().copy(order='F')
46874 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
46875 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
46876 : * &VV[0, 0], &krank, &cols[0, 0], &info)
46877 : */
46878 3 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_cols.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_cols.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_cols.diminfo[1].strides))), (&__pyx_v_info));
46879 :
46880 : /* "scipy/linalg/_decomp_interpolative.pyx":1338
46881 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] p
46882 : *
46883 : * if krank > 0: # <<<<<<<<<<<<<<
46884 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
46885 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
46886 : */
46887 : }
46888 :
46889 : /* "scipy/linalg/_decomp_interpolative.pyx":1381
46890 : * &VV[0, 0], &krank, &cols[0, 0], &info)
46891 : *
46892 : * return UU, S, VV # <<<<<<<<<<<<<<
46893 : *
46894 : *
46895 : */
46896 3 : __Pyx_XDECREF(__pyx_r);
46897 3 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
46898 3 : __Pyx_GOTREF(__pyx_t_3);
46899 3 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
46900 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
46901 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1381, __pyx_L1_error);
46902 3 : __Pyx_INCREF((PyObject *)__pyx_v_S);
46903 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
46904 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 1381, __pyx_L1_error);
46905 3 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
46906 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
46907 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 1381, __pyx_L1_error);
46908 3 : __pyx_r = __pyx_t_3;
46909 3 : __pyx_t_3 = 0;
46910 3 : goto __pyx_L0;
46911 :
46912 : /* "scipy/linalg/_decomp_interpolative.pyx":1320
46913 : *
46914 : *
46915 : * def idz_id2svd( # <<<<<<<<<<<<<<
46916 : * cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] cols,
46917 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
46918 : */
46919 :
46920 : /* function exit code */
46921 0 : __pyx_L1_error:;
46922 0 : __Pyx_XDECREF(__pyx_t_3);
46923 0 : __Pyx_XDECREF(__pyx_t_18);
46924 0 : __Pyx_XDECREF(__pyx_t_19);
46925 0 : __Pyx_XDECREF(__pyx_t_20);
46926 0 : __Pyx_XDECREF(__pyx_t_27);
46927 0 : __Pyx_XDECREF(__pyx_t_28);
46928 0 : __Pyx_XDECREF(__pyx_t_29);
46929 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
46930 0 : __Pyx_PyThreadState_declare
46931 0 : __Pyx_PyThreadState_assign
46932 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
46933 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
46934 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
46935 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
46936 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
46937 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
46938 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cols.rcbuffer->pybuffer);
46939 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
46940 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
46941 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
46942 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
46943 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
46944 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
46945 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
46946 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
46947 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_id2svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
46948 0 : __pyx_r = NULL;
46949 0 : goto __pyx_L2;
46950 3 : __pyx_L0:;
46951 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
46952 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
46953 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
46954 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
46955 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
46956 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cols.rcbuffer->pybuffer);
46957 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
46958 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
46959 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
46960 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
46961 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
46962 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
46963 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
46964 3 : __pyx_L2:;
46965 3 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
46966 3 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
46967 3 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
46968 3 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
46969 3 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
46970 3 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
46971 3 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
46972 3 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
46973 3 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
46974 3 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
46975 3 : __Pyx_XDECREF(__pyx_v_r);
46976 3 : __Pyx_XDECREF(__pyx_v_t);
46977 3 : __Pyx_XDECREF(__pyx_v_r2);
46978 3 : __Pyx_XDECREF(__pyx_v_r3);
46979 3 : __Pyx_XGIVEREF(__pyx_r);
46980 3 : __Pyx_RefNannyFinishContext();
46981 3 : return __pyx_r;
46982 : }
46983 :
46984 : /* "scipy/linalg/_decomp_interpolative.pyx":1384
46985 : *
46986 : *
46987 : * def idz_reconid(B, idx, proj): # <<<<<<<<<<<<<<
46988 : * cdef int m = B.shape[0], krank = B.shape[1]
46989 : * cdef int n = len(idx)
46990 : */
46991 :
46992 : /* Python wrapper */
46993 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_49idz_reconid(PyObject *__pyx_self,
46994 : #if CYTHON_METH_FASTCALL
46995 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
46996 : #else
46997 : PyObject *__pyx_args, PyObject *__pyx_kwds
46998 : #endif
46999 : ); /*proto*/
47000 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_49idz_reconid = {"idz_reconid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_49idz_reconid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
47001 6 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_49idz_reconid(PyObject *__pyx_self,
47002 : #if CYTHON_METH_FASTCALL
47003 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
47004 : #else
47005 : PyObject *__pyx_args, PyObject *__pyx_kwds
47006 : #endif
47007 : ) {
47008 6 : PyObject *__pyx_v_B = 0;
47009 6 : PyObject *__pyx_v_idx = 0;
47010 6 : PyObject *__pyx_v_proj = 0;
47011 : #if !CYTHON_METH_FASTCALL
47012 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
47013 : #endif
47014 6 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
47015 6 : PyObject* values[3] = {0,0,0};
47016 6 : int __pyx_lineno = 0;
47017 6 : const char *__pyx_filename = NULL;
47018 6 : int __pyx_clineno = 0;
47019 6 : PyObject *__pyx_r = 0;
47020 : __Pyx_RefNannyDeclarations
47021 6 : __Pyx_RefNannySetupContext("idz_reconid (wrapper)", 0);
47022 : #if !CYTHON_METH_FASTCALL
47023 : #if CYTHON_ASSUME_SAFE_MACROS
47024 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
47025 : #else
47026 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
47027 : #endif
47028 : #endif
47029 6 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
47030 : {
47031 6 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_idx,&__pyx_n_s_proj,0};
47032 6 : if (__pyx_kwds) {
47033 0 : Py_ssize_t kw_args;
47034 0 : switch (__pyx_nargs) {
47035 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
47036 0 : CYTHON_FALLTHROUGH;
47037 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
47038 0 : CYTHON_FALLTHROUGH;
47039 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
47040 0 : CYTHON_FALLTHROUGH;
47041 0 : case 0: break;
47042 0 : default: goto __pyx_L5_argtuple_error;
47043 : }
47044 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
47045 0 : switch (__pyx_nargs) {
47046 0 : case 0:
47047 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_B)) != 0)) {
47048 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
47049 0 : kw_args--;
47050 : }
47051 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L3_error)
47052 0 : else goto __pyx_L5_argtuple_error;
47053 0 : CYTHON_FALLTHROUGH;
47054 : case 1:
47055 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_idx)) != 0)) {
47056 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
47057 0 : kw_args--;
47058 : }
47059 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L3_error)
47060 : else {
47061 0 : __Pyx_RaiseArgtupleInvalid("idz_reconid", 1, 3, 3, 1); __PYX_ERR(0, 1384, __pyx_L3_error)
47062 : }
47063 0 : CYTHON_FALLTHROUGH;
47064 : case 2:
47065 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_proj)) != 0)) {
47066 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
47067 0 : kw_args--;
47068 : }
47069 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L3_error)
47070 : else {
47071 0 : __Pyx_RaiseArgtupleInvalid("idz_reconid", 1, 3, 3, 2); __PYX_ERR(0, 1384, __pyx_L3_error)
47072 : }
47073 : }
47074 0 : if (unlikely(kw_args > 0)) {
47075 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
47076 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_reconid") < 0)) __PYX_ERR(0, 1384, __pyx_L3_error)
47077 : }
47078 6 : } else if (unlikely(__pyx_nargs != 3)) {
47079 0 : goto __pyx_L5_argtuple_error;
47080 : } else {
47081 6 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
47082 6 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
47083 6 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
47084 : }
47085 6 : __pyx_v_B = values[0];
47086 6 : __pyx_v_idx = values[1];
47087 6 : __pyx_v_proj = values[2];
47088 : }
47089 6 : goto __pyx_L6_skip;
47090 0 : __pyx_L5_argtuple_error:;
47091 0 : __Pyx_RaiseArgtupleInvalid("idz_reconid", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1384, __pyx_L3_error)
47092 6 : __pyx_L6_skip:;
47093 6 : goto __pyx_L4_argument_unpacking_done;
47094 0 : __pyx_L3_error:;
47095 : {
47096 0 : Py_ssize_t __pyx_temp;
47097 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
47098 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
47099 : }
47100 : }
47101 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_reconid", __pyx_clineno, __pyx_lineno, __pyx_filename);
47102 0 : __Pyx_RefNannyFinishContext();
47103 0 : return NULL;
47104 6 : __pyx_L4_argument_unpacking_done:;
47105 6 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_48idz_reconid(__pyx_self, __pyx_v_B, __pyx_v_idx, __pyx_v_proj);
47106 :
47107 : /* function exit code */
47108 : {
47109 6 : Py_ssize_t __pyx_temp;
47110 6 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
47111 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
47112 : }
47113 : }
47114 : __Pyx_RefNannyFinishContext();
47115 : return __pyx_r;
47116 : }
47117 :
47118 6 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_48idz_reconid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_B, PyObject *__pyx_v_idx, PyObject *__pyx_v_proj) {
47119 6 : int __pyx_v_m;
47120 6 : int __pyx_v_krank;
47121 6 : int __pyx_v_n;
47122 6 : PyObject *__pyx_v_approx = NULL;
47123 6 : PyObject *__pyx_r = NULL;
47124 : __Pyx_RefNannyDeclarations
47125 6 : PyObject *__pyx_t_1 = NULL;
47126 6 : PyObject *__pyx_t_2 = NULL;
47127 6 : int __pyx_t_3;
47128 6 : Py_ssize_t __pyx_t_4;
47129 6 : PyObject *__pyx_t_5 = NULL;
47130 6 : PyObject *__pyx_t_6 = NULL;
47131 6 : PyObject *__pyx_t_7 = NULL;
47132 6 : int __pyx_lineno = 0;
47133 6 : const char *__pyx_filename = NULL;
47134 6 : int __pyx_clineno = 0;
47135 6 : __Pyx_RefNannySetupContext("idz_reconid", 1);
47136 :
47137 : /* "scipy/linalg/_decomp_interpolative.pyx":1385
47138 : *
47139 : * def idz_reconid(B, idx, proj):
47140 : * cdef int m = B.shape[0], krank = B.shape[1] # <<<<<<<<<<<<<<
47141 : * cdef int n = len(idx)
47142 : * approx = np.zeros([m, n], dtype=np.complex128)
47143 : */
47144 6 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
47145 6 : __Pyx_GOTREF(__pyx_t_1);
47146 6 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
47147 6 : __Pyx_GOTREF(__pyx_t_2);
47148 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47149 6 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
47150 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47151 6 : __pyx_v_m = __pyx_t_3;
47152 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_B, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
47153 6 : __Pyx_GOTREF(__pyx_t_2);
47154 6 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
47155 6 : __Pyx_GOTREF(__pyx_t_1);
47156 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47157 6 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1385, __pyx_L1_error)
47158 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47159 6 : __pyx_v_krank = __pyx_t_3;
47160 :
47161 : /* "scipy/linalg/_decomp_interpolative.pyx":1386
47162 : * def idz_reconid(B, idx, proj):
47163 : * cdef int m = B.shape[0], krank = B.shape[1]
47164 : * cdef int n = len(idx) # <<<<<<<<<<<<<<
47165 : * approx = np.zeros([m, n], dtype=np.complex128)
47166 : *
47167 : */
47168 6 : __pyx_t_4 = PyObject_Length(__pyx_v_idx); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1386, __pyx_L1_error)
47169 6 : __pyx_v_n = __pyx_t_4;
47170 :
47171 : /* "scipy/linalg/_decomp_interpolative.pyx":1387
47172 : * cdef int m = B.shape[0], krank = B.shape[1]
47173 : * cdef int n = len(idx)
47174 : * approx = np.zeros([m, n], dtype=np.complex128) # <<<<<<<<<<<<<<
47175 : *
47176 : * approx[:, idx[:krank]] = B
47177 : */
47178 6 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
47179 6 : __Pyx_GOTREF(__pyx_t_1);
47180 6 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
47181 6 : __Pyx_GOTREF(__pyx_t_2);
47182 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47183 6 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
47184 6 : __Pyx_GOTREF(__pyx_t_1);
47185 6 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
47186 6 : __Pyx_GOTREF(__pyx_t_5);
47187 6 : __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1387, __pyx_L1_error)
47188 6 : __Pyx_GOTREF(__pyx_t_6);
47189 6 : __Pyx_GIVEREF(__pyx_t_1);
47190 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error);
47191 6 : __Pyx_GIVEREF(__pyx_t_5);
47192 6 : if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error);
47193 6 : __pyx_t_1 = 0;
47194 6 : __pyx_t_5 = 0;
47195 6 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
47196 6 : __Pyx_GOTREF(__pyx_t_5);
47197 6 : __Pyx_GIVEREF(__pyx_t_6);
47198 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 1387, __pyx_L1_error);
47199 6 : __pyx_t_6 = 0;
47200 6 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1387, __pyx_L1_error)
47201 6 : __Pyx_GOTREF(__pyx_t_6);
47202 6 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
47203 6 : __Pyx_GOTREF(__pyx_t_1);
47204 6 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1387, __pyx_L1_error)
47205 6 : __Pyx_GOTREF(__pyx_t_7);
47206 6 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47207 6 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
47208 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
47209 6 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1387, __pyx_L1_error)
47210 6 : __Pyx_GOTREF(__pyx_t_7);
47211 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47212 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47213 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
47214 6 : __pyx_v_approx = __pyx_t_7;
47215 6 : __pyx_t_7 = 0;
47216 :
47217 : /* "scipy/linalg/_decomp_interpolative.pyx":1389
47218 : * approx = np.zeros([m, n], dtype=np.complex128)
47219 : *
47220 : * approx[:, idx[:krank]] = B # <<<<<<<<<<<<<<
47221 : * approx[:, idx[krank:]] = B @ proj
47222 : *
47223 : */
47224 6 : __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_idx, 0, __pyx_v_krank, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1389, __pyx_L1_error)
47225 6 : __Pyx_GOTREF(__pyx_t_7);
47226 6 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1389, __pyx_L1_error)
47227 6 : __Pyx_GOTREF(__pyx_t_6);
47228 6 : __Pyx_INCREF(__pyx_slice__5);
47229 6 : __Pyx_GIVEREF(__pyx_slice__5);
47230 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__5)) __PYX_ERR(0, 1389, __pyx_L1_error);
47231 6 : __Pyx_GIVEREF(__pyx_t_7);
47232 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 1389, __pyx_L1_error);
47233 6 : __pyx_t_7 = 0;
47234 6 : if (unlikely((PyObject_SetItem(__pyx_v_approx, __pyx_t_6, __pyx_v_B) < 0))) __PYX_ERR(0, 1389, __pyx_L1_error)
47235 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
47236 :
47237 : /* "scipy/linalg/_decomp_interpolative.pyx":1390
47238 : *
47239 : * approx[:, idx[:krank]] = B
47240 : * approx[:, idx[krank:]] = B @ proj # <<<<<<<<<<<<<<
47241 : *
47242 : * return approx
47243 : */
47244 6 : __pyx_t_6 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_B, __pyx_v_proj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1390, __pyx_L1_error)
47245 6 : __Pyx_GOTREF(__pyx_t_6);
47246 6 : __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_idx, __pyx_v_krank, 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L1_error)
47247 6 : __Pyx_GOTREF(__pyx_t_7);
47248 6 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1390, __pyx_L1_error)
47249 6 : __Pyx_GOTREF(__pyx_t_5);
47250 6 : __Pyx_INCREF(__pyx_slice__5);
47251 6 : __Pyx_GIVEREF(__pyx_slice__5);
47252 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__5)) __PYX_ERR(0, 1390, __pyx_L1_error);
47253 6 : __Pyx_GIVEREF(__pyx_t_7);
47254 6 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 1390, __pyx_L1_error);
47255 6 : __pyx_t_7 = 0;
47256 6 : if (unlikely((PyObject_SetItem(__pyx_v_approx, __pyx_t_5, __pyx_t_6) < 0))) __PYX_ERR(0, 1390, __pyx_L1_error)
47257 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47258 6 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
47259 :
47260 : /* "scipy/linalg/_decomp_interpolative.pyx":1392
47261 : * approx[:, idx[krank:]] = B @ proj
47262 : *
47263 : * return approx # <<<<<<<<<<<<<<
47264 : *
47265 : *
47266 : */
47267 6 : __Pyx_XDECREF(__pyx_r);
47268 6 : __Pyx_INCREF(__pyx_v_approx);
47269 6 : __pyx_r = __pyx_v_approx;
47270 6 : goto __pyx_L0;
47271 :
47272 : /* "scipy/linalg/_decomp_interpolative.pyx":1384
47273 : *
47274 : *
47275 : * def idz_reconid(B, idx, proj): # <<<<<<<<<<<<<<
47276 : * cdef int m = B.shape[0], krank = B.shape[1]
47277 : * cdef int n = len(idx)
47278 : */
47279 :
47280 : /* function exit code */
47281 0 : __pyx_L1_error:;
47282 0 : __Pyx_XDECREF(__pyx_t_1);
47283 0 : __Pyx_XDECREF(__pyx_t_2);
47284 0 : __Pyx_XDECREF(__pyx_t_5);
47285 0 : __Pyx_XDECREF(__pyx_t_6);
47286 0 : __Pyx_XDECREF(__pyx_t_7);
47287 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_reconid", __pyx_clineno, __pyx_lineno, __pyx_filename);
47288 0 : __pyx_r = NULL;
47289 6 : __pyx_L0:;
47290 6 : __Pyx_XDECREF(__pyx_v_approx);
47291 6 : __Pyx_XGIVEREF(__pyx_r);
47292 6 : __Pyx_RefNannyFinishContext();
47293 6 : return __pyx_r;
47294 : }
47295 :
47296 : /* "scipy/linalg/_decomp_interpolative.pyx":1395
47297 : *
47298 : *
47299 : * def idz_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
47300 : * cdef int n = A.shape[1]
47301 : * cdef int j = 0, intone = 1
47302 : */
47303 :
47304 : /* Python wrapper */
47305 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_51idz_snorm(PyObject *__pyx_self,
47306 : #if CYTHON_METH_FASTCALL
47307 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
47308 : #else
47309 : PyObject *__pyx_args, PyObject *__pyx_kwds
47310 : #endif
47311 : ); /*proto*/
47312 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_51idz_snorm = {"idz_snorm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_51idz_snorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
47313 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_51idz_snorm(PyObject *__pyx_self,
47314 : #if CYTHON_METH_FASTCALL
47315 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
47316 : #else
47317 : PyObject *__pyx_args, PyObject *__pyx_kwds
47318 : #endif
47319 : ) {
47320 1 : PyObject *__pyx_v_A = 0;
47321 1 : PyObject *__pyx_v_rng = 0;
47322 1 : int __pyx_v_its;
47323 : #if !CYTHON_METH_FASTCALL
47324 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
47325 : #endif
47326 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
47327 1 : PyObject* values[3] = {0,0,0};
47328 1 : int __pyx_lineno = 0;
47329 1 : const char *__pyx_filename = NULL;
47330 1 : int __pyx_clineno = 0;
47331 1 : PyObject *__pyx_r = 0;
47332 : __Pyx_RefNannyDeclarations
47333 1 : __Pyx_RefNannySetupContext("idz_snorm (wrapper)", 0);
47334 : #if !CYTHON_METH_FASTCALL
47335 : #if CYTHON_ASSUME_SAFE_MACROS
47336 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
47337 : #else
47338 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
47339 : #endif
47340 : #endif
47341 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
47342 : {
47343 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_rng,&__pyx_n_s_its,0};
47344 1 : if (likely(__pyx_kwds)) {
47345 1 : Py_ssize_t kw_args;
47346 1 : switch (__pyx_nargs) {
47347 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
47348 1 : CYTHON_FALLTHROUGH;
47349 1 : case 0: break;
47350 0 : default: goto __pyx_L5_argtuple_error;
47351 : }
47352 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
47353 1 : switch (__pyx_nargs) {
47354 : case 0:
47355 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
47356 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
47357 0 : kw_args--;
47358 : }
47359 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L3_error)
47360 0 : else goto __pyx_L5_argtuple_error;
47361 1 : CYTHON_FALLTHROUGH;
47362 : case 1:
47363 1 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
47364 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
47365 1 : kw_args--;
47366 : }
47367 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L3_error)
47368 : else {
47369 0 : __Pyx_RaiseKeywordRequired("idz_snorm", __pyx_n_s_rng); __PYX_ERR(0, 1395, __pyx_L3_error)
47370 : }
47371 : }
47372 1 : if (kw_args == 1) {
47373 1 : const Py_ssize_t index = 2;
47374 1 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
47375 1 : if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
47376 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L3_error)
47377 : }
47378 1 : if (unlikely(kw_args > 0)) {
47379 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
47380 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idz_snorm") < 0)) __PYX_ERR(0, 1395, __pyx_L3_error)
47381 : }
47382 0 : } else if (unlikely(__pyx_nargs != 1)) {
47383 0 : goto __pyx_L5_argtuple_error;
47384 : } else {
47385 0 : __Pyx_RaiseKeywordRequired("idz_snorm", __pyx_n_s_rng); __PYX_ERR(0, 1395, __pyx_L3_error)
47386 : }
47387 1 : __pyx_v_A = values[0];
47388 1 : __pyx_v_rng = values[1];
47389 1 : if (values[2]) {
47390 1 : __pyx_v_its = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_its == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L3_error)
47391 : } else {
47392 : __pyx_v_its = ((int)((int)20));
47393 : }
47394 : }
47395 1 : goto __pyx_L6_skip;
47396 0 : __pyx_L5_argtuple_error:;
47397 0 : __Pyx_RaiseArgtupleInvalid("idz_snorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1395, __pyx_L3_error)
47398 1 : __pyx_L6_skip:;
47399 1 : goto __pyx_L4_argument_unpacking_done;
47400 0 : __pyx_L3_error:;
47401 : {
47402 0 : Py_ssize_t __pyx_temp;
47403 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
47404 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
47405 : }
47406 : }
47407 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_snorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
47408 0 : __Pyx_RefNannyFinishContext();
47409 0 : return NULL;
47410 1 : __pyx_L4_argument_unpacking_done:;
47411 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_50idz_snorm(__pyx_self, __pyx_v_A, __pyx_v_rng, __pyx_v_its);
47412 :
47413 : /* function exit code */
47414 : {
47415 1 : Py_ssize_t __pyx_temp;
47416 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
47417 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
47418 : }
47419 : }
47420 : __Pyx_RefNannyFinishContext();
47421 : return __pyx_r;
47422 : }
47423 :
47424 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_50idz_snorm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_rng, int __pyx_v_its) {
47425 1 : int __pyx_v_n;
47426 1 : CYTHON_UNUSED int __pyx_v_j;
47427 1 : int __pyx_v_intone;
47428 1 : __pyx_t_5numpy_float64_t __pyx_v_snorm;
47429 1 : PyArrayObject *__pyx_v_v = 0;
47430 1 : PyArrayObject *__pyx_v_u = 0;
47431 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_u;
47432 1 : __Pyx_Buffer __pyx_pybuffer_u;
47433 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
47434 1 : __Pyx_Buffer __pyx_pybuffer_v;
47435 1 : PyObject *__pyx_r = NULL;
47436 : __Pyx_RefNannyDeclarations
47437 1 : PyObject *__pyx_t_1 = NULL;
47438 1 : PyObject *__pyx_t_2 = NULL;
47439 1 : int __pyx_t_3;
47440 1 : PyObject *__pyx_t_4 = NULL;
47441 1 : PyObject *__pyx_t_5 = NULL;
47442 1 : PyObject *__pyx_t_6 = NULL;
47443 1 : PyObject *__pyx_t_7 = NULL;
47444 1 : unsigned int __pyx_t_8;
47445 1 : PyArrayObject *__pyx_t_9 = NULL;
47446 1 : PyObject *__pyx_t_10 = NULL;
47447 1 : PyObject *__pyx_t_11 = NULL;
47448 1 : PyObject *__pyx_t_12 = NULL;
47449 1 : Py_ssize_t __pyx_t_13;
47450 1 : int __pyx_t_14;
47451 1 : int __pyx_t_15;
47452 1 : PyArrayObject *__pyx_t_16 = NULL;
47453 1 : int __pyx_t_17;
47454 1 : int __pyx_t_18;
47455 1 : __pyx_t_5numpy_float64_t __pyx_t_19;
47456 1 : int __pyx_lineno = 0;
47457 1 : const char *__pyx_filename = NULL;
47458 1 : int __pyx_clineno = 0;
47459 1 : __Pyx_RefNannySetupContext("idz_snorm", 1);
47460 1 : __pyx_pybuffer_v.pybuffer.buf = NULL;
47461 1 : __pyx_pybuffer_v.refcount = 0;
47462 1 : __pyx_pybuffernd_v.data = NULL;
47463 1 : __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
47464 1 : __pyx_pybuffer_u.pybuffer.buf = NULL;
47465 1 : __pyx_pybuffer_u.refcount = 0;
47466 1 : __pyx_pybuffernd_u.data = NULL;
47467 1 : __pyx_pybuffernd_u.rcbuffer = &__pyx_pybuffer_u;
47468 :
47469 : /* "scipy/linalg/_decomp_interpolative.pyx":1396
47470 : *
47471 : * def idz_snorm(A: LinearOperator, *, rng, int its=20):
47472 : * cdef int n = A.shape[1] # <<<<<<<<<<<<<<
47473 : * cdef int j = 0, intone = 1
47474 : * cdef cnp.float64_t snorm = 0.0
47475 : */
47476 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
47477 1 : __Pyx_GOTREF(__pyx_t_1);
47478 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1396, __pyx_L1_error)
47479 1 : __Pyx_GOTREF(__pyx_t_2);
47480 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47481 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error)
47482 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47483 1 : __pyx_v_n = __pyx_t_3;
47484 :
47485 : /* "scipy/linalg/_decomp_interpolative.pyx":1397
47486 : * def idz_snorm(A: LinearOperator, *, rng, int its=20):
47487 : * cdef int n = A.shape[1]
47488 : * cdef int j = 0, intone = 1 # <<<<<<<<<<<<<<
47489 : * cdef cnp.float64_t snorm = 0.0
47490 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] v
47491 : */
47492 1 : __pyx_v_j = 0;
47493 1 : __pyx_v_intone = 1;
47494 :
47495 : /* "scipy/linalg/_decomp_interpolative.pyx":1398
47496 : * cdef int n = A.shape[1]
47497 : * cdef int j = 0, intone = 1
47498 : * cdef cnp.float64_t snorm = 0.0 # <<<<<<<<<<<<<<
47499 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] v
47500 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] u
47501 : */
47502 1 : __pyx_v_snorm = 0.0;
47503 :
47504 : /* "scipy/linalg/_decomp_interpolative.pyx":1402
47505 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] u
47506 : *
47507 : * v = rng.uniform(low=-1, high=1, size=(n, 2)).view(np.complex128).ravel() # <<<<<<<<<<<<<<
47508 : * v /= dznrm2(&n, &v[0], &intone)
47509 : *
47510 : */
47511 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error)
47512 1 : __Pyx_GOTREF(__pyx_t_4);
47513 1 : __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error)
47514 1 : __Pyx_GOTREF(__pyx_t_5);
47515 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_low, __pyx_int_neg_1) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
47516 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_high, __pyx_int_1) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
47517 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1402, __pyx_L1_error)
47518 1 : __Pyx_GOTREF(__pyx_t_6);
47519 1 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1402, __pyx_L1_error)
47520 1 : __Pyx_GOTREF(__pyx_t_7);
47521 1 : __Pyx_GIVEREF(__pyx_t_6);
47522 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1402, __pyx_L1_error);
47523 1 : __Pyx_INCREF(__pyx_int_2);
47524 1 : __Pyx_GIVEREF(__pyx_int_2);
47525 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_2)) __PYX_ERR(0, 1402, __pyx_L1_error);
47526 1 : __pyx_t_6 = 0;
47527 1 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_size, __pyx_t_7) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
47528 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
47529 1 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1402, __pyx_L1_error)
47530 1 : __Pyx_GOTREF(__pyx_t_7);
47531 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
47532 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47533 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error)
47534 1 : __Pyx_GOTREF(__pyx_t_5);
47535 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
47536 1 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1402, __pyx_L1_error)
47537 1 : __Pyx_GOTREF(__pyx_t_7);
47538 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_complex128); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error)
47539 1 : __Pyx_GOTREF(__pyx_t_4);
47540 1 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
47541 1 : __pyx_t_7 = NULL;
47542 1 : __pyx_t_8 = 0;
47543 : #if CYTHON_UNPACK_METHODS
47544 1 : if (likely(PyMethod_Check(__pyx_t_5))) {
47545 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
47546 0 : if (likely(__pyx_t_7)) {
47547 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
47548 0 : __Pyx_INCREF(__pyx_t_7);
47549 0 : __Pyx_INCREF(function);
47550 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
47551 : __pyx_t_8 = 1;
47552 : }
47553 : }
47554 : #endif
47555 : {
47556 1 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
47557 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
47558 1 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
47559 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
47560 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
47561 1 : __Pyx_GOTREF(__pyx_t_1);
47562 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47563 : }
47564 1 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ravel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error)
47565 1 : __Pyx_GOTREF(__pyx_t_5);
47566 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47567 1 : __pyx_t_1 = NULL;
47568 1 : __pyx_t_8 = 0;
47569 : #if CYTHON_UNPACK_METHODS
47570 1 : if (likely(PyMethod_Check(__pyx_t_5))) {
47571 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
47572 0 : if (likely(__pyx_t_1)) {
47573 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
47574 0 : __Pyx_INCREF(__pyx_t_1);
47575 0 : __Pyx_INCREF(function);
47576 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
47577 : __pyx_t_8 = 1;
47578 : }
47579 : }
47580 : #endif
47581 : {
47582 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
47583 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
47584 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
47585 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error)
47586 1 : __Pyx_GOTREF(__pyx_t_2);
47587 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47588 : }
47589 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1402, __pyx_L1_error)
47590 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
47591 : {
47592 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
47593 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47594 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
47595 1 : if (unlikely(__pyx_t_3 < 0)) {
47596 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
47597 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
47598 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
47599 : __Pyx_RaiseBufferFallbackError();
47600 : } else {
47601 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
47602 : }
47603 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
47604 : }
47605 1 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
47606 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1402, __pyx_L1_error)
47607 : }
47608 1 : __pyx_t_9 = 0;
47609 1 : __pyx_v_v = ((PyArrayObject *)__pyx_t_2);
47610 1 : __pyx_t_2 = 0;
47611 :
47612 : /* "scipy/linalg/_decomp_interpolative.pyx":1403
47613 : *
47614 : * v = rng.uniform(low=-1, high=1, size=(n, 2)).view(np.complex128).ravel()
47615 : * v /= dznrm2(&n, &v[0], &intone) # <<<<<<<<<<<<<<
47616 : *
47617 : * for j in range(its):
47618 : */
47619 1 : __pyx_t_13 = 0;
47620 1 : __pyx_t_2 = PyFloat_FromDouble(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides))), (&__pyx_v_intone))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
47621 1 : __Pyx_GOTREF(__pyx_t_2);
47622 1 : __pyx_t_5 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __pyx_L1_error)
47623 1 : __Pyx_GOTREF(__pyx_t_5);
47624 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47625 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1403, __pyx_L1_error)
47626 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
47627 : {
47628 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
47629 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47630 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
47631 1 : if (unlikely(__pyx_t_3 < 0)) {
47632 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
47633 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
47634 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
47635 0 : __Pyx_RaiseBufferFallbackError();
47636 : } else {
47637 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
47638 : }
47639 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
47640 : }
47641 1 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
47642 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
47643 : }
47644 1 : __pyx_t_9 = 0;
47645 1 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_5));
47646 : __pyx_t_5 = 0;
47647 :
47648 : /* "scipy/linalg/_decomp_interpolative.pyx":1405
47649 : * v /= dznrm2(&n, &v[0], &intone)
47650 : *
47651 : * for j in range(its): # <<<<<<<<<<<<<<
47652 : * u = A.matvec(v)
47653 : * v = A.rmatvec(u)
47654 : */
47655 21 : __pyx_t_3 = __pyx_v_its;
47656 : __pyx_t_14 = __pyx_t_3;
47657 21 : for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
47658 20 : __pyx_v_j = __pyx_t_15;
47659 :
47660 : /* "scipy/linalg/_decomp_interpolative.pyx":1406
47661 : *
47662 : * for j in range(its):
47663 : * u = A.matvec(v) # <<<<<<<<<<<<<<
47664 : * v = A.rmatvec(u)
47665 : * snorm = dznrm2(&n, &v[0], &intone)
47666 : */
47667 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error)
47668 20 : __Pyx_GOTREF(__pyx_t_2);
47669 20 : __pyx_t_1 = NULL;
47670 20 : __pyx_t_8 = 0;
47671 : #if CYTHON_UNPACK_METHODS
47672 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
47673 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
47674 20 : if (likely(__pyx_t_1)) {
47675 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
47676 20 : __Pyx_INCREF(__pyx_t_1);
47677 20 : __Pyx_INCREF(function);
47678 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
47679 : __pyx_t_8 = 1;
47680 : }
47681 : }
47682 : #endif
47683 : {
47684 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_v)};
47685 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
47686 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
47687 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1406, __pyx_L1_error)
47688 20 : __Pyx_GOTREF(__pyx_t_5);
47689 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47690 : }
47691 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1406, __pyx_L1_error)
47692 20 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
47693 : {
47694 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
47695 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
47696 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
47697 20 : if (unlikely(__pyx_t_17 < 0)) {
47698 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
47699 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_u, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
47700 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
47701 0 : __Pyx_RaiseBufferFallbackError();
47702 : } else {
47703 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
47704 : }
47705 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
47706 : }
47707 20 : __pyx_pybuffernd_u.diminfo[0].strides = __pyx_pybuffernd_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u.diminfo[0].shape = __pyx_pybuffernd_u.rcbuffer->pybuffer.shape[0];
47708 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error)
47709 : }
47710 20 : __pyx_t_16 = 0;
47711 20 : __Pyx_XDECREF_SET(__pyx_v_u, ((PyArrayObject *)__pyx_t_5));
47712 20 : __pyx_t_5 = 0;
47713 :
47714 : /* "scipy/linalg/_decomp_interpolative.pyx":1407
47715 : * for j in range(its):
47716 : * u = A.matvec(v)
47717 : * v = A.rmatvec(u) # <<<<<<<<<<<<<<
47718 : * snorm = dznrm2(&n, &v[0], &intone)
47719 : * if snorm > 0.0:
47720 : */
47721 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
47722 20 : __Pyx_GOTREF(__pyx_t_2);
47723 20 : __pyx_t_1 = NULL;
47724 20 : __pyx_t_8 = 0;
47725 : #if CYTHON_UNPACK_METHODS
47726 20 : if (likely(PyMethod_Check(__pyx_t_2))) {
47727 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
47728 20 : if (likely(__pyx_t_1)) {
47729 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
47730 20 : __Pyx_INCREF(__pyx_t_1);
47731 20 : __Pyx_INCREF(function);
47732 20 : __Pyx_DECREF_SET(__pyx_t_2, function);
47733 : __pyx_t_8 = 1;
47734 : }
47735 : }
47736 : #endif
47737 : {
47738 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_u)};
47739 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
47740 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
47741 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error)
47742 20 : __Pyx_GOTREF(__pyx_t_5);
47743 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47744 : }
47745 20 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1407, __pyx_L1_error)
47746 20 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_5);
47747 : {
47748 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
47749 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47750 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
47751 20 : if (unlikely(__pyx_t_17 < 0)) {
47752 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
47753 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
47754 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
47755 0 : __Pyx_RaiseBufferFallbackError();
47756 : } else {
47757 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
47758 : }
47759 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
47760 : }
47761 20 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
47762 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1407, __pyx_L1_error)
47763 : }
47764 20 : __pyx_t_9 = 0;
47765 20 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_5));
47766 20 : __pyx_t_5 = 0;
47767 :
47768 : /* "scipy/linalg/_decomp_interpolative.pyx":1408
47769 : * u = A.matvec(v)
47770 : * v = A.rmatvec(u)
47771 : * snorm = dznrm2(&n, &v[0], &intone) # <<<<<<<<<<<<<<
47772 : * if snorm > 0.0:
47773 : * v /= snorm
47774 : */
47775 20 : __pyx_t_13 = 0;
47776 20 : __pyx_v_snorm = __pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides))), (&__pyx_v_intone));
47777 :
47778 : /* "scipy/linalg/_decomp_interpolative.pyx":1409
47779 : * v = A.rmatvec(u)
47780 : * snorm = dznrm2(&n, &v[0], &intone)
47781 : * if snorm > 0.0: # <<<<<<<<<<<<<<
47782 : * v /= snorm
47783 : *
47784 : */
47785 20 : __pyx_t_18 = (__pyx_v_snorm > 0.0);
47786 20 : if (__pyx_t_18) {
47787 :
47788 : /* "scipy/linalg/_decomp_interpolative.pyx":1410
47789 : * snorm = dznrm2(&n, &v[0], &intone)
47790 : * if snorm > 0.0:
47791 : * v /= snorm # <<<<<<<<<<<<<<
47792 : *
47793 : * snorm = np.sqrt(snorm)
47794 : */
47795 20 : __pyx_t_5 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error)
47796 20 : __Pyx_GOTREF(__pyx_t_5);
47797 20 : __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_v), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error)
47798 20 : __Pyx_GOTREF(__pyx_t_2);
47799 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47800 20 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1410, __pyx_L1_error)
47801 20 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
47802 : {
47803 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
47804 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47805 20 : __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
47806 20 : if (unlikely(__pyx_t_17 < 0)) {
47807 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
47808 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
47809 0 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
47810 0 : __Pyx_RaiseBufferFallbackError();
47811 : } else {
47812 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
47813 : }
47814 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
47815 : }
47816 20 : __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
47817 20 : if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error)
47818 : }
47819 20 : __pyx_t_9 = 0;
47820 20 : __Pyx_DECREF_SET(__pyx_v_v, ((PyArrayObject *)__pyx_t_2));
47821 : __pyx_t_2 = 0;
47822 :
47823 : /* "scipy/linalg/_decomp_interpolative.pyx":1409
47824 : * v = A.rmatvec(u)
47825 : * snorm = dznrm2(&n, &v[0], &intone)
47826 : * if snorm > 0.0: # <<<<<<<<<<<<<<
47827 : * v /= snorm
47828 : *
47829 : */
47830 : }
47831 :
47832 : /* "scipy/linalg/_decomp_interpolative.pyx":1412
47833 : * v /= snorm
47834 : *
47835 : * snorm = np.sqrt(snorm) # <<<<<<<<<<<<<<
47836 : *
47837 : * return snorm
47838 : */
47839 20 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1412, __pyx_L1_error)
47840 20 : __Pyx_GOTREF(__pyx_t_5);
47841 20 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
47842 20 : __Pyx_GOTREF(__pyx_t_1);
47843 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47844 20 : __pyx_t_5 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1412, __pyx_L1_error)
47845 20 : __Pyx_GOTREF(__pyx_t_5);
47846 20 : __pyx_t_4 = NULL;
47847 20 : __pyx_t_8 = 0;
47848 : #if CYTHON_UNPACK_METHODS
47849 20 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
47850 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
47851 0 : if (likely(__pyx_t_4)) {
47852 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
47853 0 : __Pyx_INCREF(__pyx_t_4);
47854 0 : __Pyx_INCREF(function);
47855 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
47856 : __pyx_t_8 = 1;
47857 : }
47858 : }
47859 : #endif
47860 : {
47861 20 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
47862 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
47863 20 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
47864 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47865 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error)
47866 20 : __Pyx_GOTREF(__pyx_t_2);
47867 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47868 : }
47869 20 : __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_19 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L1_error)
47870 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47871 20 : __pyx_v_snorm = __pyx_t_19;
47872 : }
47873 :
47874 : /* "scipy/linalg/_decomp_interpolative.pyx":1414
47875 : * snorm = np.sqrt(snorm)
47876 : *
47877 : * return snorm # <<<<<<<<<<<<<<
47878 : *
47879 : *
47880 : */
47881 1 : __Pyx_XDECREF(__pyx_r);
47882 1 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_snorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
47883 1 : __Pyx_GOTREF(__pyx_t_2);
47884 1 : __pyx_r = __pyx_t_2;
47885 1 : __pyx_t_2 = 0;
47886 1 : goto __pyx_L0;
47887 :
47888 : /* "scipy/linalg/_decomp_interpolative.pyx":1395
47889 : *
47890 : *
47891 : * def idz_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
47892 : * cdef int n = A.shape[1]
47893 : * cdef int j = 0, intone = 1
47894 : */
47895 :
47896 : /* function exit code */
47897 0 : __pyx_L1_error:;
47898 0 : __Pyx_XDECREF(__pyx_t_1);
47899 0 : __Pyx_XDECREF(__pyx_t_2);
47900 0 : __Pyx_XDECREF(__pyx_t_4);
47901 0 : __Pyx_XDECREF(__pyx_t_5);
47902 0 : __Pyx_XDECREF(__pyx_t_6);
47903 0 : __Pyx_XDECREF(__pyx_t_7);
47904 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
47905 0 : __Pyx_PyThreadState_declare
47906 0 : __Pyx_PyThreadState_assign
47907 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
47908 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
47909 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47910 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
47911 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idz_snorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
47912 0 : __pyx_r = NULL;
47913 0 : goto __pyx_L2;
47914 1 : __pyx_L0:;
47915 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u.rcbuffer->pybuffer);
47916 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
47917 1 : __pyx_L2:;
47918 1 : __Pyx_XDECREF((PyObject *)__pyx_v_v);
47919 1 : __Pyx_XDECREF((PyObject *)__pyx_v_u);
47920 1 : __Pyx_XGIVEREF(__pyx_r);
47921 1 : __Pyx_RefNannyFinishContext();
47922 1 : return __pyx_r;
47923 : }
47924 :
47925 : /* "scipy/linalg/_decomp_interpolative.pyx":1417
47926 : *
47927 : *
47928 : * def idzp_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
47929 : * rng):
47930 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
47931 : */
47932 :
47933 : /* Python wrapper */
47934 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_53idzp_aid(PyObject *__pyx_self,
47935 : #if CYTHON_METH_FASTCALL
47936 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
47937 : #else
47938 : PyObject *__pyx_args, PyObject *__pyx_kwds
47939 : #endif
47940 : ); /*proto*/
47941 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_53idzp_aid = {"idzp_aid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_53idzp_aid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
47942 3 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_53idzp_aid(PyObject *__pyx_self,
47943 : #if CYTHON_METH_FASTCALL
47944 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
47945 : #else
47946 : PyObject *__pyx_args, PyObject *__pyx_kwds
47947 : #endif
47948 : ) {
47949 3 : PyArrayObject *__pyx_v_a = 0;
47950 3 : double __pyx_v_eps;
47951 3 : PyObject *__pyx_v_rng = 0;
47952 : #if !CYTHON_METH_FASTCALL
47953 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
47954 : #endif
47955 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
47956 3 : PyObject* values[3] = {0,0,0};
47957 3 : int __pyx_lineno = 0;
47958 3 : const char *__pyx_filename = NULL;
47959 3 : int __pyx_clineno = 0;
47960 3 : PyObject *__pyx_r = 0;
47961 : __Pyx_RefNannyDeclarations
47962 3 : __Pyx_RefNannySetupContext("idzp_aid (wrapper)", 0);
47963 : #if !CYTHON_METH_FASTCALL
47964 : #if CYTHON_ASSUME_SAFE_MACROS
47965 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
47966 : #else
47967 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
47968 : #endif
47969 : #endif
47970 3 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
47971 : {
47972 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
47973 3 : if (likely(__pyx_kwds)) {
47974 3 : Py_ssize_t kw_args;
47975 3 : switch (__pyx_nargs) {
47976 3 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
47977 3 : CYTHON_FALLTHROUGH;
47978 3 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
47979 3 : CYTHON_FALLTHROUGH;
47980 3 : case 0: break;
47981 0 : default: goto __pyx_L5_argtuple_error;
47982 : }
47983 3 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
47984 3 : switch (__pyx_nargs) {
47985 : case 0:
47986 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
47987 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
47988 0 : kw_args--;
47989 : }
47990 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1417, __pyx_L3_error)
47991 0 : else goto __pyx_L5_argtuple_error;
47992 0 : CYTHON_FALLTHROUGH;
47993 : case 1:
47994 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
47995 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
47996 0 : kw_args--;
47997 : }
47998 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1417, __pyx_L3_error)
47999 : else {
48000 0 : __Pyx_RaiseArgtupleInvalid("idzp_aid", 1, 2, 2, 1); __PYX_ERR(0, 1417, __pyx_L3_error)
48001 : }
48002 3 : CYTHON_FALLTHROUGH;
48003 : case 2:
48004 3 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
48005 3 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
48006 3 : kw_args--;
48007 : }
48008 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1417, __pyx_L3_error)
48009 : else {
48010 0 : __Pyx_RaiseKeywordRequired("idzp_aid", __pyx_n_s_rng); __PYX_ERR(0, 1417, __pyx_L3_error)
48011 : }
48012 : }
48013 3 : if (unlikely(kw_args > 0)) {
48014 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
48015 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_aid") < 0)) __PYX_ERR(0, 1417, __pyx_L3_error)
48016 : }
48017 0 : } else if (unlikely(__pyx_nargs != 2)) {
48018 0 : goto __pyx_L5_argtuple_error;
48019 : } else {
48020 0 : __Pyx_RaiseKeywordRequired("idzp_aid", __pyx_n_s_rng); __PYX_ERR(0, 1417, __pyx_L3_error)
48021 : }
48022 3 : __pyx_v_a = ((PyArrayObject *)values[0]);
48023 3 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1417, __pyx_L3_error)
48024 3 : __pyx_v_rng = values[2];
48025 : }
48026 3 : goto __pyx_L6_skip;
48027 0 : __pyx_L5_argtuple_error:;
48028 0 : __Pyx_RaiseArgtupleInvalid("idzp_aid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1417, __pyx_L3_error)
48029 3 : __pyx_L6_skip:;
48030 3 : goto __pyx_L4_argument_unpacking_done;
48031 0 : __pyx_L3_error:;
48032 : {
48033 0 : Py_ssize_t __pyx_temp;
48034 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
48035 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
48036 : }
48037 : }
48038 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
48039 0 : __Pyx_RefNannyFinishContext();
48040 0 : return NULL;
48041 3 : __pyx_L4_argument_unpacking_done:;
48042 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1417, __pyx_L1_error)
48043 3 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_52idzp_aid(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
48044 :
48045 : /* function exit code */
48046 3 : goto __pyx_L0;
48047 0 : __pyx_L1_error:;
48048 0 : __pyx_r = NULL;
48049 3 : __pyx_L0:;
48050 : {
48051 3 : Py_ssize_t __pyx_temp;
48052 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
48053 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
48054 : }
48055 : }
48056 : __Pyx_RefNannyFinishContext();
48057 : return __pyx_r;
48058 : }
48059 :
48060 3 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_52idzp_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, double __pyx_v_eps, PyObject *__pyx_v_rng) {
48061 3 : PyObject *__pyx_v_krank = NULL;
48062 3 : PyObject *__pyx_v_proj = NULL;
48063 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
48064 3 : __Pyx_Buffer __pyx_pybuffer_a;
48065 3 : PyObject *__pyx_r = NULL;
48066 : __Pyx_RefNannyDeclarations
48067 3 : PyObject *__pyx_t_1 = NULL;
48068 3 : PyObject *__pyx_t_2 = NULL;
48069 3 : PyObject *__pyx_t_3 = NULL;
48070 3 : PyObject *__pyx_t_4 = NULL;
48071 3 : PyObject *(*__pyx_t_5)(PyObject *);
48072 3 : int __pyx_t_6;
48073 3 : int __pyx_lineno = 0;
48074 3 : const char *__pyx_filename = NULL;
48075 3 : int __pyx_clineno = 0;
48076 3 : __Pyx_RefNannySetupContext("idzp_aid", 1);
48077 3 : __pyx_pybuffer_a.pybuffer.buf = NULL;
48078 3 : __pyx_pybuffer_a.refcount = 0;
48079 3 : __pyx_pybuffernd_a.data = NULL;
48080 3 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
48081 : {
48082 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48083 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1417, __pyx_L1_error)
48084 : }
48085 3 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
48086 :
48087 : /* "scipy/linalg/_decomp_interpolative.pyx":1419
48088 : * def idzp_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *,
48089 : * rng):
48090 : * krank, proj = idz_estrank(a, eps=eps, rng=rng) # <<<<<<<<<<<<<<
48091 : * if krank != 0:
48092 : * proj = proj[:krank, :]
48093 : */
48094 3 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idz_estrank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
48095 3 : __Pyx_GOTREF(__pyx_t_1);
48096 3 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
48097 3 : __Pyx_GOTREF(__pyx_t_2);
48098 3 : __Pyx_INCREF((PyObject *)__pyx_v_a);
48099 3 : __Pyx_GIVEREF((PyObject *)__pyx_v_a);
48100 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_a))) __PYX_ERR(0, 1419, __pyx_L1_error);
48101 3 : __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
48102 3 : __Pyx_GOTREF(__pyx_t_3);
48103 3 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error)
48104 3 : __Pyx_GOTREF(__pyx_t_4);
48105 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_eps, __pyx_t_4) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
48106 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48107 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
48108 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error)
48109 3 : __Pyx_GOTREF(__pyx_t_4);
48110 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48111 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48112 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48113 3 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
48114 3 : PyObject* sequence = __pyx_t_4;
48115 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
48116 3 : if (unlikely(size != 2)) {
48117 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
48118 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
48119 0 : __PYX_ERR(0, 1419, __pyx_L1_error)
48120 : }
48121 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
48122 3 : if (likely(PyTuple_CheckExact(sequence))) {
48123 3 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
48124 3 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
48125 : } else {
48126 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
48127 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
48128 : }
48129 3 : __Pyx_INCREF(__pyx_t_3);
48130 3 : __Pyx_INCREF(__pyx_t_2);
48131 : #else
48132 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
48133 : __Pyx_GOTREF(__pyx_t_3);
48134 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error)
48135 : __Pyx_GOTREF(__pyx_t_2);
48136 : #endif
48137 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48138 : } else {
48139 0 : Py_ssize_t index = -1;
48140 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error)
48141 0 : __Pyx_GOTREF(__pyx_t_1);
48142 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48143 0 : __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
48144 0 : index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
48145 0 : __Pyx_GOTREF(__pyx_t_3);
48146 0 : index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
48147 0 : __Pyx_GOTREF(__pyx_t_2);
48148 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1419, __pyx_L1_error)
48149 0 : __pyx_t_5 = NULL;
48150 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48151 0 : goto __pyx_L4_unpacking_done;
48152 0 : __pyx_L3_unpacking_failed:;
48153 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48154 0 : __pyx_t_5 = NULL;
48155 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
48156 0 : __PYX_ERR(0, 1419, __pyx_L1_error)
48157 0 : __pyx_L4_unpacking_done:;
48158 : }
48159 3 : __pyx_v_krank = __pyx_t_3;
48160 3 : __pyx_t_3 = 0;
48161 3 : __pyx_v_proj = __pyx_t_2;
48162 3 : __pyx_t_2 = 0;
48163 :
48164 : /* "scipy/linalg/_decomp_interpolative.pyx":1420
48165 : * rng):
48166 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
48167 : * if krank != 0: # <<<<<<<<<<<<<<
48168 : * proj = proj[:krank, :]
48169 : * return idzp_id(proj, eps=eps)
48170 : */
48171 3 : __pyx_t_6 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_krank, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1420, __pyx_L1_error)
48172 3 : if (__pyx_t_6) {
48173 :
48174 : /* "scipy/linalg/_decomp_interpolative.pyx":1421
48175 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
48176 : * if krank != 0:
48177 : * proj = proj[:krank, :] # <<<<<<<<<<<<<<
48178 : * return idzp_id(proj, eps=eps)
48179 : *
48180 : */
48181 2 : __pyx_t_4 = PySlice_New(Py_None, __pyx_v_krank, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error)
48182 2 : __Pyx_GOTREF(__pyx_t_4);
48183 2 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
48184 2 : __Pyx_GOTREF(__pyx_t_2);
48185 2 : __Pyx_GIVEREF(__pyx_t_4);
48186 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error);
48187 2 : __Pyx_INCREF(__pyx_slice__5);
48188 2 : __Pyx_GIVEREF(__pyx_slice__5);
48189 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 1421, __pyx_L1_error);
48190 2 : __pyx_t_4 = 0;
48191 2 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_proj, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error)
48192 2 : __Pyx_GOTREF(__pyx_t_4);
48193 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48194 2 : __Pyx_DECREF_SET(__pyx_v_proj, __pyx_t_4);
48195 2 : __pyx_t_4 = 0;
48196 :
48197 : /* "scipy/linalg/_decomp_interpolative.pyx":1422
48198 : * if krank != 0:
48199 : * proj = proj[:krank, :]
48200 : * return idzp_id(proj, eps=eps) # <<<<<<<<<<<<<<
48201 : *
48202 : * return idzp_id(a, eps=eps)
48203 : */
48204 2 : __Pyx_XDECREF(__pyx_r);
48205 2 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idzp_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error)
48206 2 : __Pyx_GOTREF(__pyx_t_4);
48207 2 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
48208 2 : __Pyx_GOTREF(__pyx_t_2);
48209 2 : __Pyx_INCREF(__pyx_v_proj);
48210 2 : __Pyx_GIVEREF(__pyx_v_proj);
48211 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_proj)) __PYX_ERR(0, 1422, __pyx_L1_error);
48212 2 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error)
48213 2 : __Pyx_GOTREF(__pyx_t_3);
48214 2 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
48215 2 : __Pyx_GOTREF(__pyx_t_1);
48216 2 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_eps, __pyx_t_1) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
48217 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48218 2 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
48219 2 : __Pyx_GOTREF(__pyx_t_1);
48220 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48221 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48222 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48223 2 : __pyx_r = __pyx_t_1;
48224 2 : __pyx_t_1 = 0;
48225 2 : goto __pyx_L0;
48226 :
48227 : /* "scipy/linalg/_decomp_interpolative.pyx":1420
48228 : * rng):
48229 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
48230 : * if krank != 0: # <<<<<<<<<<<<<<
48231 : * proj = proj[:krank, :]
48232 : * return idzp_id(proj, eps=eps)
48233 : */
48234 : }
48235 :
48236 : /* "scipy/linalg/_decomp_interpolative.pyx":1424
48237 : * return idzp_id(proj, eps=eps)
48238 : *
48239 : * return idzp_id(a, eps=eps) # <<<<<<<<<<<<<<
48240 : *
48241 : *
48242 : */
48243 1 : __Pyx_XDECREF(__pyx_r);
48244 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idzp_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
48245 1 : __Pyx_GOTREF(__pyx_t_1);
48246 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
48247 1 : __Pyx_GOTREF(__pyx_t_3);
48248 1 : __Pyx_INCREF((PyObject *)__pyx_v_a);
48249 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_a);
48250 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_a))) __PYX_ERR(0, 1424, __pyx_L1_error);
48251 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error)
48252 1 : __Pyx_GOTREF(__pyx_t_2);
48253 1 : __pyx_t_4 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1424, __pyx_L1_error)
48254 1 : __Pyx_GOTREF(__pyx_t_4);
48255 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_eps, __pyx_t_4) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
48256 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48257 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1424, __pyx_L1_error)
48258 1 : __Pyx_GOTREF(__pyx_t_4);
48259 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48260 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48261 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48262 1 : __pyx_r = __pyx_t_4;
48263 1 : __pyx_t_4 = 0;
48264 1 : goto __pyx_L0;
48265 :
48266 : /* "scipy/linalg/_decomp_interpolative.pyx":1417
48267 : *
48268 : *
48269 : * def idzp_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
48270 : * rng):
48271 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
48272 : */
48273 :
48274 : /* function exit code */
48275 0 : __pyx_L1_error:;
48276 0 : __Pyx_XDECREF(__pyx_t_1);
48277 0 : __Pyx_XDECREF(__pyx_t_2);
48278 0 : __Pyx_XDECREF(__pyx_t_3);
48279 0 : __Pyx_XDECREF(__pyx_t_4);
48280 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
48281 0 : __Pyx_PyThreadState_declare
48282 0 : __Pyx_PyThreadState_assign
48283 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
48284 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
48285 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
48286 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
48287 0 : __pyx_r = NULL;
48288 0 : goto __pyx_L2;
48289 3 : __pyx_L0:;
48290 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
48291 3 : __pyx_L2:;
48292 3 : __Pyx_XDECREF(__pyx_v_krank);
48293 3 : __Pyx_XDECREF(__pyx_v_proj);
48294 3 : __Pyx_XGIVEREF(__pyx_r);
48295 3 : __Pyx_RefNannyFinishContext();
48296 3 : return __pyx_r;
48297 : }
48298 :
48299 : /* "scipy/linalg/_decomp_interpolative.pyx":1427
48300 : *
48301 : *
48302 : * def idzp_asvd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps, *, # <<<<<<<<<<<<<<
48303 : * rng):
48304 : * cdef int m = a.shape[0], n = a.shape[1]
48305 : */
48306 :
48307 : /* Python wrapper */
48308 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_55idzp_asvd(PyObject *__pyx_self,
48309 : #if CYTHON_METH_FASTCALL
48310 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
48311 : #else
48312 : PyObject *__pyx_args, PyObject *__pyx_kwds
48313 : #endif
48314 : ); /*proto*/
48315 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_55idzp_asvd = {"idzp_asvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_55idzp_asvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
48316 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_55idzp_asvd(PyObject *__pyx_self,
48317 : #if CYTHON_METH_FASTCALL
48318 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
48319 : #else
48320 : PyObject *__pyx_args, PyObject *__pyx_kwds
48321 : #endif
48322 : ) {
48323 1 : PyArrayObject *__pyx_v_a = 0;
48324 1 : __pyx_t_5numpy_float64_t __pyx_v_eps;
48325 1 : PyObject *__pyx_v_rng = 0;
48326 : #if !CYTHON_METH_FASTCALL
48327 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
48328 : #endif
48329 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
48330 1 : PyObject* values[3] = {0,0,0};
48331 1 : int __pyx_lineno = 0;
48332 1 : const char *__pyx_filename = NULL;
48333 1 : int __pyx_clineno = 0;
48334 1 : PyObject *__pyx_r = 0;
48335 : __Pyx_RefNannyDeclarations
48336 1 : __Pyx_RefNannySetupContext("idzp_asvd (wrapper)", 0);
48337 : #if !CYTHON_METH_FASTCALL
48338 : #if CYTHON_ASSUME_SAFE_MACROS
48339 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
48340 : #else
48341 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
48342 : #endif
48343 : #endif
48344 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
48345 : {
48346 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
48347 1 : if (likely(__pyx_kwds)) {
48348 1 : Py_ssize_t kw_args;
48349 1 : switch (__pyx_nargs) {
48350 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
48351 1 : CYTHON_FALLTHROUGH;
48352 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
48353 1 : CYTHON_FALLTHROUGH;
48354 1 : case 0: break;
48355 0 : default: goto __pyx_L5_argtuple_error;
48356 : }
48357 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
48358 1 : switch (__pyx_nargs) {
48359 : case 0:
48360 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
48361 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
48362 0 : kw_args--;
48363 : }
48364 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
48365 0 : else goto __pyx_L5_argtuple_error;
48366 0 : CYTHON_FALLTHROUGH;
48367 : case 1:
48368 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
48369 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
48370 0 : kw_args--;
48371 : }
48372 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
48373 : else {
48374 0 : __Pyx_RaiseArgtupleInvalid("idzp_asvd", 1, 2, 2, 1); __PYX_ERR(0, 1427, __pyx_L3_error)
48375 : }
48376 1 : CYTHON_FALLTHROUGH;
48377 : case 2:
48378 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
48379 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
48380 1 : kw_args--;
48381 : }
48382 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
48383 : else {
48384 0 : __Pyx_RaiseKeywordRequired("idzp_asvd", __pyx_n_s_rng); __PYX_ERR(0, 1427, __pyx_L3_error)
48385 : }
48386 : }
48387 1 : if (unlikely(kw_args > 0)) {
48388 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
48389 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_asvd") < 0)) __PYX_ERR(0, 1427, __pyx_L3_error)
48390 : }
48391 0 : } else if (unlikely(__pyx_nargs != 2)) {
48392 0 : goto __pyx_L5_argtuple_error;
48393 : } else {
48394 0 : __Pyx_RaiseKeywordRequired("idzp_asvd", __pyx_n_s_rng); __PYX_ERR(0, 1427, __pyx_L3_error)
48395 : }
48396 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
48397 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L3_error)
48398 1 : __pyx_v_rng = values[2];
48399 : }
48400 1 : goto __pyx_L6_skip;
48401 0 : __pyx_L5_argtuple_error:;
48402 0 : __Pyx_RaiseArgtupleInvalid("idzp_asvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1427, __pyx_L3_error)
48403 1 : __pyx_L6_skip:;
48404 1 : goto __pyx_L4_argument_unpacking_done;
48405 0 : __pyx_L3_error:;
48406 : {
48407 0 : Py_ssize_t __pyx_temp;
48408 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
48409 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
48410 : }
48411 : }
48412 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
48413 0 : __Pyx_RefNannyFinishContext();
48414 0 : return NULL;
48415 1 : __pyx_L4_argument_unpacking_done:;
48416 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1427, __pyx_L1_error)
48417 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_54idzp_asvd(__pyx_self, __pyx_v_a, __pyx_v_eps, __pyx_v_rng);
48418 :
48419 : /* function exit code */
48420 1 : goto __pyx_L0;
48421 0 : __pyx_L1_error:;
48422 0 : __pyx_r = NULL;
48423 1 : __pyx_L0:;
48424 : {
48425 1 : Py_ssize_t __pyx_temp;
48426 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
48427 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
48428 : }
48429 : }
48430 : __Pyx_RefNannyFinishContext();
48431 : return __pyx_r;
48432 : }
48433 :
48434 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_54idzp_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
48435 1 : int __pyx_v_m;
48436 1 : int __pyx_v_n;
48437 1 : int __pyx_v_krank;
48438 1 : int __pyx_v_info;
48439 1 : int __pyx_v_ci;
48440 1 : PyArrayObject *__pyx_v_C = 0;
48441 1 : PyArrayObject *__pyx_v_tau1 = 0;
48442 1 : PyArrayObject *__pyx_v_tau2 = 0;
48443 1 : PyArrayObject *__pyx_v_UU = 0;
48444 1 : PyArrayObject *__pyx_v_S = 0;
48445 1 : PyArrayObject *__pyx_v_V = 0;
48446 1 : PyArrayObject *__pyx_v_VV = 0;
48447 1 : PyArrayObject *__pyx_v_proj = 0;
48448 1 : PyArrayObject *__pyx_v_perms = 0;
48449 1 : PyArrayObject *__pyx_v_inds1 = 0;
48450 1 : PyArrayObject *__pyx_v_inds2 = 0;
48451 1 : PyArrayObject *__pyx_v_p = 0;
48452 1 : PyArrayObject *__pyx_v_col = 0;
48453 1 : PyObject *__pyx_v_r = NULL;
48454 1 : PyObject *__pyx_v_t = NULL;
48455 1 : PyObject *__pyx_v_r2 = NULL;
48456 1 : PyObject *__pyx_v_r3 = NULL;
48457 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
48458 1 : __Pyx_Buffer __pyx_pybuffer_C;
48459 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
48460 1 : __Pyx_Buffer __pyx_pybuffer_S;
48461 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
48462 1 : __Pyx_Buffer __pyx_pybuffer_UU;
48463 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
48464 1 : __Pyx_Buffer __pyx_pybuffer_V;
48465 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
48466 1 : __Pyx_Buffer __pyx_pybuffer_VV;
48467 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
48468 1 : __Pyx_Buffer __pyx_pybuffer_a;
48469 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
48470 1 : __Pyx_Buffer __pyx_pybuffer_col;
48471 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
48472 1 : __Pyx_Buffer __pyx_pybuffer_inds1;
48473 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
48474 1 : __Pyx_Buffer __pyx_pybuffer_inds2;
48475 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
48476 1 : __Pyx_Buffer __pyx_pybuffer_p;
48477 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
48478 1 : __Pyx_Buffer __pyx_pybuffer_perms;
48479 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
48480 1 : __Pyx_Buffer __pyx_pybuffer_proj;
48481 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
48482 1 : __Pyx_Buffer __pyx_pybuffer_tau1;
48483 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
48484 1 : __Pyx_Buffer __pyx_pybuffer_tau2;
48485 1 : PyObject *__pyx_r = NULL;
48486 : __Pyx_RefNannyDeclarations
48487 1 : PyObject *__pyx_t_1 = NULL;
48488 1 : PyObject *__pyx_t_2 = NULL;
48489 1 : PyObject *__pyx_t_3 = NULL;
48490 1 : PyObject *__pyx_t_4 = NULL;
48491 1 : unsigned int __pyx_t_5;
48492 1 : PyObject *__pyx_t_6 = NULL;
48493 1 : PyObject *(*__pyx_t_7)(PyObject *);
48494 1 : int __pyx_t_8;
48495 1 : PyArrayObject *__pyx_t_9 = NULL;
48496 1 : PyObject *__pyx_t_10 = NULL;
48497 1 : PyObject *__pyx_t_11 = NULL;
48498 1 : PyObject *__pyx_t_12 = NULL;
48499 1 : PyArrayObject *__pyx_t_13 = NULL;
48500 1 : int __pyx_t_14;
48501 1 : npy_intp __pyx_t_15[2];
48502 1 : PyArrayObject *__pyx_t_16 = NULL;
48503 1 : npy_intp __pyx_t_17[2];
48504 1 : PyArrayObject *__pyx_t_18 = NULL;
48505 1 : npy_intp __pyx_t_19[2];
48506 1 : PyArrayObject *__pyx_t_20 = NULL;
48507 1 : PyArrayObject *__pyx_t_21 = NULL;
48508 1 : int __pyx_t_22;
48509 1 : int __pyx_t_23;
48510 1 : Py_ssize_t __pyx_t_24;
48511 1 : Py_ssize_t __pyx_t_25;
48512 1 : npy_int64 __pyx_t_26;
48513 1 : PyArrayObject *__pyx_t_27 = NULL;
48514 1 : PyArrayObject *__pyx_t_28 = NULL;
48515 1 : PyArrayObject *__pyx_t_29 = NULL;
48516 1 : PyArrayObject *__pyx_t_30 = NULL;
48517 1 : PyObject *__pyx_t_31 = NULL;
48518 1 : PyObject *__pyx_t_32 = NULL;
48519 1 : PyArrayObject *__pyx_t_33 = NULL;
48520 1 : PyArrayObject *__pyx_t_34 = NULL;
48521 1 : PyArrayObject *__pyx_t_35 = NULL;
48522 1 : Py_ssize_t __pyx_t_36;
48523 1 : Py_ssize_t __pyx_t_37;
48524 1 : Py_ssize_t __pyx_t_38;
48525 1 : Py_ssize_t __pyx_t_39;
48526 1 : Py_ssize_t __pyx_t_40;
48527 1 : int __pyx_lineno = 0;
48528 1 : const char *__pyx_filename = NULL;
48529 1 : int __pyx_clineno = 0;
48530 1 : __Pyx_RefNannySetupContext("idzp_asvd", 1);
48531 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
48532 1 : __pyx_pybuffer_C.refcount = 0;
48533 1 : __pyx_pybuffernd_C.data = NULL;
48534 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
48535 1 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
48536 1 : __pyx_pybuffer_tau1.refcount = 0;
48537 1 : __pyx_pybuffernd_tau1.data = NULL;
48538 1 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
48539 1 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
48540 1 : __pyx_pybuffer_tau2.refcount = 0;
48541 1 : __pyx_pybuffernd_tau2.data = NULL;
48542 1 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
48543 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
48544 1 : __pyx_pybuffer_UU.refcount = 0;
48545 1 : __pyx_pybuffernd_UU.data = NULL;
48546 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
48547 1 : __pyx_pybuffer_S.pybuffer.buf = NULL;
48548 1 : __pyx_pybuffer_S.refcount = 0;
48549 1 : __pyx_pybuffernd_S.data = NULL;
48550 1 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
48551 1 : __pyx_pybuffer_V.pybuffer.buf = NULL;
48552 1 : __pyx_pybuffer_V.refcount = 0;
48553 1 : __pyx_pybuffernd_V.data = NULL;
48554 1 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
48555 1 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
48556 1 : __pyx_pybuffer_VV.refcount = 0;
48557 1 : __pyx_pybuffernd_VV.data = NULL;
48558 1 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
48559 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
48560 1 : __pyx_pybuffer_proj.refcount = 0;
48561 1 : __pyx_pybuffernd_proj.data = NULL;
48562 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
48563 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
48564 1 : __pyx_pybuffer_perms.refcount = 0;
48565 1 : __pyx_pybuffernd_perms.data = NULL;
48566 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
48567 1 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
48568 1 : __pyx_pybuffer_inds1.refcount = 0;
48569 1 : __pyx_pybuffernd_inds1.data = NULL;
48570 1 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
48571 1 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
48572 1 : __pyx_pybuffer_inds2.refcount = 0;
48573 1 : __pyx_pybuffernd_inds2.data = NULL;
48574 1 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
48575 1 : __pyx_pybuffer_p.pybuffer.buf = NULL;
48576 1 : __pyx_pybuffer_p.refcount = 0;
48577 1 : __pyx_pybuffernd_p.data = NULL;
48578 1 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
48579 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
48580 1 : __pyx_pybuffer_col.refcount = 0;
48581 1 : __pyx_pybuffernd_col.data = NULL;
48582 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
48583 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
48584 1 : __pyx_pybuffer_a.refcount = 0;
48585 1 : __pyx_pybuffernd_a.data = NULL;
48586 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
48587 : {
48588 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48589 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1427, __pyx_L1_error)
48590 : }
48591 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
48592 :
48593 : /* "scipy/linalg/_decomp_interpolative.pyx":1429
48594 : * def idzp_asvd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps, *,
48595 : * rng):
48596 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
48597 : * cdef int krank, info, ci
48598 : * cdef cnp.ndarray[cnp.complex128_t, mode='fortran', ndim=2] C
48599 : */
48600 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
48601 1 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
48602 :
48603 : /* "scipy/linalg/_decomp_interpolative.pyx":1445
48604 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] col
48605 : *
48606 : * krank, perms, proj = idzp_aid(a.copy(), eps, rng=rng) # <<<<<<<<<<<<<<
48607 : *
48608 : * if krank > 0:
48609 : */
48610 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idzp_aid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error)
48611 1 : __Pyx_GOTREF(__pyx_t_1);
48612 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
48613 1 : __Pyx_GOTREF(__pyx_t_3);
48614 1 : __pyx_t_4 = NULL;
48615 1 : __pyx_t_5 = 0;
48616 : #if CYTHON_UNPACK_METHODS
48617 1 : if (likely(PyMethod_Check(__pyx_t_3))) {
48618 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
48619 0 : if (likely(__pyx_t_4)) {
48620 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
48621 0 : __Pyx_INCREF(__pyx_t_4);
48622 0 : __Pyx_INCREF(function);
48623 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
48624 : __pyx_t_5 = 1;
48625 : }
48626 : }
48627 : #endif
48628 : {
48629 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
48630 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
48631 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
48632 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error)
48633 1 : __Pyx_GOTREF(__pyx_t_2);
48634 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48635 : }
48636 1 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
48637 1 : __Pyx_GOTREF(__pyx_t_3);
48638 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
48639 1 : __Pyx_GOTREF(__pyx_t_4);
48640 1 : __Pyx_GIVEREF(__pyx_t_2);
48641 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error);
48642 1 : __Pyx_GIVEREF(__pyx_t_3);
48643 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error);
48644 1 : __pyx_t_2 = 0;
48645 1 : __pyx_t_3 = 0;
48646 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
48647 1 : __Pyx_GOTREF(__pyx_t_3);
48648 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1445, __pyx_L1_error)
48649 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error)
48650 1 : __Pyx_GOTREF(__pyx_t_2);
48651 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48652 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48653 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48654 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
48655 1 : PyObject* sequence = __pyx_t_2;
48656 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
48657 1 : if (unlikely(size != 3)) {
48658 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
48659 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
48660 0 : __PYX_ERR(0, 1445, __pyx_L1_error)
48661 : }
48662 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
48663 1 : if (likely(PyTuple_CheckExact(sequence))) {
48664 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
48665 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
48666 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
48667 : } else {
48668 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
48669 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
48670 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
48671 : }
48672 1 : __Pyx_INCREF(__pyx_t_3);
48673 1 : __Pyx_INCREF(__pyx_t_4);
48674 1 : __Pyx_INCREF(__pyx_t_1);
48675 : #else
48676 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
48677 : __Pyx_GOTREF(__pyx_t_3);
48678 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
48679 : __Pyx_GOTREF(__pyx_t_4);
48680 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error)
48681 : __Pyx_GOTREF(__pyx_t_1);
48682 : #endif
48683 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48684 : } else {
48685 0 : Py_ssize_t index = -1;
48686 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1445, __pyx_L1_error)
48687 0 : __Pyx_GOTREF(__pyx_t_6);
48688 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48689 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
48690 0 : index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
48691 0 : __Pyx_GOTREF(__pyx_t_3);
48692 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
48693 0 : __Pyx_GOTREF(__pyx_t_4);
48694 0 : index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
48695 0 : __Pyx_GOTREF(__pyx_t_1);
48696 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1445, __pyx_L1_error)
48697 0 : __pyx_t_7 = NULL;
48698 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48699 0 : goto __pyx_L4_unpacking_done;
48700 0 : __pyx_L3_unpacking_failed:;
48701 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48702 0 : __pyx_t_7 = NULL;
48703 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
48704 0 : __PYX_ERR(0, 1445, __pyx_L1_error)
48705 0 : __pyx_L4_unpacking_done:;
48706 : }
48707 1 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1445, __pyx_L1_error)
48708 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48709 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1445, __pyx_L1_error)
48710 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1445, __pyx_L1_error)
48711 1 : __pyx_v_krank = __pyx_t_8;
48712 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
48713 : {
48714 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48715 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
48716 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
48717 1 : if (unlikely(__pyx_t_8 < 0)) {
48718 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
48719 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
48720 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
48721 : __Pyx_RaiseBufferFallbackError();
48722 : } else {
48723 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
48724 : }
48725 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
48726 : }
48727 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
48728 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1445, __pyx_L1_error)
48729 : }
48730 1 : __pyx_t_9 = 0;
48731 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_4);
48732 1 : __pyx_t_4 = 0;
48733 1 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
48734 : {
48735 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48736 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
48737 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
48738 1 : if (unlikely(__pyx_t_8 < 0)) {
48739 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
48740 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
48741 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
48742 : __Pyx_RaiseBufferFallbackError();
48743 : } else {
48744 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
48745 : }
48746 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
48747 : }
48748 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
48749 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1445, __pyx_L1_error)
48750 : }
48751 1 : __pyx_t_13 = 0;
48752 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_1);
48753 1 : __pyx_t_1 = 0;
48754 :
48755 : /* "scipy/linalg/_decomp_interpolative.pyx":1447
48756 : * krank, perms, proj = idzp_aid(a.copy(), eps, rng=rng)
48757 : *
48758 : * if krank > 0: # <<<<<<<<<<<<<<
48759 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
48760 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
48761 : */
48762 1 : __pyx_t_14 = (__pyx_v_krank > 0);
48763 1 : if (__pyx_t_14) {
48764 :
48765 : /* "scipy/linalg/_decomp_interpolative.pyx":1448
48766 : *
48767 : * if krank > 0:
48768 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
48769 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
48770 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
48771 : */
48772 1 : __pyx_t_15[0] = __pyx_v_m;
48773 1 : __pyx_t_15[1] = __pyx_v_krank;
48774 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_15, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error)
48775 1 : __Pyx_GOTREF(__pyx_t_2);
48776 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1448, __pyx_L1_error)
48777 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
48778 : {
48779 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48780 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
48781 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
48782 1 : if (unlikely(__pyx_t_8 < 0)) {
48783 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
48784 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
48785 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
48786 : __Pyx_RaiseBufferFallbackError();
48787 : } else {
48788 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
48789 : }
48790 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
48791 : }
48792 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
48793 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1448, __pyx_L1_error)
48794 : }
48795 1 : __pyx_t_16 = 0;
48796 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
48797 1 : __pyx_t_2 = 0;
48798 :
48799 : /* "scipy/linalg/_decomp_interpolative.pyx":1449
48800 : * if krank > 0:
48801 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
48802 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
48803 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
48804 : * col = a[:, perms[:krank]].copy()
48805 : */
48806 1 : __pyx_t_17[0] = __pyx_v_n;
48807 1 : __pyx_t_17[1] = __pyx_v_krank;
48808 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_17, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
48809 1 : __Pyx_GOTREF(__pyx_t_2);
48810 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1449, __pyx_L1_error)
48811 1 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_2);
48812 : {
48813 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48814 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
48815 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
48816 1 : if (unlikely(__pyx_t_8 < 0)) {
48817 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
48818 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
48819 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
48820 : __Pyx_RaiseBufferFallbackError();
48821 : } else {
48822 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
48823 : }
48824 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
48825 : }
48826 1 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
48827 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1449, __pyx_L1_error)
48828 : }
48829 1 : __pyx_t_18 = 0;
48830 1 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_2);
48831 1 : __pyx_t_2 = 0;
48832 :
48833 : /* "scipy/linalg/_decomp_interpolative.pyx":1450
48834 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
48835 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
48836 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
48837 : * col = a[:, perms[:krank]].copy()
48838 : *
48839 : */
48840 1 : __pyx_t_19[0] = __pyx_v_krank;
48841 1 : __pyx_t_19[1] = __pyx_v_n;
48842 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_19, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
48843 1 : __Pyx_GOTREF(__pyx_t_2);
48844 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1450, __pyx_L1_error)
48845 1 : __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
48846 : {
48847 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48848 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
48849 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
48850 1 : if (unlikely(__pyx_t_8 < 0)) {
48851 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
48852 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
48853 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
48854 : __Pyx_RaiseBufferFallbackError();
48855 : } else {
48856 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
48857 : }
48858 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
48859 : }
48860 1 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
48861 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1450, __pyx_L1_error)
48862 : }
48863 1 : __pyx_t_20 = 0;
48864 1 : __pyx_v_p = ((PyArrayObject *)__pyx_t_2);
48865 1 : __pyx_t_2 = 0;
48866 :
48867 : /* "scipy/linalg/_decomp_interpolative.pyx":1451
48868 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
48869 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
48870 : * col = a[:, perms[:krank]].copy() # <<<<<<<<<<<<<<
48871 : *
48872 : * # idd_reconint
48873 : */
48874 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
48875 1 : __Pyx_GOTREF(__pyx_t_1);
48876 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error)
48877 1 : __Pyx_GOTREF(__pyx_t_4);
48878 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48879 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
48880 1 : __Pyx_GOTREF(__pyx_t_1);
48881 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48882 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error)
48883 1 : __Pyx_GOTREF(__pyx_t_4);
48884 1 : __Pyx_INCREF(__pyx_slice__5);
48885 1 : __Pyx_GIVEREF(__pyx_slice__5);
48886 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 1451, __pyx_L1_error);
48887 1 : __Pyx_GIVEREF(__pyx_t_1);
48888 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error);
48889 1 : __pyx_t_1 = 0;
48890 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
48891 1 : __Pyx_GOTREF(__pyx_t_1);
48892 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48893 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error)
48894 1 : __Pyx_GOTREF(__pyx_t_4);
48895 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48896 1 : __pyx_t_1 = NULL;
48897 1 : __pyx_t_5 = 0;
48898 : #if CYTHON_UNPACK_METHODS
48899 1 : if (likely(PyMethod_Check(__pyx_t_4))) {
48900 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
48901 0 : if (likely(__pyx_t_1)) {
48902 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
48903 0 : __Pyx_INCREF(__pyx_t_1);
48904 0 : __Pyx_INCREF(function);
48905 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
48906 : __pyx_t_5 = 1;
48907 : }
48908 : }
48909 : #endif
48910 : {
48911 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
48912 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
48913 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48914 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error)
48915 1 : __Pyx_GOTREF(__pyx_t_2);
48916 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48917 : }
48918 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1451, __pyx_L1_error)
48919 1 : __pyx_t_21 = ((PyArrayObject *)__pyx_t_2);
48920 : {
48921 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
48922 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
48923 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
48924 1 : if (unlikely(__pyx_t_8 < 0)) {
48925 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
48926 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
48927 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
48928 : __Pyx_RaiseBufferFallbackError();
48929 : } else {
48930 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
48931 : }
48932 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
48933 : }
48934 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
48935 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1451, __pyx_L1_error)
48936 : }
48937 1 : __pyx_t_21 = 0;
48938 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_2);
48939 1 : __pyx_t_2 = 0;
48940 :
48941 : /* "scipy/linalg/_decomp_interpolative.pyx":1454
48942 : *
48943 : * # idd_reconint
48944 : * for ci in range(krank): # <<<<<<<<<<<<<<
48945 : * p[ci, perms[ci]] = 1.0
48946 : *
48947 : */
48948 1 : __pyx_t_8 = __pyx_v_krank;
48949 1 : __pyx_t_22 = __pyx_t_8;
48950 20 : for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
48951 19 : __pyx_v_ci = __pyx_t_23;
48952 :
48953 : /* "scipy/linalg/_decomp_interpolative.pyx":1455
48954 : * # idd_reconint
48955 : * for ci in range(krank):
48956 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
48957 : *
48958 : * p[:, perms[krank:]] = proj[:, :]
48959 : */
48960 19 : __pyx_t_24 = __pyx_v_ci;
48961 19 : __pyx_t_25 = __pyx_v_ci;
48962 19 : __pyx_t_26 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_perms.diminfo[0].strides));
48963 19 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_p.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1.0, 0);
48964 : }
48965 :
48966 : /* "scipy/linalg/_decomp_interpolative.pyx":1457
48967 : * p[ci, perms[ci]] = 1.0
48968 : *
48969 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
48970 : * inds1, tau1 = idzr_qrpiv(col, krank)
48971 : * # idz_rinqr and idz_rearr
48972 : */
48973 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __pyx_L1_error)
48974 1 : __Pyx_GOTREF(__pyx_t_2);
48975 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error)
48976 1 : __Pyx_GOTREF(__pyx_t_4);
48977 1 : __pyx_t_1 = PySlice_New(__pyx_t_4, Py_None, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
48978 1 : __Pyx_GOTREF(__pyx_t_1);
48979 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48980 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error)
48981 1 : __Pyx_GOTREF(__pyx_t_4);
48982 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48983 1 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error)
48984 1 : __Pyx_GOTREF(__pyx_t_1);
48985 1 : __Pyx_INCREF(__pyx_slice__5);
48986 1 : __Pyx_GIVEREF(__pyx_slice__5);
48987 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1457, __pyx_L1_error);
48988 1 : __Pyx_GIVEREF(__pyx_t_4);
48989 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error);
48990 1 : __pyx_t_4 = 0;
48991 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 1457, __pyx_L1_error)
48992 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48993 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48994 :
48995 : /* "scipy/linalg/_decomp_interpolative.pyx":1458
48996 : *
48997 : * p[:, perms[krank:]] = proj[:, :]
48998 : * inds1, tau1 = idzr_qrpiv(col, krank) # <<<<<<<<<<<<<<
48999 : * # idz_rinqr and idz_rearr
49000 : * r = np.triu(col[:krank, :])
49001 : */
49002 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
49003 1 : __Pyx_GOTREF(__pyx_t_1);
49004 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
49005 1 : __Pyx_GOTREF(__pyx_t_4);
49006 1 : __pyx_t_3 = NULL;
49007 1 : __pyx_t_5 = 0;
49008 : #if CYTHON_UNPACK_METHODS
49009 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
49010 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
49011 0 : if (likely(__pyx_t_3)) {
49012 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49013 0 : __Pyx_INCREF(__pyx_t_3);
49014 0 : __Pyx_INCREF(function);
49015 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49016 : __pyx_t_5 = 1;
49017 : }
49018 : }
49019 : #endif
49020 : {
49021 1 : PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_col), __pyx_t_4};
49022 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
49023 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
49024 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49025 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error)
49026 1 : __Pyx_GOTREF(__pyx_t_2);
49027 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49028 : }
49029 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
49030 1 : PyObject* sequence = __pyx_t_2;
49031 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
49032 1 : if (unlikely(size != 2)) {
49033 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
49034 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
49035 0 : __PYX_ERR(0, 1458, __pyx_L1_error)
49036 : }
49037 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
49038 1 : if (likely(PyTuple_CheckExact(sequence))) {
49039 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
49040 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
49041 : } else {
49042 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
49043 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
49044 : }
49045 1 : __Pyx_INCREF(__pyx_t_1);
49046 1 : __Pyx_INCREF(__pyx_t_4);
49047 : #else
49048 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
49049 : __Pyx_GOTREF(__pyx_t_1);
49050 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
49051 : __Pyx_GOTREF(__pyx_t_4);
49052 : #endif
49053 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49054 : } else {
49055 0 : Py_ssize_t index = -1;
49056 0 : __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
49057 0 : __Pyx_GOTREF(__pyx_t_3);
49058 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49059 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
49060 0 : index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
49061 0 : __Pyx_GOTREF(__pyx_t_1);
49062 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
49063 0 : __Pyx_GOTREF(__pyx_t_4);
49064 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1458, __pyx_L1_error)
49065 0 : __pyx_t_7 = NULL;
49066 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49067 0 : goto __pyx_L9_unpacking_done;
49068 0 : __pyx_L8_unpacking_failed:;
49069 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49070 0 : __pyx_t_7 = NULL;
49071 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
49072 0 : __PYX_ERR(0, 1458, __pyx_L1_error)
49073 0 : __pyx_L9_unpacking_done:;
49074 : }
49075 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1458, __pyx_L1_error)
49076 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1458, __pyx_L1_error)
49077 1 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_1);
49078 : {
49079 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49080 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
49081 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
49082 1 : if (unlikely(__pyx_t_8 < 0)) {
49083 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
49084 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
49085 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
49086 : __Pyx_RaiseBufferFallbackError();
49087 : } else {
49088 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
49089 : }
49090 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
49091 : }
49092 1 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
49093 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1458, __pyx_L1_error)
49094 : }
49095 1 : __pyx_t_27 = 0;
49096 1 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_1);
49097 1 : __pyx_t_1 = 0;
49098 1 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_4);
49099 : {
49100 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49101 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
49102 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
49103 1 : if (unlikely(__pyx_t_8 < 0)) {
49104 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
49105 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
49106 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
49107 : __Pyx_RaiseBufferFallbackError();
49108 : } else {
49109 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
49110 : }
49111 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
49112 : }
49113 1 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
49114 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1458, __pyx_L1_error)
49115 : }
49116 1 : __pyx_t_28 = 0;
49117 1 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_4);
49118 1 : __pyx_t_4 = 0;
49119 :
49120 : /* "scipy/linalg/_decomp_interpolative.pyx":1460
49121 : * inds1, tau1 = idzr_qrpiv(col, krank)
49122 : * # idz_rinqr and idz_rearr
49123 : * r = np.triu(col[:krank, :]) # <<<<<<<<<<<<<<
49124 : * for ci in range(krank-1, -1, -1):
49125 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
49126 : */
49127 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
49128 1 : __Pyx_GOTREF(__pyx_t_4);
49129 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_triu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
49130 1 : __Pyx_GOTREF(__pyx_t_1);
49131 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49132 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
49133 1 : __Pyx_GOTREF(__pyx_t_4);
49134 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
49135 1 : __Pyx_GOTREF(__pyx_t_3);
49136 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49137 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
49138 1 : __Pyx_GOTREF(__pyx_t_4);
49139 1 : __Pyx_GIVEREF(__pyx_t_3);
49140 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error);
49141 1 : __Pyx_INCREF(__pyx_slice__5);
49142 1 : __Pyx_GIVEREF(__pyx_slice__5);
49143 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 1460, __pyx_L1_error);
49144 1 : __pyx_t_3 = 0;
49145 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
49146 1 : __Pyx_GOTREF(__pyx_t_3);
49147 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49148 1 : __pyx_t_4 = NULL;
49149 1 : __pyx_t_5 = 0;
49150 : #if CYTHON_UNPACK_METHODS
49151 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
49152 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
49153 0 : if (likely(__pyx_t_4)) {
49154 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49155 0 : __Pyx_INCREF(__pyx_t_4);
49156 0 : __Pyx_INCREF(function);
49157 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49158 : __pyx_t_5 = 1;
49159 : }
49160 : }
49161 : #endif
49162 : {
49163 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
49164 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
49165 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
49166 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49167 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
49168 1 : __Pyx_GOTREF(__pyx_t_2);
49169 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49170 : }
49171 1 : __pyx_v_r = __pyx_t_2;
49172 1 : __pyx_t_2 = 0;
49173 :
49174 : /* "scipy/linalg/_decomp_interpolative.pyx":1461
49175 : * # idz_rinqr and idz_rearr
49176 : * r = np.triu(col[:krank, :])
49177 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
49178 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
49179 : *
49180 : */
49181 20 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
49182 19 : __pyx_v_ci = __pyx_t_8;
49183 :
49184 : /* "scipy/linalg/_decomp_interpolative.pyx":1462
49185 : * r = np.triu(col[:krank, :])
49186 : * for ci in range(krank-1, -1, -1):
49187 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
49188 : *
49189 : * t = p.T.conj().copy()
49190 : */
49191 19 : __pyx_t_24 = __pyx_v_ci;
49192 19 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
49193 19 : __Pyx_GOTREF(__pyx_t_2);
49194 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
49195 19 : __Pyx_GOTREF(__pyx_t_1);
49196 19 : __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error)
49197 19 : __Pyx_GOTREF(__pyx_t_3);
49198 19 : __Pyx_GIVEREF(__pyx_t_2);
49199 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error);
49200 19 : __Pyx_GIVEREF(__pyx_t_1);
49201 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error);
49202 19 : __pyx_t_2 = 0;
49203 19 : __pyx_t_1 = 0;
49204 19 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
49205 19 : __Pyx_GOTREF(__pyx_t_1);
49206 19 : __Pyx_INCREF(__pyx_slice__5);
49207 19 : __Pyx_GIVEREF(__pyx_slice__5);
49208 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1462, __pyx_L1_error);
49209 19 : __Pyx_GIVEREF(__pyx_t_3);
49210 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error);
49211 19 : __pyx_t_3 = 0;
49212 19 : __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error)
49213 19 : __Pyx_GOTREF(__pyx_t_3);
49214 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49215 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
49216 19 : __Pyx_GOTREF(__pyx_t_1);
49217 19 : __pyx_t_24 = __pyx_v_ci;
49218 19 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
49219 19 : __Pyx_GOTREF(__pyx_t_2);
49220 19 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error)
49221 19 : __Pyx_GOTREF(__pyx_t_4);
49222 19 : __Pyx_GIVEREF(__pyx_t_1);
49223 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error);
49224 19 : __Pyx_GIVEREF(__pyx_t_2);
49225 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error);
49226 19 : __pyx_t_1 = 0;
49227 19 : __pyx_t_2 = 0;
49228 19 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
49229 19 : __Pyx_GOTREF(__pyx_t_2);
49230 19 : __Pyx_INCREF(__pyx_slice__5);
49231 19 : __Pyx_GIVEREF(__pyx_slice__5);
49232 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1462, __pyx_L1_error);
49233 19 : __Pyx_GIVEREF(__pyx_t_4);
49234 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error);
49235 19 : __pyx_t_4 = 0;
49236 19 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_2, __pyx_t_3) < 0))) __PYX_ERR(0, 1462, __pyx_L1_error)
49237 19 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49238 38 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49239 : }
49240 :
49241 : /* "scipy/linalg/_decomp_interpolative.pyx":1464
49242 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
49243 : *
49244 : * t = p.T.conj().copy() # <<<<<<<<<<<<<<
49245 : * inds2, tau2 = idzr_qrpiv(t, krank)
49246 : * r2 = np.triu(t[:krank, :])
49247 : */
49248 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1464, __pyx_L1_error)
49249 1 : __Pyx_GOTREF(__pyx_t_4);
49250 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_conj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
49251 1 : __Pyx_GOTREF(__pyx_t_1);
49252 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49253 1 : __pyx_t_4 = NULL;
49254 1 : __pyx_t_5 = 0;
49255 : #if CYTHON_UNPACK_METHODS
49256 1 : if (likely(PyMethod_Check(__pyx_t_1))) {
49257 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
49258 0 : if (likely(__pyx_t_4)) {
49259 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49260 0 : __Pyx_INCREF(__pyx_t_4);
49261 0 : __Pyx_INCREF(function);
49262 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49263 : __pyx_t_5 = 1;
49264 : }
49265 : }
49266 : #endif
49267 : {
49268 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
49269 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
49270 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
49271 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error)
49272 1 : __Pyx_GOTREF(__pyx_t_2);
49273 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49274 : }
49275 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
49276 1 : __Pyx_GOTREF(__pyx_t_1);
49277 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49278 1 : __pyx_t_2 = NULL;
49279 1 : __pyx_t_5 = 0;
49280 : #if CYTHON_UNPACK_METHODS
49281 1 : if (likely(PyMethod_Check(__pyx_t_1))) {
49282 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
49283 0 : if (likely(__pyx_t_2)) {
49284 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49285 0 : __Pyx_INCREF(__pyx_t_2);
49286 0 : __Pyx_INCREF(function);
49287 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49288 : __pyx_t_5 = 1;
49289 : }
49290 : }
49291 : #endif
49292 : {
49293 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
49294 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
49295 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
49296 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
49297 1 : __Pyx_GOTREF(__pyx_t_3);
49298 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49299 : }
49300 1 : __pyx_v_t = __pyx_t_3;
49301 1 : __pyx_t_3 = 0;
49302 :
49303 : /* "scipy/linalg/_decomp_interpolative.pyx":1465
49304 : *
49305 : * t = p.T.conj().copy()
49306 : * inds2, tau2 = idzr_qrpiv(t, krank) # <<<<<<<<<<<<<<
49307 : * r2 = np.triu(t[:krank, :])
49308 : * for ci in range(krank-1, -1, -1):
49309 : */
49310 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
49311 1 : __Pyx_GOTREF(__pyx_t_1);
49312 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
49313 1 : __Pyx_GOTREF(__pyx_t_2);
49314 1 : __pyx_t_4 = NULL;
49315 1 : __pyx_t_5 = 0;
49316 : #if CYTHON_UNPACK_METHODS
49317 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
49318 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
49319 0 : if (likely(__pyx_t_4)) {
49320 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49321 0 : __Pyx_INCREF(__pyx_t_4);
49322 0 : __Pyx_INCREF(function);
49323 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49324 : __pyx_t_5 = 1;
49325 : }
49326 : }
49327 : #endif
49328 : {
49329 1 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_t, __pyx_t_2};
49330 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
49331 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
49332 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49333 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
49334 1 : __Pyx_GOTREF(__pyx_t_3);
49335 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49336 : }
49337 1 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
49338 1 : PyObject* sequence = __pyx_t_3;
49339 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
49340 1 : if (unlikely(size != 2)) {
49341 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
49342 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
49343 0 : __PYX_ERR(0, 1465, __pyx_L1_error)
49344 : }
49345 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
49346 1 : if (likely(PyTuple_CheckExact(sequence))) {
49347 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
49348 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
49349 : } else {
49350 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
49351 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
49352 : }
49353 1 : __Pyx_INCREF(__pyx_t_1);
49354 1 : __Pyx_INCREF(__pyx_t_2);
49355 : #else
49356 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
49357 : __Pyx_GOTREF(__pyx_t_1);
49358 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
49359 : __Pyx_GOTREF(__pyx_t_2);
49360 : #endif
49361 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49362 : } else {
49363 0 : Py_ssize_t index = -1;
49364 0 : __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1465, __pyx_L1_error)
49365 0 : __Pyx_GOTREF(__pyx_t_4);
49366 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49367 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
49368 0 : index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
49369 0 : __Pyx_GOTREF(__pyx_t_1);
49370 0 : index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L12_unpacking_failed;
49371 0 : __Pyx_GOTREF(__pyx_t_2);
49372 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
49373 0 : __pyx_t_7 = NULL;
49374 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49375 0 : goto __pyx_L13_unpacking_done;
49376 0 : __pyx_L12_unpacking_failed:;
49377 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49378 0 : __pyx_t_7 = NULL;
49379 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
49380 0 : __PYX_ERR(0, 1465, __pyx_L1_error)
49381 0 : __pyx_L13_unpacking_done:;
49382 : }
49383 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1465, __pyx_L1_error)
49384 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1465, __pyx_L1_error)
49385 1 : __pyx_t_29 = ((PyArrayObject *)__pyx_t_1);
49386 : {
49387 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49388 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
49389 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
49390 1 : if (unlikely(__pyx_t_8 < 0)) {
49391 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
49392 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
49393 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
49394 : __Pyx_RaiseBufferFallbackError();
49395 : } else {
49396 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
49397 : }
49398 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
49399 : }
49400 1 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
49401 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1465, __pyx_L1_error)
49402 : }
49403 1 : __pyx_t_29 = 0;
49404 1 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_1);
49405 1 : __pyx_t_1 = 0;
49406 1 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_2);
49407 : {
49408 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49409 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
49410 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
49411 1 : if (unlikely(__pyx_t_8 < 0)) {
49412 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
49413 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
49414 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
49415 : __Pyx_RaiseBufferFallbackError();
49416 : } else {
49417 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
49418 : }
49419 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
49420 : }
49421 1 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
49422 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1465, __pyx_L1_error)
49423 : }
49424 1 : __pyx_t_30 = 0;
49425 1 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_2);
49426 1 : __pyx_t_2 = 0;
49427 :
49428 : /* "scipy/linalg/_decomp_interpolative.pyx":1466
49429 : * t = p.T.conj().copy()
49430 : * inds2, tau2 = idzr_qrpiv(t, krank)
49431 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
49432 : * for ci in range(krank-1, -1, -1):
49433 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
49434 : */
49435 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
49436 1 : __Pyx_GOTREF(__pyx_t_2);
49437 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_triu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L1_error)
49438 1 : __Pyx_GOTREF(__pyx_t_1);
49439 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49440 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
49441 1 : __Pyx_GOTREF(__pyx_t_2);
49442 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1466, __pyx_L1_error)
49443 1 : __Pyx_GOTREF(__pyx_t_4);
49444 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49445 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
49446 1 : __Pyx_GOTREF(__pyx_t_2);
49447 1 : __Pyx_GIVEREF(__pyx_t_4);
49448 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1466, __pyx_L1_error);
49449 1 : __Pyx_INCREF(__pyx_slice__5);
49450 1 : __Pyx_GIVEREF(__pyx_slice__5);
49451 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 1466, __pyx_L1_error);
49452 1 : __pyx_t_4 = 0;
49453 1 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1466, __pyx_L1_error)
49454 1 : __Pyx_GOTREF(__pyx_t_4);
49455 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49456 1 : __pyx_t_2 = NULL;
49457 1 : __pyx_t_5 = 0;
49458 : #if CYTHON_UNPACK_METHODS
49459 1 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
49460 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
49461 0 : if (likely(__pyx_t_2)) {
49462 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49463 0 : __Pyx_INCREF(__pyx_t_2);
49464 0 : __Pyx_INCREF(function);
49465 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
49466 : __pyx_t_5 = 1;
49467 : }
49468 : }
49469 : #endif
49470 : {
49471 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
49472 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
49473 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
49474 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49475 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1466, __pyx_L1_error)
49476 1 : __Pyx_GOTREF(__pyx_t_3);
49477 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49478 : }
49479 1 : __pyx_v_r2 = __pyx_t_3;
49480 1 : __pyx_t_3 = 0;
49481 :
49482 : /* "scipy/linalg/_decomp_interpolative.pyx":1467
49483 : * inds2, tau2 = idzr_qrpiv(t, krank)
49484 : * r2 = np.triu(t[:krank, :])
49485 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
49486 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
49487 : *
49488 : */
49489 20 : for (__pyx_t_8 = (__pyx_v_krank - 1); __pyx_t_8 > -1; __pyx_t_8-=1) {
49490 19 : __pyx_v_ci = __pyx_t_8;
49491 :
49492 : /* "scipy/linalg/_decomp_interpolative.pyx":1468
49493 : * r2 = np.triu(t[:krank, :])
49494 : * for ci in range(krank-1, -1, -1):
49495 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
49496 : *
49497 : * r3 = r @ r2.T.conj()
49498 : */
49499 19 : __pyx_t_24 = __pyx_v_ci;
49500 19 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error)
49501 19 : __Pyx_GOTREF(__pyx_t_3);
49502 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
49503 19 : __Pyx_GOTREF(__pyx_t_1);
49504 19 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error)
49505 19 : __Pyx_GOTREF(__pyx_t_4);
49506 19 : __Pyx_GIVEREF(__pyx_t_3);
49507 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error);
49508 19 : __Pyx_GIVEREF(__pyx_t_1);
49509 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error);
49510 19 : __pyx_t_3 = 0;
49511 19 : __pyx_t_1 = 0;
49512 19 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
49513 19 : __Pyx_GOTREF(__pyx_t_1);
49514 19 : __Pyx_INCREF(__pyx_slice__5);
49515 19 : __Pyx_GIVEREF(__pyx_slice__5);
49516 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1468, __pyx_L1_error);
49517 19 : __Pyx_GIVEREF(__pyx_t_4);
49518 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error);
49519 19 : __pyx_t_4 = 0;
49520 19 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error)
49521 19 : __Pyx_GOTREF(__pyx_t_4);
49522 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49523 19 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
49524 19 : __Pyx_GOTREF(__pyx_t_1);
49525 19 : __pyx_t_24 = __pyx_v_ci;
49526 19 : __pyx_t_3 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error)
49527 19 : __Pyx_GOTREF(__pyx_t_3);
49528 19 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error)
49529 19 : __Pyx_GOTREF(__pyx_t_2);
49530 19 : __Pyx_GIVEREF(__pyx_t_1);
49531 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error);
49532 19 : __Pyx_GIVEREF(__pyx_t_3);
49533 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error);
49534 19 : __pyx_t_1 = 0;
49535 19 : __pyx_t_3 = 0;
49536 19 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1468, __pyx_L1_error)
49537 19 : __Pyx_GOTREF(__pyx_t_3);
49538 19 : __Pyx_INCREF(__pyx_slice__5);
49539 19 : __Pyx_GIVEREF(__pyx_slice__5);
49540 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 1468, __pyx_L1_error);
49541 19 : __Pyx_GIVEREF(__pyx_t_2);
49542 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error);
49543 19 : __pyx_t_2 = 0;
49544 19 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_3, __pyx_t_4) < 0))) __PYX_ERR(0, 1468, __pyx_L1_error)
49545 19 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49546 38 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49547 : }
49548 :
49549 : /* "scipy/linalg/_decomp_interpolative.pyx":1470
49550 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
49551 : *
49552 : * r3 = r @ r2.T.conj() # <<<<<<<<<<<<<<
49553 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False)
49554 : *
49555 : */
49556 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1470, __pyx_L1_error)
49557 1 : __Pyx_GOTREF(__pyx_t_3);
49558 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
49559 1 : __Pyx_GOTREF(__pyx_t_2);
49560 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49561 1 : __pyx_t_3 = NULL;
49562 1 : __pyx_t_5 = 0;
49563 : #if CYTHON_UNPACK_METHODS
49564 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
49565 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
49566 0 : if (likely(__pyx_t_3)) {
49567 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
49568 0 : __Pyx_INCREF(__pyx_t_3);
49569 0 : __Pyx_INCREF(function);
49570 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
49571 : __pyx_t_5 = 1;
49572 : }
49573 : }
49574 : #endif
49575 : {
49576 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
49577 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
49578 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
49579 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1470, __pyx_L1_error)
49580 1 : __Pyx_GOTREF(__pyx_t_4);
49581 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49582 : }
49583 1 : __pyx_t_2 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
49584 1 : __Pyx_GOTREF(__pyx_t_2);
49585 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49586 1 : __pyx_v_r3 = __pyx_t_2;
49587 1 : __pyx_t_2 = 0;
49588 :
49589 : /* "scipy/linalg/_decomp_interpolative.pyx":1471
49590 : *
49591 : * r3 = r @ r2.T.conj()
49592 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False) # <<<<<<<<<<<<<<
49593 : *
49594 : * # Apply Q of col to U from the left
49595 : */
49596 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_la); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
49597 1 : __Pyx_GOTREF(__pyx_t_2);
49598 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error)
49599 1 : __Pyx_GOTREF(__pyx_t_4);
49600 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49601 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
49602 1 : __Pyx_GOTREF(__pyx_t_2);
49603 1 : __Pyx_INCREF(__pyx_v_r3);
49604 1 : __Pyx_GIVEREF(__pyx_v_r3);
49605 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_r3)) __PYX_ERR(0, 1471, __pyx_L1_error);
49606 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error)
49607 1 : __Pyx_GOTREF(__pyx_t_3);
49608 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1471, __pyx_L1_error)
49609 1 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error)
49610 1 : __Pyx_GOTREF(__pyx_t_1);
49611 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49612 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49613 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49614 1 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
49615 1 : PyObject* sequence = __pyx_t_1;
49616 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
49617 1 : if (unlikely(size != 3)) {
49618 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
49619 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
49620 0 : __PYX_ERR(0, 1471, __pyx_L1_error)
49621 : }
49622 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
49623 1 : if (likely(PyTuple_CheckExact(sequence))) {
49624 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
49625 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
49626 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
49627 : } else {
49628 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
49629 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
49630 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
49631 : }
49632 1 : __Pyx_INCREF(__pyx_t_3);
49633 1 : __Pyx_INCREF(__pyx_t_2);
49634 1 : __Pyx_INCREF(__pyx_t_4);
49635 : #else
49636 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error)
49637 : __Pyx_GOTREF(__pyx_t_3);
49638 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
49639 : __Pyx_GOTREF(__pyx_t_2);
49640 : __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error)
49641 : __Pyx_GOTREF(__pyx_t_4);
49642 : #endif
49643 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49644 : } else {
49645 0 : Py_ssize_t index = -1;
49646 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1471, __pyx_L1_error)
49647 0 : __Pyx_GOTREF(__pyx_t_6);
49648 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49649 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
49650 0 : index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L16_unpacking_failed;
49651 0 : __Pyx_GOTREF(__pyx_t_3);
49652 0 : index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L16_unpacking_failed;
49653 0 : __Pyx_GOTREF(__pyx_t_2);
49654 0 : index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L16_unpacking_failed;
49655 0 : __Pyx_GOTREF(__pyx_t_4);
49656 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1471, __pyx_L1_error)
49657 0 : __pyx_t_7 = NULL;
49658 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49659 0 : goto __pyx_L17_unpacking_done;
49660 0 : __pyx_L16_unpacking_failed:;
49661 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49662 0 : __pyx_t_7 = NULL;
49663 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
49664 0 : __PYX_ERR(0, 1471, __pyx_L1_error)
49665 0 : __pyx_L17_unpacking_done:;
49666 : }
49667 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1471, __pyx_L1_error)
49668 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1471, __pyx_L1_error)
49669 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1471, __pyx_L1_error)
49670 1 : __Pyx_GOTREF(__pyx_t_6);
49671 1 : __pyx_t_31 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1471, __pyx_L1_error)
49672 1 : __Pyx_GOTREF(__pyx_t_31);
49673 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49674 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1471, __pyx_L1_error)
49675 1 : __Pyx_GOTREF(__pyx_t_6);
49676 1 : __pyx_t_32 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 1471, __pyx_L1_error)
49677 1 : __Pyx_GOTREF(__pyx_t_32);
49678 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49679 1 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1471, __pyx_L1_error)
49680 1 : __Pyx_GOTREF(__pyx_t_6);
49681 1 : __Pyx_GIVEREF(__pyx_t_31);
49682 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_31)) __PYX_ERR(0, 1471, __pyx_L1_error);
49683 1 : __Pyx_GIVEREF(__pyx_t_32);
49684 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_32)) __PYX_ERR(0, 1471, __pyx_L1_error);
49685 1 : __pyx_t_31 = 0;
49686 1 : __pyx_t_32 = 0;
49687 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_6, __pyx_t_3) < 0))) __PYX_ERR(0, 1471, __pyx_L1_error)
49688 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49689 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49690 1 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_2);
49691 : {
49692 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49693 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
49694 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
49695 1 : if (unlikely(__pyx_t_8 < 0)) {
49696 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
49697 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
49698 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
49699 : __Pyx_RaiseBufferFallbackError();
49700 : } else {
49701 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
49702 : }
49703 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
49704 : }
49705 1 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
49706 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1471, __pyx_L1_error)
49707 : }
49708 1 : __pyx_t_33 = 0;
49709 1 : __pyx_v_S = ((PyArrayObject *)__pyx_t_2);
49710 1 : __pyx_t_2 = 0;
49711 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_4);
49712 : {
49713 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49714 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
49715 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
49716 1 : if (unlikely(__pyx_t_8 < 0)) {
49717 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
49718 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
49719 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
49720 : __Pyx_RaiseBufferFallbackError();
49721 : } else {
49722 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
49723 : }
49724 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
49725 : }
49726 1 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
49727 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1471, __pyx_L1_error)
49728 : }
49729 1 : __pyx_t_34 = 0;
49730 1 : __pyx_v_V = ((PyArrayObject *)__pyx_t_4);
49731 1 : __pyx_t_4 = 0;
49732 :
49733 : /* "scipy/linalg/_decomp_interpolative.pyx":1475
49734 : * # Apply Q of col to U from the left
49735 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
49736 : * np.conjugate(tau1, out=tau1) # <<<<<<<<<<<<<<
49737 : * C = col[:, :krank].conj().copy(order='F')
49738 : * zunm2r(<char*>'R', <char*>'C',
49739 : */
49740 1 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error)
49741 1 : __Pyx_GOTREF(__pyx_t_1);
49742 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error)
49743 1 : __Pyx_GOTREF(__pyx_t_4);
49744 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49745 1 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error)
49746 1 : __Pyx_GOTREF(__pyx_t_1);
49747 1 : __Pyx_INCREF((PyObject *)__pyx_v_tau1);
49748 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau1);
49749 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_tau1))) __PYX_ERR(0, 1475, __pyx_L1_error);
49750 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error)
49751 1 : __Pyx_GOTREF(__pyx_t_2);
49752 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, ((PyObject *)__pyx_v_tau1)) < 0) __PYX_ERR(0, 1475, __pyx_L1_error)
49753 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error)
49754 1 : __Pyx_GOTREF(__pyx_t_3);
49755 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49756 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49757 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49758 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49759 :
49760 : /* "scipy/linalg/_decomp_interpolative.pyx":1476
49761 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
49762 : * np.conjugate(tau1, out=tau1)
49763 : * C = col[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
49764 : * zunm2r(<char*>'R', <char*>'C',
49765 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
49766 : */
49767 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
49768 1 : __Pyx_GOTREF(__pyx_t_2);
49769 1 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
49770 1 : __Pyx_GOTREF(__pyx_t_1);
49771 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49772 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
49773 1 : __Pyx_GOTREF(__pyx_t_2);
49774 1 : __Pyx_INCREF(__pyx_slice__5);
49775 1 : __Pyx_GIVEREF(__pyx_slice__5);
49776 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1476, __pyx_L1_error);
49777 1 : __Pyx_GIVEREF(__pyx_t_1);
49778 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error);
49779 1 : __pyx_t_1 = 0;
49780 1 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
49781 1 : __Pyx_GOTREF(__pyx_t_1);
49782 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49783 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
49784 1 : __Pyx_GOTREF(__pyx_t_2);
49785 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49786 1 : __pyx_t_1 = NULL;
49787 1 : __pyx_t_5 = 0;
49788 : #if CYTHON_UNPACK_METHODS
49789 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
49790 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
49791 0 : if (likely(__pyx_t_1)) {
49792 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
49793 0 : __Pyx_INCREF(__pyx_t_1);
49794 0 : __Pyx_INCREF(function);
49795 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
49796 : __pyx_t_5 = 1;
49797 : }
49798 : }
49799 : #endif
49800 : {
49801 1 : PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
49802 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
49803 1 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
49804 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error)
49805 1 : __Pyx_GOTREF(__pyx_t_3);
49806 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49807 : }
49808 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
49809 1 : __Pyx_GOTREF(__pyx_t_2);
49810 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49811 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error)
49812 1 : __Pyx_GOTREF(__pyx_t_3);
49813 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1476, __pyx_L1_error)
49814 1 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
49815 1 : __Pyx_GOTREF(__pyx_t_1);
49816 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49817 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49818 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1476, __pyx_L1_error)
49819 1 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_1);
49820 : {
49821 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
49822 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
49823 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
49824 1 : if (unlikely(__pyx_t_8 < 0)) {
49825 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
49826 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
49827 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
49828 : __Pyx_RaiseBufferFallbackError();
49829 : } else {
49830 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
49831 : }
49832 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
49833 : }
49834 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
49835 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1476, __pyx_L1_error)
49836 : }
49837 1 : __pyx_t_35 = 0;
49838 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_1);
49839 1 : __pyx_t_1 = 0;
49840 :
49841 : /* "scipy/linalg/_decomp_interpolative.pyx":1478
49842 : * C = col[:, :krank].conj().copy(order='F')
49843 : * zunm2r(<char*>'R', <char*>'C',
49844 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
49845 : * &UU[0,0], &krank, &a[0, 0], &info)
49846 : *
49847 : */
49848 1 : __pyx_t_24 = 0;
49849 1 : __pyx_t_25 = 0;
49850 1 : __pyx_t_36 = 0;
49851 :
49852 : /* "scipy/linalg/_decomp_interpolative.pyx":1479
49853 : * zunm2r(<char*>'R', <char*>'C',
49854 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
49855 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
49856 : *
49857 : * VV[:krank, :krank] = V[:, :].conj().T
49858 : */
49859 1 : __pyx_t_37 = 0;
49860 1 : __pyx_t_38 = 0;
49861 1 : __pyx_t_39 = 0;
49862 1 : __pyx_t_40 = 0;
49863 :
49864 : /* "scipy/linalg/_decomp_interpolative.pyx":1477
49865 : * np.conjugate(tau1, out=tau1)
49866 : * C = col[:, :krank].conj().copy(order='F')
49867 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
49868 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
49869 : * &UU[0,0], &krank, &a[0, 0], &info)
49870 : */
49871 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
49872 :
49873 : /* "scipy/linalg/_decomp_interpolative.pyx":1481
49874 : * &UU[0,0], &krank, &a[0, 0], &info)
49875 : *
49876 : * VV[:krank, :krank] = V[:, :].conj().T # <<<<<<<<<<<<<<
49877 : *
49878 : * # Apply Q of t to V from the left
49879 : */
49880 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
49881 1 : __Pyx_GOTREF(__pyx_t_3);
49882 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
49883 1 : __Pyx_GOTREF(__pyx_t_2);
49884 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49885 1 : __pyx_t_3 = NULL;
49886 1 : __pyx_t_5 = 0;
49887 : #if CYTHON_UNPACK_METHODS
49888 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
49889 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
49890 0 : if (likely(__pyx_t_3)) {
49891 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
49892 0 : __Pyx_INCREF(__pyx_t_3);
49893 0 : __Pyx_INCREF(function);
49894 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
49895 : __pyx_t_5 = 1;
49896 : }
49897 : }
49898 : #endif
49899 : {
49900 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
49901 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
49902 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
49903 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
49904 1 : __Pyx_GOTREF(__pyx_t_1);
49905 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49906 : }
49907 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
49908 1 : __Pyx_GOTREF(__pyx_t_2);
49909 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49910 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
49911 1 : __Pyx_GOTREF(__pyx_t_1);
49912 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
49913 1 : __Pyx_GOTREF(__pyx_t_3);
49914 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49915 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
49916 1 : __Pyx_GOTREF(__pyx_t_1);
49917 1 : __pyx_t_4 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error)
49918 1 : __Pyx_GOTREF(__pyx_t_4);
49919 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49920 1 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
49921 1 : __Pyx_GOTREF(__pyx_t_1);
49922 1 : __Pyx_GIVEREF(__pyx_t_3);
49923 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error);
49924 1 : __Pyx_GIVEREF(__pyx_t_4);
49925 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error);
49926 1 : __pyx_t_3 = 0;
49927 1 : __pyx_t_4 = 0;
49928 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 1481, __pyx_L1_error)
49929 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49930 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49931 :
49932 : /* "scipy/linalg/_decomp_interpolative.pyx":1485
49933 : * # Apply Q of t to V from the left
49934 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
49935 : * np.conjugate(tau2, out=tau2) # <<<<<<<<<<<<<<
49936 : * C = t[:, :krank].conj().copy(order='F')
49937 : * zunm2r(<char*>'R', <char*>'C',
49938 : */
49939 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error)
49940 1 : __Pyx_GOTREF(__pyx_t_2);
49941 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error)
49942 1 : __Pyx_GOTREF(__pyx_t_1);
49943 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49944 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error)
49945 1 : __Pyx_GOTREF(__pyx_t_2);
49946 1 : __Pyx_INCREF((PyObject *)__pyx_v_tau2);
49947 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau2);
49948 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_tau2))) __PYX_ERR(0, 1485, __pyx_L1_error);
49949 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
49950 1 : __Pyx_GOTREF(__pyx_t_4);
49951 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_out, ((PyObject *)__pyx_v_tau2)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
49952 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1485, __pyx_L1_error)
49953 1 : __Pyx_GOTREF(__pyx_t_3);
49954 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49955 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49956 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49957 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49958 :
49959 : /* "scipy/linalg/_decomp_interpolative.pyx":1486
49960 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
49961 : * np.conjugate(tau2, out=tau2)
49962 : * C = t[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
49963 : * zunm2r(<char*>'R', <char*>'C',
49964 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
49965 : */
49966 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error)
49967 1 : __Pyx_GOTREF(__pyx_t_4);
49968 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
49969 1 : __Pyx_GOTREF(__pyx_t_2);
49970 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49971 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error)
49972 1 : __Pyx_GOTREF(__pyx_t_4);
49973 1 : __Pyx_INCREF(__pyx_slice__5);
49974 1 : __Pyx_GIVEREF(__pyx_slice__5);
49975 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 1486, __pyx_L1_error);
49976 1 : __Pyx_GIVEREF(__pyx_t_2);
49977 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error);
49978 1 : __pyx_t_2 = 0;
49979 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
49980 1 : __Pyx_GOTREF(__pyx_t_2);
49981 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49982 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error)
49983 1 : __Pyx_GOTREF(__pyx_t_4);
49984 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49985 1 : __pyx_t_2 = NULL;
49986 1 : __pyx_t_5 = 0;
49987 : #if CYTHON_UNPACK_METHODS
49988 1 : if (likely(PyMethod_Check(__pyx_t_4))) {
49989 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
49990 0 : if (likely(__pyx_t_2)) {
49991 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
49992 0 : __Pyx_INCREF(__pyx_t_2);
49993 0 : __Pyx_INCREF(function);
49994 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
49995 : __pyx_t_5 = 1;
49996 : }
49997 : }
49998 : #endif
49999 : {
50000 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
50001 1 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
50002 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
50003 1 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1486, __pyx_L1_error)
50004 1 : __Pyx_GOTREF(__pyx_t_3);
50005 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50006 : }
50007 1 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error)
50008 1 : __Pyx_GOTREF(__pyx_t_4);
50009 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50010 1 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1486, __pyx_L1_error)
50011 1 : __Pyx_GOTREF(__pyx_t_3);
50012 1 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1486, __pyx_L1_error)
50013 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
50014 1 : __Pyx_GOTREF(__pyx_t_2);
50015 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50016 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50017 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1486, __pyx_L1_error)
50018 1 : __pyx_t_35 = ((PyArrayObject *)__pyx_t_2);
50019 : {
50020 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
50021 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
50022 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
50023 1 : if (unlikely(__pyx_t_8 < 0)) {
50024 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
50025 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
50026 0 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
50027 0 : __Pyx_RaiseBufferFallbackError();
50028 : } else {
50029 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
50030 : }
50031 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
50032 : }
50033 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
50034 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1486, __pyx_L1_error)
50035 : }
50036 1 : __pyx_t_35 = 0;
50037 1 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_2));
50038 1 : __pyx_t_2 = 0;
50039 :
50040 : /* "scipy/linalg/_decomp_interpolative.pyx":1488
50041 : * C = t[:, :krank].conj().copy(order='F')
50042 : * zunm2r(<char*>'R', <char*>'C',
50043 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
50044 : * &VV[0, 0], &krank, &a[0, 0], &info)
50045 : *
50046 : */
50047 1 : __pyx_t_40 = 0;
50048 1 : __pyx_t_39 = 0;
50049 1 : __pyx_t_38 = 0;
50050 :
50051 : /* "scipy/linalg/_decomp_interpolative.pyx":1489
50052 : * zunm2r(<char*>'R', <char*>'C',
50053 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
50054 : * &VV[0, 0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
50055 : *
50056 : * return UU, S, VV
50057 : */
50058 1 : __pyx_t_37 = 0;
50059 1 : __pyx_t_36 = 0;
50060 1 : __pyx_t_25 = 0;
50061 1 : __pyx_t_24 = 0;
50062 :
50063 : /* "scipy/linalg/_decomp_interpolative.pyx":1487
50064 : * np.conjugate(tau2, out=tau2)
50065 : * C = t[:, :krank].conj().copy(order='F')
50066 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
50067 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
50068 : * &VV[0, 0], &krank, &a[0, 0], &info)
50069 : */
50070 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
50071 :
50072 : /* "scipy/linalg/_decomp_interpolative.pyx":1447
50073 : * krank, perms, proj = idzp_aid(a.copy(), eps, rng=rng)
50074 : *
50075 : * if krank > 0: # <<<<<<<<<<<<<<
50076 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
50077 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
50078 : */
50079 : }
50080 :
50081 : /* "scipy/linalg/_decomp_interpolative.pyx":1491
50082 : * &VV[0, 0], &krank, &a[0, 0], &info)
50083 : *
50084 : * return UU, S, VV # <<<<<<<<<<<<<<
50085 : *
50086 : *
50087 : */
50088 1 : __Pyx_XDECREF(__pyx_r);
50089 1 : __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error)
50090 1 : __Pyx_GOTREF(__pyx_t_2);
50091 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
50092 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
50093 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1491, __pyx_L1_error);
50094 1 : __Pyx_INCREF((PyObject *)__pyx_v_S);
50095 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
50096 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 1491, __pyx_L1_error);
50097 1 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
50098 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
50099 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 1491, __pyx_L1_error);
50100 1 : __pyx_r = __pyx_t_2;
50101 1 : __pyx_t_2 = 0;
50102 1 : goto __pyx_L0;
50103 :
50104 : /* "scipy/linalg/_decomp_interpolative.pyx":1427
50105 : *
50106 : *
50107 : * def idzp_asvd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps, *, # <<<<<<<<<<<<<<
50108 : * rng):
50109 : * cdef int m = a.shape[0], n = a.shape[1]
50110 : */
50111 :
50112 : /* function exit code */
50113 0 : __pyx_L1_error:;
50114 0 : __Pyx_XDECREF(__pyx_t_1);
50115 0 : __Pyx_XDECREF(__pyx_t_2);
50116 0 : __Pyx_XDECREF(__pyx_t_3);
50117 0 : __Pyx_XDECREF(__pyx_t_4);
50118 0 : __Pyx_XDECREF(__pyx_t_6);
50119 0 : __Pyx_XDECREF(__pyx_t_31);
50120 0 : __Pyx_XDECREF(__pyx_t_32);
50121 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
50122 0 : __Pyx_PyThreadState_declare
50123 0 : __Pyx_PyThreadState_assign
50124 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
50125 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
50126 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
50127 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
50128 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
50129 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
50130 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
50131 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
50132 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
50133 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
50134 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
50135 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
50136 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
50137 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
50138 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
50139 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
50140 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
50141 0 : __pyx_r = NULL;
50142 0 : goto __pyx_L2;
50143 1 : __pyx_L0:;
50144 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
50145 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
50146 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
50147 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
50148 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
50149 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
50150 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
50151 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
50152 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
50153 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
50154 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
50155 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
50156 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
50157 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
50158 1 : __pyx_L2:;
50159 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
50160 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
50161 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
50162 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
50163 1 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
50164 1 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
50165 1 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
50166 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
50167 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
50168 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
50169 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
50170 1 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
50171 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
50172 1 : __Pyx_XDECREF(__pyx_v_r);
50173 1 : __Pyx_XDECREF(__pyx_v_t);
50174 1 : __Pyx_XDECREF(__pyx_v_r2);
50175 1 : __Pyx_XDECREF(__pyx_v_r3);
50176 1 : __Pyx_XGIVEREF(__pyx_r);
50177 1 : __Pyx_RefNannyFinishContext();
50178 1 : return __pyx_r;
50179 : }
50180 :
50181 : /* "scipy/linalg/_decomp_interpolative.pyx":1494
50182 : *
50183 : *
50184 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
50185 : * cdef int n = a.shape[1], krank, tmp_int, p
50186 : * cdef double complex one = 1
50187 : */
50188 :
50189 : /* Python wrapper */
50190 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_57idzp_id(PyObject *__pyx_self,
50191 : #if CYTHON_METH_FASTCALL
50192 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
50193 : #else
50194 : PyObject *__pyx_args, PyObject *__pyx_kwds
50195 : #endif
50196 : ); /*proto*/
50197 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_57idzp_id = {"idzp_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_57idzp_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
50198 7 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_57idzp_id(PyObject *__pyx_self,
50199 : #if CYTHON_METH_FASTCALL
50200 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
50201 : #else
50202 : PyObject *__pyx_args, PyObject *__pyx_kwds
50203 : #endif
50204 : ) {
50205 7 : PyArrayObject *__pyx_v_a = 0;
50206 7 : __pyx_t_5numpy_float64_t __pyx_v_eps;
50207 : #if !CYTHON_METH_FASTCALL
50208 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
50209 : #endif
50210 7 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
50211 7 : PyObject* values[2] = {0,0};
50212 7 : int __pyx_lineno = 0;
50213 7 : const char *__pyx_filename = NULL;
50214 7 : int __pyx_clineno = 0;
50215 7 : PyObject *__pyx_r = 0;
50216 : __Pyx_RefNannyDeclarations
50217 7 : __Pyx_RefNannySetupContext("idzp_id (wrapper)", 0);
50218 : #if !CYTHON_METH_FASTCALL
50219 : #if CYTHON_ASSUME_SAFE_MACROS
50220 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
50221 : #else
50222 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
50223 : #endif
50224 : #endif
50225 7 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
50226 : {
50227 7 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
50228 7 : if (__pyx_kwds) {
50229 5 : Py_ssize_t kw_args;
50230 5 : switch (__pyx_nargs) {
50231 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
50232 5 : CYTHON_FALLTHROUGH;
50233 5 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
50234 5 : CYTHON_FALLTHROUGH;
50235 5 : case 0: break;
50236 0 : default: goto __pyx_L5_argtuple_error;
50237 : }
50238 5 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
50239 5 : switch (__pyx_nargs) {
50240 : case 0:
50241 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
50242 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
50243 0 : kw_args--;
50244 : }
50245 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
50246 0 : else goto __pyx_L5_argtuple_error;
50247 5 : CYTHON_FALLTHROUGH;
50248 : case 1:
50249 5 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
50250 5 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
50251 5 : kw_args--;
50252 : }
50253 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
50254 : else {
50255 0 : __Pyx_RaiseArgtupleInvalid("idzp_id", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
50256 : }
50257 : }
50258 5 : if (unlikely(kw_args > 0)) {
50259 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
50260 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_id") < 0)) __PYX_ERR(0, 1494, __pyx_L3_error)
50261 : }
50262 2 : } else if (unlikely(__pyx_nargs != 2)) {
50263 0 : goto __pyx_L5_argtuple_error;
50264 : } else {
50265 2 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
50266 2 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
50267 : }
50268 7 : __pyx_v_a = ((PyArrayObject *)values[0]);
50269 7 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
50270 : }
50271 7 : goto __pyx_L6_skip;
50272 0 : __pyx_L5_argtuple_error:;
50273 0 : __Pyx_RaiseArgtupleInvalid("idzp_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1494, __pyx_L3_error)
50274 7 : __pyx_L6_skip:;
50275 7 : goto __pyx_L4_argument_unpacking_done;
50276 0 : __pyx_L3_error:;
50277 : {
50278 0 : Py_ssize_t __pyx_temp;
50279 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
50280 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
50281 : }
50282 : }
50283 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
50284 0 : __Pyx_RefNannyFinishContext();
50285 0 : return NULL;
50286 7 : __pyx_L4_argument_unpacking_done:;
50287 7 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1494, __pyx_L1_error)
50288 7 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_56idzp_id(__pyx_self, __pyx_v_a, __pyx_v_eps);
50289 :
50290 : /* function exit code */
50291 7 : goto __pyx_L0;
50292 0 : __pyx_L1_error:;
50293 0 : __pyx_r = NULL;
50294 7 : __pyx_L0:;
50295 : {
50296 7 : Py_ssize_t __pyx_temp;
50297 7 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
50298 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
50299 : }
50300 : }
50301 : __Pyx_RefNannyFinishContext();
50302 : return __pyx_r;
50303 : }
50304 :
50305 7 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_56idzp_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps) {
50306 7 : int __pyx_v_n;
50307 7 : int __pyx_v_krank;
50308 7 : int __pyx_v_tmp_int;
50309 7 : int __pyx_v_p;
50310 7 : __pyx_t_double_complex __pyx_v_one;
50311 7 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
50312 7 : PyObject *__pyx_v_inds = NULL;
50313 7 : PyObject *__pyx_v_perms = NULL;
50314 7 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
50315 7 : __Pyx_Buffer __pyx_pybuffer_a;
50316 7 : PyObject *__pyx_r = NULL;
50317 : __Pyx_RefNannyDeclarations
50318 7 : PyObject *__pyx_t_1 = NULL;
50319 7 : PyObject *__pyx_t_2 = NULL;
50320 7 : PyObject *__pyx_t_3 = NULL;
50321 7 : PyObject *__pyx_t_4 = NULL;
50322 7 : unsigned int __pyx_t_5;
50323 7 : PyObject *__pyx_t_6 = NULL;
50324 7 : PyObject *(*__pyx_t_7)(PyObject *);
50325 7 : int __pyx_t_8;
50326 7 : int __pyx_t_9;
50327 7 : int __pyx_t_10;
50328 7 : int __pyx_t_11;
50329 7 : int __pyx_t_12;
50330 7 : Py_ssize_t __pyx_t_13;
50331 7 : Py_ssize_t __pyx_t_14;
50332 7 : Py_ssize_t __pyx_t_15;
50333 7 : Py_ssize_t __pyx_t_16;
50334 7 : int __pyx_lineno = 0;
50335 7 : const char *__pyx_filename = NULL;
50336 7 : int __pyx_clineno = 0;
50337 7 : __Pyx_RefNannySetupContext("idzp_id", 1);
50338 7 : __pyx_pybuffer_a.pybuffer.buf = NULL;
50339 7 : __pyx_pybuffer_a.refcount = 0;
50340 7 : __pyx_pybuffernd_a.data = NULL;
50341 7 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
50342 : {
50343 7 : __Pyx_BufFmt_StackElem __pyx_stack[1];
50344 7 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1494, __pyx_L1_error)
50345 : }
50346 7 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
50347 :
50348 : /* "scipy/linalg/_decomp_interpolative.pyx":1495
50349 : *
50350 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps):
50351 : * cdef int n = a.shape[1], krank, tmp_int, p # <<<<<<<<<<<<<<
50352 : * cdef double complex one = 1
50353 : * krank, _, inds = idzp_qrpiv(a, eps)
50354 : */
50355 7 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
50356 :
50357 : /* "scipy/linalg/_decomp_interpolative.pyx":1496
50358 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps):
50359 : * cdef int n = a.shape[1], krank, tmp_int, p
50360 : * cdef double complex one = 1 # <<<<<<<<<<<<<<
50361 : * krank, _, inds = idzp_qrpiv(a, eps)
50362 : *
50363 : */
50364 7 : __pyx_v_one = __pyx_t_double_complex_from_parts(1, 0);
50365 :
50366 : /* "scipy/linalg/_decomp_interpolative.pyx":1497
50367 : * cdef int n = a.shape[1], krank, tmp_int, p
50368 : * cdef double complex one = 1
50369 : * krank, _, inds = idzp_qrpiv(a, eps) # <<<<<<<<<<<<<<
50370 : *
50371 : * # Change pivots to permutation
50372 : */
50373 7 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzp_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error)
50374 7 : __Pyx_GOTREF(__pyx_t_2);
50375 7 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
50376 7 : __Pyx_GOTREF(__pyx_t_3);
50377 7 : __pyx_t_4 = NULL;
50378 7 : __pyx_t_5 = 0;
50379 : #if CYTHON_UNPACK_METHODS
50380 7 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
50381 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
50382 0 : if (likely(__pyx_t_4)) {
50383 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
50384 0 : __Pyx_INCREF(__pyx_t_4);
50385 0 : __Pyx_INCREF(function);
50386 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
50387 : __pyx_t_5 = 1;
50388 : }
50389 : }
50390 : #endif
50391 : {
50392 7 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
50393 7 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
50394 7 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
50395 7 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50396 7 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
50397 7 : __Pyx_GOTREF(__pyx_t_1);
50398 7 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50399 : }
50400 7 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
50401 7 : PyObject* sequence = __pyx_t_1;
50402 7 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
50403 7 : if (unlikely(size != 3)) {
50404 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
50405 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
50406 0 : __PYX_ERR(0, 1497, __pyx_L1_error)
50407 : }
50408 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50409 7 : if (likely(PyTuple_CheckExact(sequence))) {
50410 7 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
50411 7 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
50412 7 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
50413 : } else {
50414 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
50415 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
50416 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
50417 : }
50418 7 : __Pyx_INCREF(__pyx_t_2);
50419 7 : __Pyx_INCREF(__pyx_t_3);
50420 7 : __Pyx_INCREF(__pyx_t_4);
50421 : #else
50422 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error)
50423 : __Pyx_GOTREF(__pyx_t_2);
50424 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
50425 : __Pyx_GOTREF(__pyx_t_3);
50426 : __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error)
50427 : __Pyx_GOTREF(__pyx_t_4);
50428 : #endif
50429 7 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50430 : } else {
50431 0 : Py_ssize_t index = -1;
50432 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
50433 0 : __Pyx_GOTREF(__pyx_t_6);
50434 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50435 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
50436 0 : index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
50437 0 : __Pyx_GOTREF(__pyx_t_2);
50438 0 : index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
50439 0 : __Pyx_GOTREF(__pyx_t_3);
50440 0 : index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
50441 0 : __Pyx_GOTREF(__pyx_t_4);
50442 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1497, __pyx_L1_error)
50443 0 : __pyx_t_7 = NULL;
50444 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
50445 0 : goto __pyx_L4_unpacking_done;
50446 0 : __pyx_L3_unpacking_failed:;
50447 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
50448 0 : __pyx_t_7 = NULL;
50449 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
50450 0 : __PYX_ERR(0, 1497, __pyx_L1_error)
50451 0 : __pyx_L4_unpacking_done:;
50452 : }
50453 7 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1497, __pyx_L1_error)
50454 7 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50455 7 : __pyx_v_krank = __pyx_t_8;
50456 7 : __pyx_v__ = __pyx_t_3;
50457 7 : __pyx_t_3 = 0;
50458 7 : __pyx_v_inds = __pyx_t_4;
50459 7 : __pyx_t_4 = 0;
50460 :
50461 : /* "scipy/linalg/_decomp_interpolative.pyx":1500
50462 : *
50463 : * # Change pivots to permutation
50464 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64) # <<<<<<<<<<<<<<
50465 : *
50466 : * if krank > 0:
50467 : */
50468 7 : __pyx_t_1 = PyArray_Arange(0.0, __pyx_v_n, 1.0, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1500, __pyx_L1_error)
50469 7 : __Pyx_GOTREF(__pyx_t_1);
50470 7 : __pyx_v_perms = __pyx_t_1;
50471 7 : __pyx_t_1 = 0;
50472 :
50473 : /* "scipy/linalg/_decomp_interpolative.pyx":1502
50474 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
50475 : *
50476 : * if krank > 0: # <<<<<<<<<<<<<<
50477 : * for p in range(krank):
50478 : * # Apply pivots
50479 : */
50480 7 : __pyx_t_9 = (__pyx_v_krank > 0);
50481 7 : if (__pyx_t_9) {
50482 :
50483 : /* "scipy/linalg/_decomp_interpolative.pyx":1503
50484 : *
50485 : * if krank > 0:
50486 : * for p in range(krank): # <<<<<<<<<<<<<<
50487 : * # Apply pivots
50488 : * tmp_int = perms[p]
50489 : */
50490 106 : __pyx_t_8 = __pyx_v_krank;
50491 : __pyx_t_10 = __pyx_t_8;
50492 106 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
50493 99 : __pyx_v_p = __pyx_t_11;
50494 :
50495 : /* "scipy/linalg/_decomp_interpolative.pyx":1505
50496 : * for p in range(krank):
50497 : * # Apply pivots
50498 : * tmp_int = perms[p] # <<<<<<<<<<<<<<
50499 : * perms[p] = perms[inds[p]]
50500 : * perms[inds[p]] = tmp_int
50501 : */
50502 99 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_perms, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error)
50503 99 : __Pyx_GOTREF(__pyx_t_1);
50504 99 : __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1505, __pyx_L1_error)
50505 99 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50506 99 : __pyx_v_tmp_int = __pyx_t_12;
50507 :
50508 : /* "scipy/linalg/_decomp_interpolative.pyx":1506
50509 : * # Apply pivots
50510 : * tmp_int = perms[p]
50511 : * perms[p] = perms[inds[p]] # <<<<<<<<<<<<<<
50512 : * perms[inds[p]] = tmp_int
50513 : *
50514 : */
50515 99 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1506, __pyx_L1_error)
50516 99 : __Pyx_GOTREF(__pyx_t_1);
50517 99 : __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_perms, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1506, __pyx_L1_error)
50518 99 : __Pyx_GOTREF(__pyx_t_4);
50519 99 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50520 99 : if (unlikely((__Pyx_SetItemInt(__pyx_v_perms, __pyx_v_p, __pyx_t_4, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1506, __pyx_L1_error)
50521 99 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50522 :
50523 : /* "scipy/linalg/_decomp_interpolative.pyx":1507
50524 : * tmp_int = perms[p]
50525 : * perms[p] = perms[inds[p]]
50526 : * perms[inds[p]] = tmp_int # <<<<<<<<<<<<<<
50527 : *
50528 : * tmp_int = n - krank
50529 : */
50530 99 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_tmp_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error)
50531 99 : __Pyx_GOTREF(__pyx_t_4);
50532 99 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error)
50533 99 : __Pyx_GOTREF(__pyx_t_1);
50534 99 : if (unlikely((PyObject_SetItem(__pyx_v_perms, __pyx_t_1, __pyx_t_4) < 0))) __PYX_ERR(0, 1507, __pyx_L1_error)
50535 99 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50536 99 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50537 : }
50538 :
50539 : /* "scipy/linalg/_decomp_interpolative.pyx":1502
50540 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
50541 : *
50542 : * if krank > 0: # <<<<<<<<<<<<<<
50543 : * for p in range(krank):
50544 : * # Apply pivots
50545 : */
50546 : }
50547 :
50548 : /* "scipy/linalg/_decomp_interpolative.pyx":1509
50549 : * perms[inds[p]] = tmp_int
50550 : *
50551 : * tmp_int = n - krank # <<<<<<<<<<<<<<
50552 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
50553 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
50554 : */
50555 7 : __pyx_v_tmp_int = (__pyx_v_n - __pyx_v_krank);
50556 :
50557 : /* "scipy/linalg/_decomp_interpolative.pyx":1512
50558 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
50559 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
50560 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n) # <<<<<<<<<<<<<<
50561 : *
50562 : * return krank, perms, a[:krank, krank:]
50563 : */
50564 7 : __pyx_t_13 = 0;
50565 7 : __pyx_t_14 = 0;
50566 7 : __pyx_t_15 = 0;
50567 7 : __pyx_t_16 = __pyx_v_krank;
50568 :
50569 : /* "scipy/linalg/_decomp_interpolative.pyx":1511
50570 : * tmp_int = n - krank
50571 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
50572 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N', # <<<<<<<<<<<<<<
50573 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
50574 : *
50575 : */
50576 7 : __pyx_f_5scipy_6linalg_11cython_blas_ztrsm(((char *)((char *)"R")), ((char *)((char *)"L")), ((char *)((char *)"N")), ((char *)((char *)"N")), (&__pyx_v_tmp_int), (&__pyx_v_krank), (&__pyx_v_one), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n));
50577 :
50578 : /* "scipy/linalg/_decomp_interpolative.pyx":1514
50579 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
50580 : *
50581 : * return krank, perms, a[:krank, krank:] # <<<<<<<<<<<<<<
50582 : *
50583 : *
50584 : */
50585 7 : __Pyx_XDECREF(__pyx_r);
50586 7 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error)
50587 7 : __Pyx_GOTREF(__pyx_t_4);
50588 7 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
50589 7 : __Pyx_GOTREF(__pyx_t_1);
50590 7 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error)
50591 7 : __Pyx_GOTREF(__pyx_t_3);
50592 7 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50593 7 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
50594 7 : __Pyx_GOTREF(__pyx_t_1);
50595 7 : __pyx_t_2 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
50596 7 : __Pyx_GOTREF(__pyx_t_2);
50597 7 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50598 7 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
50599 7 : __Pyx_GOTREF(__pyx_t_1);
50600 7 : __Pyx_GIVEREF(__pyx_t_3);
50601 7 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error);
50602 7 : __Pyx_GIVEREF(__pyx_t_2);
50603 7 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error);
50604 7 : __pyx_t_3 = 0;
50605 7 : __pyx_t_2 = 0;
50606 7 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
50607 7 : __Pyx_GOTREF(__pyx_t_2);
50608 7 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50609 7 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
50610 7 : __Pyx_GOTREF(__pyx_t_1);
50611 7 : __Pyx_GIVEREF(__pyx_t_4);
50612 7 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error);
50613 7 : __Pyx_INCREF(__pyx_v_perms);
50614 7 : __Pyx_GIVEREF(__pyx_v_perms);
50615 7 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_perms)) __PYX_ERR(0, 1514, __pyx_L1_error);
50616 7 : __Pyx_GIVEREF(__pyx_t_2);
50617 7 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error);
50618 7 : __pyx_t_4 = 0;
50619 7 : __pyx_t_2 = 0;
50620 7 : __pyx_r = __pyx_t_1;
50621 7 : __pyx_t_1 = 0;
50622 7 : goto __pyx_L0;
50623 :
50624 : /* "scipy/linalg/_decomp_interpolative.pyx":1494
50625 : *
50626 : *
50627 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
50628 : * cdef int n = a.shape[1], krank, tmp_int, p
50629 : * cdef double complex one = 1
50630 : */
50631 :
50632 : /* function exit code */
50633 0 : __pyx_L1_error:;
50634 0 : __Pyx_XDECREF(__pyx_t_1);
50635 0 : __Pyx_XDECREF(__pyx_t_2);
50636 0 : __Pyx_XDECREF(__pyx_t_3);
50637 0 : __Pyx_XDECREF(__pyx_t_4);
50638 0 : __Pyx_XDECREF(__pyx_t_6);
50639 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
50640 0 : __Pyx_PyThreadState_declare
50641 0 : __Pyx_PyThreadState_assign
50642 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
50643 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
50644 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
50645 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
50646 0 : __pyx_r = NULL;
50647 0 : goto __pyx_L2;
50648 7 : __pyx_L0:;
50649 7 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
50650 7 : __pyx_L2:;
50651 7 : __Pyx_XDECREF(__pyx_v__);
50652 7 : __Pyx_XDECREF(__pyx_v_inds);
50653 7 : __Pyx_XDECREF(__pyx_v_perms);
50654 7 : __Pyx_XGIVEREF(__pyx_r);
50655 7 : __Pyx_RefNannyFinishContext();
50656 7 : return __pyx_r;
50657 : }
50658 :
50659 : /* "scipy/linalg/_decomp_interpolative.pyx":1517
50660 : *
50661 : *
50662 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
50663 : * cdef int m = a.shape[0], n = a.shape[1]
50664 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
50665 : */
50666 :
50667 : /* Python wrapper */
50668 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_59idzp_qrpiv(PyObject *__pyx_self,
50669 : #if CYTHON_METH_FASTCALL
50670 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
50671 : #else
50672 : PyObject *__pyx_args, PyObject *__pyx_kwds
50673 : #endif
50674 : ); /*proto*/
50675 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_59idzp_qrpiv = {"idzp_qrpiv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_59idzp_qrpiv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
50676 8 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_59idzp_qrpiv(PyObject *__pyx_self,
50677 : #if CYTHON_METH_FASTCALL
50678 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
50679 : #else
50680 : PyObject *__pyx_args, PyObject *__pyx_kwds
50681 : #endif
50682 : ) {
50683 8 : PyArrayObject *__pyx_v_a = 0;
50684 8 : __pyx_t_5numpy_float64_t __pyx_v_eps;
50685 : #if !CYTHON_METH_FASTCALL
50686 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
50687 : #endif
50688 8 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
50689 8 : PyObject* values[2] = {0,0};
50690 8 : int __pyx_lineno = 0;
50691 8 : const char *__pyx_filename = NULL;
50692 8 : int __pyx_clineno = 0;
50693 8 : PyObject *__pyx_r = 0;
50694 : __Pyx_RefNannyDeclarations
50695 8 : __Pyx_RefNannySetupContext("idzp_qrpiv (wrapper)", 0);
50696 : #if !CYTHON_METH_FASTCALL
50697 : #if CYTHON_ASSUME_SAFE_MACROS
50698 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
50699 : #else
50700 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
50701 : #endif
50702 : #endif
50703 8 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
50704 : {
50705 8 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
50706 8 : if (__pyx_kwds) {
50707 0 : Py_ssize_t kw_args;
50708 0 : switch (__pyx_nargs) {
50709 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
50710 0 : CYTHON_FALLTHROUGH;
50711 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
50712 0 : CYTHON_FALLTHROUGH;
50713 0 : case 0: break;
50714 0 : default: goto __pyx_L5_argtuple_error;
50715 : }
50716 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
50717 0 : switch (__pyx_nargs) {
50718 : case 0:
50719 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
50720 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
50721 0 : kw_args--;
50722 : }
50723 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L3_error)
50724 0 : else goto __pyx_L5_argtuple_error;
50725 0 : CYTHON_FALLTHROUGH;
50726 : case 1:
50727 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
50728 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
50729 0 : kw_args--;
50730 : }
50731 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L3_error)
50732 : else {
50733 0 : __Pyx_RaiseArgtupleInvalid("idzp_qrpiv", 1, 2, 2, 1); __PYX_ERR(0, 1517, __pyx_L3_error)
50734 : }
50735 : }
50736 0 : if (unlikely(kw_args > 0)) {
50737 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
50738 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_qrpiv") < 0)) __PYX_ERR(0, 1517, __pyx_L3_error)
50739 : }
50740 8 : } else if (unlikely(__pyx_nargs != 2)) {
50741 0 : goto __pyx_L5_argtuple_error;
50742 : } else {
50743 8 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
50744 8 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
50745 : }
50746 8 : __pyx_v_a = ((PyArrayObject *)values[0]);
50747 8 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L3_error)
50748 : }
50749 8 : goto __pyx_L6_skip;
50750 0 : __pyx_L5_argtuple_error:;
50751 0 : __Pyx_RaiseArgtupleInvalid("idzp_qrpiv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1517, __pyx_L3_error)
50752 8 : __pyx_L6_skip:;
50753 8 : goto __pyx_L4_argument_unpacking_done;
50754 0 : __pyx_L3_error:;
50755 : {
50756 0 : Py_ssize_t __pyx_temp;
50757 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
50758 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
50759 : }
50760 : }
50761 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
50762 0 : __Pyx_RefNannyFinishContext();
50763 0 : return NULL;
50764 8 : __pyx_L4_argument_unpacking_done:;
50765 8 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1517, __pyx_L1_error)
50766 8 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_58idzp_qrpiv(__pyx_self, __pyx_v_a, __pyx_v_eps);
50767 :
50768 : /* function exit code */
50769 8 : goto __pyx_L0;
50770 0 : __pyx_L1_error:;
50771 0 : __pyx_r = NULL;
50772 8 : __pyx_L0:;
50773 : {
50774 8 : Py_ssize_t __pyx_temp;
50775 8 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
50776 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
50777 : }
50778 : }
50779 : __Pyx_RefNannyFinishContext();
50780 : return __pyx_r;
50781 : }
50782 :
50783 8 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_58idzp_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps) {
50784 8 : int __pyx_v_m;
50785 8 : int __pyx_v_n;
50786 8 : PyArrayObject *__pyx_v_col_norms = 0;
50787 8 : int __pyx_v_k;
50788 8 : int __pyx_v_kpiv;
50789 8 : int __pyx_v_i;
50790 8 : int __pyx_v_tmp_int;
50791 8 : int __pyx_v_int_n;
50792 8 : __pyx_t_double_complex __pyx_v_tmp_sca;
50793 8 : PyArrayObject *__pyx_v_taus = 0;
50794 8 : PyArrayObject *__pyx_v_ind = 0;
50795 8 : __Pyx_memviewslice __pyx_v_taus_v = { 0, 0, { 0 }, { 0 }, { 0 } };
50796 8 : __pyx_t_5numpy_float64_t __pyx_v_feps;
50797 8 : __pyx_t_5numpy_float64_t __pyx_v_ssmax;
50798 8 : __pyx_t_5numpy_float64_t __pyx_v_ssmaxin;
50799 8 : int __pyx_v_nupdate;
50800 8 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
50801 8 : __Pyx_Buffer __pyx_pybuffer_a;
50802 8 : PyObject *__pyx_r = NULL;
50803 : __Pyx_RefNannyDeclarations
50804 8 : npy_intp __pyx_t_1[1];
50805 8 : PyObject *__pyx_t_2 = NULL;
50806 8 : npy_intp __pyx_t_3[1];
50807 8 : npy_intp __pyx_t_4[1];
50808 8 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
50809 8 : int __pyx_t_6;
50810 8 : int __pyx_t_7;
50811 8 : int __pyx_t_8;
50812 8 : Py_ssize_t __pyx_t_9;
50813 8 : Py_ssize_t __pyx_t_10;
50814 8 : PyObject *__pyx_t_11 = NULL;
50815 8 : PyObject *__pyx_t_12 = NULL;
50816 8 : unsigned int __pyx_t_13;
50817 8 : __pyx_t_5numpy_float64_t __pyx_t_14;
50818 8 : int __pyx_t_15;
50819 8 : PyObject *__pyx_t_16 = NULL;
50820 8 : Py_ssize_t __pyx_t_17;
50821 8 : PyObject *__pyx_t_18 = NULL;
50822 8 : PyObject *__pyx_t_19 = NULL;
50823 8 : PyObject *__pyx_t_20 = NULL;
50824 8 : PyObject *__pyx_t_21 = NULL;
50825 8 : PyObject *__pyx_t_22 = NULL;
50826 8 : int __pyx_t_23;
50827 8 : int __pyx_t_24;
50828 8 : int __pyx_t_25;
50829 8 : int __pyx_t_26;
50830 8 : int __pyx_lineno = 0;
50831 8 : const char *__pyx_filename = NULL;
50832 8 : int __pyx_clineno = 0;
50833 8 : __Pyx_RefNannySetupContext("idzp_qrpiv", 1);
50834 8 : __pyx_pybuffer_a.pybuffer.buf = NULL;
50835 8 : __pyx_pybuffer_a.refcount = 0;
50836 8 : __pyx_pybuffernd_a.data = NULL;
50837 8 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
50838 : {
50839 8 : __Pyx_BufFmt_StackElem __pyx_stack[1];
50840 8 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1517, __pyx_L1_error)
50841 : }
50842 8 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
50843 :
50844 : /* "scipy/linalg/_decomp_interpolative.pyx":1518
50845 : *
50846 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps):
50847 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
50848 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
50849 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
50850 : */
50851 8 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
50852 8 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
50853 :
50854 : /* "scipy/linalg/_decomp_interpolative.pyx":1519
50855 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps):
50856 : * cdef int m = a.shape[0], n = a.shape[1]
50857 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
50858 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
50859 : * cdef double complex tmp_sca = 0.
50860 : */
50861 8 : __pyx_t_1[0] = __pyx_v_n;
50862 8 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_1, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1519, __pyx_L1_error)
50863 8 : __Pyx_GOTREF(__pyx_t_2);
50864 8 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1519, __pyx_L1_error)
50865 8 : __pyx_v_col_norms = ((PyArrayObject *)__pyx_t_2);
50866 8 : __pyx_t_2 = 0;
50867 :
50868 : /* "scipy/linalg/_decomp_interpolative.pyx":1520
50869 : * cdef int m = a.shape[0], n = a.shape[1]
50870 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
50871 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0 # <<<<<<<<<<<<<<
50872 : * cdef double complex tmp_sca = 0.
50873 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
50874 : */
50875 8 : __pyx_v_k = 0;
50876 8 : __pyx_v_kpiv = 0;
50877 8 : __pyx_v_i = 0;
50878 8 : __pyx_v_tmp_int = 0;
50879 8 : __pyx_v_int_n = 0;
50880 :
50881 : /* "scipy/linalg/_decomp_interpolative.pyx":1521
50882 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
50883 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
50884 : * cdef double complex tmp_sca = 0. # <<<<<<<<<<<<<<
50885 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
50886 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
50887 : */
50888 8 : __pyx_v_tmp_sca = __pyx_t_double_complex_from_parts(0., 0);
50889 :
50890 : /* "scipy/linalg/_decomp_interpolative.pyx":1522
50891 : * cdef int k = 0, kpiv = 0, i = 0, tmp_int = 0, int_n = 0
50892 : * cdef double complex tmp_sca = 0.
50893 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
50894 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
50895 : * cdef double complex[::1] taus_v = taus
50896 : */
50897 8 : __pyx_t_3[0] = __pyx_v_m;
50898 8 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
50899 8 : __Pyx_GOTREF(__pyx_t_2);
50900 8 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1522, __pyx_L1_error)
50901 8 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_2);
50902 8 : __pyx_t_2 = 0;
50903 :
50904 : /* "scipy/linalg/_decomp_interpolative.pyx":1523
50905 : * cdef double complex tmp_sca = 0.
50906 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
50907 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
50908 : * cdef double complex[::1] taus_v = taus
50909 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
50910 : */
50911 8 : __pyx_t_4[0] = __pyx_v_n;
50912 8 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
50913 8 : __Pyx_GOTREF(__pyx_t_2);
50914 8 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1523, __pyx_L1_error)
50915 8 : __pyx_v_ind = ((PyArrayObject *)__pyx_t_2);
50916 8 : __pyx_t_2 = 0;
50917 :
50918 : /* "scipy/linalg/_decomp_interpolative.pyx":1524
50919 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
50920 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
50921 : * cdef double complex[::1] taus_v = taus # <<<<<<<<<<<<<<
50922 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
50923 : * cdef cnp.float64_t ssmax, ssmaxin
50924 : */
50925 8 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(((PyObject *)__pyx_v_taus), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1524, __pyx_L1_error)
50926 8 : __pyx_v_taus_v = __pyx_t_5;
50927 8 : __pyx_t_5.memview = NULL;
50928 8 : __pyx_t_5.data = NULL;
50929 :
50930 : /* "scipy/linalg/_decomp_interpolative.pyx":1525
50931 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
50932 : * cdef double complex[::1] taus_v = taus
50933 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps # <<<<<<<<<<<<<<
50934 : * cdef cnp.float64_t ssmax, ssmaxin
50935 : * cdef int nupdate = 0
50936 : */
50937 8 : __pyx_v_feps = 0.1e-16;
50938 :
50939 : /* "scipy/linalg/_decomp_interpolative.pyx":1527
50940 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
50941 : * cdef cnp.float64_t ssmax, ssmaxin
50942 : * cdef int nupdate = 0 # <<<<<<<<<<<<<<
50943 : *
50944 : * for i in range(n):
50945 : */
50946 8 : __pyx_v_nupdate = 0;
50947 :
50948 : /* "scipy/linalg/_decomp_interpolative.pyx":1529
50949 : * cdef int nupdate = 0
50950 : *
50951 : * for i in range(n): # <<<<<<<<<<<<<<
50952 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2
50953 : *
50954 : */
50955 8 : __pyx_t_6 = __pyx_v_n;
50956 8 : __pyx_t_7 = __pyx_t_6;
50957 1818 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
50958 1810 : __pyx_v_i = __pyx_t_8;
50959 :
50960 : /* "scipy/linalg/_decomp_interpolative.pyx":1530
50961 : *
50962 : * for i in range(n):
50963 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2 # <<<<<<<<<<<<<<
50964 : *
50965 : * kpiv = np.argmax(col_norms)
50966 : */
50967 1810 : __pyx_t_9 = 0;
50968 1810 : __pyx_t_10 = __pyx_v_i;
50969 1810 : __pyx_t_2 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_m), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
50970 1810 : __Pyx_GOTREF(__pyx_t_2);
50971 1810 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1530, __pyx_L1_error)
50972 3620 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50973 : }
50974 :
50975 : /* "scipy/linalg/_decomp_interpolative.pyx":1532
50976 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2
50977 : *
50978 : * kpiv = np.argmax(col_norms) # <<<<<<<<<<<<<<
50979 : * ssmax = col_norms[kpiv]
50980 : * ssmaxin = ssmax
50981 : */
50982 8 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L1_error)
50983 8 : __Pyx_GOTREF(__pyx_t_11);
50984 8 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argmax); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1532, __pyx_L1_error)
50985 8 : __Pyx_GOTREF(__pyx_t_12);
50986 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50987 8 : __pyx_t_11 = NULL;
50988 8 : __pyx_t_13 = 0;
50989 : #if CYTHON_UNPACK_METHODS
50990 8 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
50991 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
50992 0 : if (likely(__pyx_t_11)) {
50993 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
50994 0 : __Pyx_INCREF(__pyx_t_11);
50995 0 : __Pyx_INCREF(function);
50996 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
50997 : __pyx_t_13 = 1;
50998 : }
50999 : }
51000 : #endif
51001 : {
51002 8 : PyObject *__pyx_callargs[2] = {__pyx_t_11, ((PyObject *)__pyx_v_col_norms)};
51003 8 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
51004 8 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
51005 8 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1532, __pyx_L1_error)
51006 8 : __Pyx_GOTREF(__pyx_t_2);
51007 8 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
51008 : }
51009 8 : __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1532, __pyx_L1_error)
51010 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51011 8 : __pyx_v_kpiv = __pyx_t_6;
51012 :
51013 : /* "scipy/linalg/_decomp_interpolative.pyx":1533
51014 : *
51015 : * kpiv = np.argmax(col_norms)
51016 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
51017 : * ssmaxin = ssmax
51018 : *
51019 : */
51020 8 : __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
51021 8 : __Pyx_GOTREF(__pyx_t_2);
51022 8 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1533, __pyx_L1_error)
51023 8 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51024 8 : __pyx_v_ssmax = __pyx_t_14;
51025 :
51026 : /* "scipy/linalg/_decomp_interpolative.pyx":1534
51027 : * kpiv = np.argmax(col_norms)
51028 : * ssmax = col_norms[kpiv]
51029 : * ssmaxin = ssmax # <<<<<<<<<<<<<<
51030 : *
51031 : * for k in range(min(m, n)):
51032 : */
51033 8 : __pyx_v_ssmaxin = __pyx_v_ssmax;
51034 :
51035 : /* "scipy/linalg/_decomp_interpolative.pyx":1536
51036 : * ssmaxin = ssmax
51037 : *
51038 : * for k in range(min(m, n)): # <<<<<<<<<<<<<<
51039 : *
51040 : * # Pivoting
51041 : */
51042 8 : __pyx_t_6 = __pyx_v_n;
51043 8 : __pyx_t_7 = __pyx_v_m;
51044 8 : __pyx_t_15 = (__pyx_t_6 < __pyx_t_7);
51045 8 : if (__pyx_t_15) {
51046 : __pyx_t_8 = __pyx_t_6;
51047 : } else {
51048 : __pyx_t_8 = __pyx_t_7;
51049 : }
51050 8 : __pyx_t_6 = __pyx_t_8;
51051 8 : __pyx_t_8 = __pyx_t_6;
51052 118 : for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
51053 118 : __pyx_v_k = __pyx_t_7;
51054 :
51055 : /* "scipy/linalg/_decomp_interpolative.pyx":1539
51056 : *
51057 : * # Pivoting
51058 : * ind[k] = kpiv # <<<<<<<<<<<<<<
51059 : * # Swap columns a[:, k] and a[:, kpiv]
51060 : * a[:, [kpiv, k]] = a[:, [k, kpiv]]
51061 : */
51062 118 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
51063 118 : __Pyx_GOTREF(__pyx_t_2);
51064 118 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_ind), __pyx_v_k, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1539, __pyx_L1_error)
51065 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51066 :
51067 : /* "scipy/linalg/_decomp_interpolative.pyx":1541
51068 : * ind[k] = kpiv
51069 : * # Swap columns a[:, k] and a[:, kpiv]
51070 : * a[:, [kpiv, k]] = a[:, [k, kpiv]] # <<<<<<<<<<<<<<
51071 : *
51072 : * # Swap col_norms[krank] and col_norms[kpiv]
51073 : */
51074 118 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
51075 118 : __Pyx_GOTREF(__pyx_t_2);
51076 118 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error)
51077 118 : __Pyx_GOTREF(__pyx_t_12);
51078 118 : __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1541, __pyx_L1_error)
51079 118 : __Pyx_GOTREF(__pyx_t_11);
51080 118 : __Pyx_GIVEREF(__pyx_t_2);
51081 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error);
51082 118 : __Pyx_GIVEREF(__pyx_t_12);
51083 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error);
51084 118 : __pyx_t_2 = 0;
51085 118 : __pyx_t_12 = 0;
51086 118 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error)
51087 118 : __Pyx_GOTREF(__pyx_t_12);
51088 118 : __Pyx_INCREF(__pyx_slice__5);
51089 118 : __Pyx_GIVEREF(__pyx_slice__5);
51090 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__5)) __PYX_ERR(0, 1541, __pyx_L1_error);
51091 118 : __Pyx_GIVEREF(__pyx_t_11);
51092 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(0, 1541, __pyx_L1_error);
51093 118 : __pyx_t_11 = 0;
51094 118 : __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1541, __pyx_L1_error)
51095 118 : __Pyx_GOTREF(__pyx_t_11);
51096 118 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
51097 118 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error)
51098 118 : __Pyx_GOTREF(__pyx_t_12);
51099 118 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
51100 118 : __Pyx_GOTREF(__pyx_t_2);
51101 118 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1541, __pyx_L1_error)
51102 118 : __Pyx_GOTREF(__pyx_t_16);
51103 118 : __Pyx_GIVEREF(__pyx_t_12);
51104 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_12)) __PYX_ERR(0, 1541, __pyx_L1_error);
51105 118 : __Pyx_GIVEREF(__pyx_t_2);
51106 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error);
51107 118 : __pyx_t_12 = 0;
51108 118 : __pyx_t_2 = 0;
51109 118 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
51110 118 : __Pyx_GOTREF(__pyx_t_2);
51111 118 : __Pyx_INCREF(__pyx_slice__5);
51112 118 : __Pyx_GIVEREF(__pyx_slice__5);
51113 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1541, __pyx_L1_error);
51114 118 : __Pyx_GIVEREF(__pyx_t_16);
51115 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16)) __PYX_ERR(0, 1541, __pyx_L1_error);
51116 118 : __pyx_t_16 = 0;
51117 118 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_11) < 0))) __PYX_ERR(0, 1541, __pyx_L1_error)
51118 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51119 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51120 :
51121 : /* "scipy/linalg/_decomp_interpolative.pyx":1544
51122 : *
51123 : * # Swap col_norms[krank] and col_norms[kpiv]
51124 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]] # <<<<<<<<<<<<<<
51125 : *
51126 : * if k < m-1:
51127 : */
51128 118 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1544, __pyx_L1_error)
51129 118 : __Pyx_GOTREF(__pyx_t_11);
51130 118 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error)
51131 118 : __Pyx_GOTREF(__pyx_t_2);
51132 118 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1544, __pyx_L1_error)
51133 118 : __Pyx_GOTREF(__pyx_t_16);
51134 118 : __Pyx_GIVEREF(__pyx_t_11);
51135 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_11)) __PYX_ERR(0, 1544, __pyx_L1_error);
51136 118 : __Pyx_GIVEREF(__pyx_t_2);
51137 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error);
51138 118 : __pyx_t_11 = 0;
51139 118 : __pyx_t_2 = 0;
51140 118 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error)
51141 118 : __Pyx_GOTREF(__pyx_t_2);
51142 118 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
51143 118 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1544, __pyx_L1_error)
51144 118 : __Pyx_GOTREF(__pyx_t_16);
51145 118 : __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1544, __pyx_L1_error)
51146 118 : __Pyx_GOTREF(__pyx_t_11);
51147 118 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1544, __pyx_L1_error)
51148 118 : __Pyx_GOTREF(__pyx_t_12);
51149 118 : __Pyx_GIVEREF(__pyx_t_16);
51150 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_16)) __PYX_ERR(0, 1544, __pyx_L1_error);
51151 118 : __Pyx_GIVEREF(__pyx_t_11);
51152 118 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11)) __PYX_ERR(0, 1544, __pyx_L1_error);
51153 118 : __pyx_t_16 = 0;
51154 118 : __pyx_t_11 = 0;
51155 118 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_12, __pyx_t_2) < 0))) __PYX_ERR(0, 1544, __pyx_L1_error)
51156 118 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
51157 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51158 :
51159 : /* "scipy/linalg/_decomp_interpolative.pyx":1546
51160 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]]
51161 : *
51162 : * if k < m-1: # <<<<<<<<<<<<<<
51163 : * # Compute the householder reflector for column k
51164 : * tmp_sca = a[k, k]
51165 : */
51166 118 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_m - 1));
51167 118 : if (__pyx_t_15) {
51168 :
51169 : /* "scipy/linalg/_decomp_interpolative.pyx":1548
51170 : * if k < m-1:
51171 : * # Compute the householder reflector for column k
51172 : * tmp_sca = a[k, k] # <<<<<<<<<<<<<<
51173 : * # FIX: Convert these to F_INT
51174 : * tmp_int = <int>(m - k)
51175 : */
51176 118 : __pyx_t_10 = __pyx_v_k;
51177 118 : __pyx_t_9 = __pyx_v_k;
51178 118 : __pyx_v_tmp_sca = (*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_a.diminfo[1].strides));
51179 :
51180 : /* "scipy/linalg/_decomp_interpolative.pyx":1550
51181 : * tmp_sca = a[k, k]
51182 : * # FIX: Convert these to F_INT
51183 : * tmp_int = <int>(m - k) # <<<<<<<<<<<<<<
51184 : * int_n = <int>n
51185 : * zlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k])
51186 : */
51187 118 : __pyx_v_tmp_int = ((int)(__pyx_v_m - __pyx_v_k));
51188 :
51189 : /* "scipy/linalg/_decomp_interpolative.pyx":1551
51190 : * # FIX: Convert these to F_INT
51191 : * tmp_int = <int>(m - k)
51192 : * int_n = <int>n # <<<<<<<<<<<<<<
51193 : * zlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k])
51194 : *
51195 : */
51196 118 : __pyx_v_int_n = ((int)__pyx_v_n);
51197 :
51198 : /* "scipy/linalg/_decomp_interpolative.pyx":1552
51199 : * tmp_int = <int>(m - k)
51200 : * int_n = <int>n
51201 : * zlarfgp(&tmp_int, &tmp_sca, &a[k+1, k], &int_n, &taus_v[k]) # <<<<<<<<<<<<<<
51202 : *
51203 : * # Overwrite with 1. for easy matmul
51204 : */
51205 118 : __pyx_t_9 = (__pyx_v_k + 1);
51206 118 : __pyx_t_10 = __pyx_v_k;
51207 118 : __pyx_t_17 = __pyx_v_k;
51208 118 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp((&__pyx_v_tmp_int), (&__pyx_v_tmp_sca), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_int_n), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_taus_v.data) + __pyx_t_17)) )))));
51209 :
51210 : /* "scipy/linalg/_decomp_interpolative.pyx":1555
51211 : *
51212 : * # Overwrite with 1. for easy matmul
51213 : * a[k, k] = 1.0 # <<<<<<<<<<<<<<
51214 : * if k < n-1:
51215 : * # Apply the householder reflector to the rest on the right.
51216 : */
51217 118 : __pyx_t_17 = __pyx_v_k;
51218 118 : __pyx_t_10 = __pyx_v_k;
51219 118 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1.0, 0);
51220 :
51221 : /* "scipy/linalg/_decomp_interpolative.pyx":1556
51222 : * # Overwrite with 1. for easy matmul
51223 : * a[k, k] = 1.0
51224 : * if k < n-1: # <<<<<<<<<<<<<<
51225 : * # Apply the householder reflector to the rest on the right.
51226 : * # Note! Tau returned by zlarfgp is complex valued and thus,
51227 : */
51228 118 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
51229 118 : if (__pyx_t_15) {
51230 :
51231 : /* "scipy/linalg/_decomp_interpolative.pyx":1561
51232 : * # reflector is not Hermitian, hence the conjugates. See the
51233 : * # documentation of zlarfgp.
51234 : * a[k:, k+1:] -= np.outer(taus[k].conj()*a[k:, k], # <<<<<<<<<<<<<<
51235 : * a[k:, k].conj() @ a[k:, k+1:]
51236 : * )
51237 : */
51238 118 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1561, __pyx_L1_error)
51239 118 : __Pyx_GOTREF(__pyx_t_2);
51240 118 : __pyx_t_12 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1561, __pyx_L1_error)
51241 118 : __Pyx_GOTREF(__pyx_t_12);
51242 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51243 118 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1561, __pyx_L1_error)
51244 118 : __Pyx_GOTREF(__pyx_t_2);
51245 118 : __pyx_t_11 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1561, __pyx_L1_error)
51246 118 : __Pyx_GOTREF(__pyx_t_11);
51247 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51248 118 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1561, __pyx_L1_error)
51249 118 : __Pyx_GOTREF(__pyx_t_2);
51250 118 : __Pyx_GIVEREF(__pyx_t_12);
51251 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12)) __PYX_ERR(0, 1561, __pyx_L1_error);
51252 118 : __Pyx_GIVEREF(__pyx_t_11);
51253 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_11)) __PYX_ERR(0, 1561, __pyx_L1_error);
51254 118 : __pyx_t_12 = 0;
51255 118 : __pyx_t_11 = 0;
51256 118 : __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1561, __pyx_L1_error)
51257 118 : __Pyx_GOTREF(__pyx_t_11);
51258 118 : __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1561, __pyx_L1_error)
51259 118 : __Pyx_GOTREF(__pyx_t_16);
51260 118 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_outer); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1561, __pyx_L1_error)
51261 118 : __Pyx_GOTREF(__pyx_t_18);
51262 118 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
51263 118 : __pyx_t_19 = __Pyx_GetItemInt(((PyObject *)__pyx_v_taus), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1561, __pyx_L1_error)
51264 118 : __Pyx_GOTREF(__pyx_t_19);
51265 118 : __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conj); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1561, __pyx_L1_error)
51266 118 : __Pyx_GOTREF(__pyx_t_20);
51267 118 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
51268 118 : __pyx_t_19 = NULL;
51269 118 : __pyx_t_13 = 0;
51270 : #if CYTHON_UNPACK_METHODS
51271 118 : if (likely(PyMethod_Check(__pyx_t_20))) {
51272 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20);
51273 0 : if (likely(__pyx_t_19)) {
51274 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
51275 0 : __Pyx_INCREF(__pyx_t_19);
51276 0 : __Pyx_INCREF(function);
51277 0 : __Pyx_DECREF_SET(__pyx_t_20, function);
51278 : __pyx_t_13 = 1;
51279 : }
51280 : }
51281 : #endif
51282 : {
51283 118 : PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
51284 118 : __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
51285 118 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
51286 118 : if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1561, __pyx_L1_error)
51287 118 : __Pyx_GOTREF(__pyx_t_16);
51288 118 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
51289 : }
51290 118 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1561, __pyx_L1_error)
51291 118 : __Pyx_GOTREF(__pyx_t_20);
51292 118 : __pyx_t_19 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1561, __pyx_L1_error)
51293 118 : __Pyx_GOTREF(__pyx_t_19);
51294 118 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
51295 118 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1561, __pyx_L1_error)
51296 118 : __Pyx_GOTREF(__pyx_t_20);
51297 118 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1561, __pyx_L1_error)
51298 118 : __Pyx_GOTREF(__pyx_t_21);
51299 118 : __Pyx_GIVEREF(__pyx_t_19);
51300 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19)) __PYX_ERR(0, 1561, __pyx_L1_error);
51301 118 : __Pyx_GIVEREF(__pyx_t_20);
51302 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20)) __PYX_ERR(0, 1561, __pyx_L1_error);
51303 118 : __pyx_t_19 = 0;
51304 118 : __pyx_t_20 = 0;
51305 118 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1561, __pyx_L1_error)
51306 118 : __Pyx_GOTREF(__pyx_t_20);
51307 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51308 118 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_16, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1561, __pyx_L1_error)
51309 118 : __Pyx_GOTREF(__pyx_t_21);
51310 118 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
51311 118 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
51312 :
51313 : /* "scipy/linalg/_decomp_interpolative.pyx":1562
51314 : * # documentation of zlarfgp.
51315 : * a[k:, k+1:] -= np.outer(taus[k].conj()*a[k:, k],
51316 : * a[k:, k].conj() @ a[k:, k+1:] # <<<<<<<<<<<<<<
51317 : * )
51318 : *
51319 : */
51320 118 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
51321 118 : __Pyx_GOTREF(__pyx_t_16);
51322 118 : __pyx_t_19 = PySlice_New(__pyx_t_16, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1562, __pyx_L1_error)
51323 118 : __Pyx_GOTREF(__pyx_t_19);
51324 118 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
51325 118 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
51326 118 : __Pyx_GOTREF(__pyx_t_16);
51327 118 : __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51328 118 : __Pyx_GOTREF(__pyx_t_22);
51329 118 : __Pyx_GIVEREF(__pyx_t_19);
51330 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19)) __PYX_ERR(0, 1562, __pyx_L1_error);
51331 118 : __Pyx_GIVEREF(__pyx_t_16);
51332 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error);
51333 118 : __pyx_t_19 = 0;
51334 118 : __pyx_t_16 = 0;
51335 118 : __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_22); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
51336 118 : __Pyx_GOTREF(__pyx_t_16);
51337 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51338 118 : __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_conj); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51339 118 : __Pyx_GOTREF(__pyx_t_22);
51340 118 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
51341 118 : __pyx_t_16 = NULL;
51342 118 : __pyx_t_13 = 0;
51343 : #if CYTHON_UNPACK_METHODS
51344 118 : if (likely(PyMethod_Check(__pyx_t_22))) {
51345 0 : __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_22);
51346 0 : if (likely(__pyx_t_16)) {
51347 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
51348 0 : __Pyx_INCREF(__pyx_t_16);
51349 0 : __Pyx_INCREF(function);
51350 0 : __Pyx_DECREF_SET(__pyx_t_22, function);
51351 : __pyx_t_13 = 1;
51352 : }
51353 : }
51354 : #endif
51355 : {
51356 118 : PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
51357 118 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
51358 118 : __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
51359 118 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1562, __pyx_L1_error)
51360 118 : __Pyx_GOTREF(__pyx_t_20);
51361 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51362 : }
51363 118 : __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51364 118 : __Pyx_GOTREF(__pyx_t_22);
51365 118 : __pyx_t_16 = PySlice_New(__pyx_t_22, Py_None, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error)
51366 118 : __Pyx_GOTREF(__pyx_t_16);
51367 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51368 118 : __pyx_t_22 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51369 118 : __Pyx_GOTREF(__pyx_t_22);
51370 118 : __pyx_t_19 = PySlice_New(__pyx_t_22, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1562, __pyx_L1_error)
51371 118 : __Pyx_GOTREF(__pyx_t_19);
51372 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51373 118 : __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51374 118 : __Pyx_GOTREF(__pyx_t_22);
51375 118 : __Pyx_GIVEREF(__pyx_t_16);
51376 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_16)) __PYX_ERR(0, 1562, __pyx_L1_error);
51377 118 : __Pyx_GIVEREF(__pyx_t_19);
51378 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_19)) __PYX_ERR(0, 1562, __pyx_L1_error);
51379 118 : __pyx_t_16 = 0;
51380 118 : __pyx_t_19 = 0;
51381 118 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_22); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1562, __pyx_L1_error)
51382 118 : __Pyx_GOTREF(__pyx_t_19);
51383 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51384 118 : __pyx_t_22 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1562, __pyx_L1_error)
51385 118 : __Pyx_GOTREF(__pyx_t_22);
51386 118 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
51387 118 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
51388 118 : __pyx_t_19 = NULL;
51389 118 : __pyx_t_13 = 0;
51390 : #if CYTHON_UNPACK_METHODS
51391 118 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
51392 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
51393 0 : if (likely(__pyx_t_19)) {
51394 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
51395 0 : __Pyx_INCREF(__pyx_t_19);
51396 0 : __Pyx_INCREF(function);
51397 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
51398 : __pyx_t_13 = 1;
51399 : }
51400 : }
51401 : #endif
51402 : {
51403 118 : PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_21, __pyx_t_22};
51404 118 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
51405 118 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
51406 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51407 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51408 118 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1561, __pyx_L1_error)
51409 118 : __Pyx_GOTREF(__pyx_t_12);
51410 118 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51411 : }
51412 :
51413 : /* "scipy/linalg/_decomp_interpolative.pyx":1561
51414 : * # reflector is not Hermitian, hence the conjugates. See the
51415 : * # documentation of zlarfgp.
51416 : * a[k:, k+1:] -= np.outer(taus[k].conj()*a[k:, k], # <<<<<<<<<<<<<<
51417 : * a[k:, k].conj() @ a[k:, k+1:]
51418 : * )
51419 : */
51420 118 : __pyx_t_18 = PyNumber_InPlaceSubtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1561, __pyx_L1_error)
51421 118 : __Pyx_GOTREF(__pyx_t_18);
51422 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51423 118 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
51424 118 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_18) < 0))) __PYX_ERR(0, 1561, __pyx_L1_error)
51425 118 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51426 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51427 :
51428 : /* "scipy/linalg/_decomp_interpolative.pyx":1556
51429 : * # Overwrite with 1. for easy matmul
51430 : * a[k, k] = 1.0
51431 : * if k < n-1: # <<<<<<<<<<<<<<
51432 : * # Apply the householder reflector to the rest on the right.
51433 : * # Note! Tau returned by zlarfgp is complex valued and thus,
51434 : */
51435 : }
51436 :
51437 : /* "scipy/linalg/_decomp_interpolative.pyx":1566
51438 : *
51439 : * # Put back the beta in place
51440 : * a[k, k] = tmp_sca # <<<<<<<<<<<<<<
51441 : * # Update the norms
51442 : * col_norms[k] = 0
51443 : */
51444 118 : __pyx_t_10 = __pyx_v_k;
51445 118 : __pyx_t_17 = __pyx_v_k;
51446 118 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_v_tmp_sca;
51447 :
51448 : /* "scipy/linalg/_decomp_interpolative.pyx":1568
51449 : * a[k, k] = tmp_sca
51450 : * # Update the norms
51451 : * col_norms[k] = 0 # <<<<<<<<<<<<<<
51452 : * col_norms[k+1:] -= (a[k, k+1:] * a[k, k+1:].conj()).real
51453 : * ssmax = 0.0
51454 : */
51455 118 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_k, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
51456 :
51457 : /* "scipy/linalg/_decomp_interpolative.pyx":1569
51458 : * # Update the norms
51459 : * col_norms[k] = 0
51460 : * col_norms[k+1:] -= (a[k, k+1:] * a[k, k+1:].conj()).real # <<<<<<<<<<<<<<
51461 : * ssmax = 0.0
51462 : * kpiv = k+1
51463 : */
51464 118 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1569, __pyx_L1_error)
51465 118 : __Pyx_GOTREF(__pyx_t_2);
51466 118 : __pyx_t_18 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1569, __pyx_L1_error)
51467 118 : __Pyx_GOTREF(__pyx_t_18);
51468 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51469 118 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1569, __pyx_L1_error)
51470 118 : __Pyx_GOTREF(__pyx_t_2);
51471 118 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1569, __pyx_L1_error)
51472 118 : __Pyx_GOTREF(__pyx_t_12);
51473 118 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1569, __pyx_L1_error)
51474 118 : __Pyx_GOTREF(__pyx_t_11);
51475 118 : __pyx_t_22 = PySlice_New(__pyx_t_11, Py_None, Py_None); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1569, __pyx_L1_error)
51476 118 : __Pyx_GOTREF(__pyx_t_22);
51477 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51478 118 : __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1569, __pyx_L1_error)
51479 118 : __Pyx_GOTREF(__pyx_t_11);
51480 118 : __Pyx_GIVEREF(__pyx_t_12);
51481 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12)) __PYX_ERR(0, 1569, __pyx_L1_error);
51482 118 : __Pyx_GIVEREF(__pyx_t_22);
51483 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_22)) __PYX_ERR(0, 1569, __pyx_L1_error);
51484 118 : __pyx_t_12 = 0;
51485 118 : __pyx_t_22 = 0;
51486 118 : __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_11); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1569, __pyx_L1_error)
51487 118 : __Pyx_GOTREF(__pyx_t_22);
51488 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51489 118 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1569, __pyx_L1_error)
51490 118 : __Pyx_GOTREF(__pyx_t_12);
51491 118 : __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1569, __pyx_L1_error)
51492 118 : __Pyx_GOTREF(__pyx_t_21);
51493 118 : __pyx_t_19 = PySlice_New(__pyx_t_21, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1569, __pyx_L1_error)
51494 118 : __Pyx_GOTREF(__pyx_t_19);
51495 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51496 118 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1569, __pyx_L1_error)
51497 118 : __Pyx_GOTREF(__pyx_t_21);
51498 118 : __Pyx_GIVEREF(__pyx_t_12);
51499 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_12)) __PYX_ERR(0, 1569, __pyx_L1_error);
51500 118 : __Pyx_GIVEREF(__pyx_t_19);
51501 118 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19)) __PYX_ERR(0, 1569, __pyx_L1_error);
51502 118 : __pyx_t_12 = 0;
51503 118 : __pyx_t_19 = 0;
51504 118 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1569, __pyx_L1_error)
51505 118 : __Pyx_GOTREF(__pyx_t_19);
51506 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51507 118 : __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conj); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1569, __pyx_L1_error)
51508 118 : __Pyx_GOTREF(__pyx_t_21);
51509 118 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
51510 118 : __pyx_t_19 = NULL;
51511 118 : __pyx_t_13 = 0;
51512 : #if CYTHON_UNPACK_METHODS
51513 118 : if (likely(PyMethod_Check(__pyx_t_21))) {
51514 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_21);
51515 0 : if (likely(__pyx_t_19)) {
51516 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
51517 0 : __Pyx_INCREF(__pyx_t_19);
51518 0 : __Pyx_INCREF(function);
51519 0 : __Pyx_DECREF_SET(__pyx_t_21, function);
51520 : __pyx_t_13 = 1;
51521 : }
51522 : }
51523 : #endif
51524 : {
51525 118 : PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
51526 118 : __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
51527 118 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
51528 118 : if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1569, __pyx_L1_error)
51529 118 : __Pyx_GOTREF(__pyx_t_11);
51530 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51531 : }
51532 118 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_22, __pyx_t_11); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1569, __pyx_L1_error)
51533 118 : __Pyx_GOTREF(__pyx_t_21);
51534 118 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
51535 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51536 118 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_real); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1569, __pyx_L1_error)
51537 118 : __Pyx_GOTREF(__pyx_t_11);
51538 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51539 118 : __pyx_t_21 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1569, __pyx_L1_error)
51540 118 : __Pyx_GOTREF(__pyx_t_21);
51541 118 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51542 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51543 118 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18, __pyx_t_21) < 0))) __PYX_ERR(0, 1569, __pyx_L1_error)
51544 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51545 118 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51546 :
51547 : /* "scipy/linalg/_decomp_interpolative.pyx":1570
51548 : * col_norms[k] = 0
51549 : * col_norms[k+1:] -= (a[k, k+1:] * a[k, k+1:].conj()).real
51550 : * ssmax = 0.0 # <<<<<<<<<<<<<<
51551 : * kpiv = k+1
51552 : *
51553 : */
51554 118 : __pyx_v_ssmax = 0.0;
51555 :
51556 : /* "scipy/linalg/_decomp_interpolative.pyx":1571
51557 : * col_norms[k+1:] -= (a[k, k+1:] * a[k, k+1:].conj()).real
51558 : * ssmax = 0.0
51559 : * kpiv = k+1 # <<<<<<<<<<<<<<
51560 : *
51561 : * if k < n-1:
51562 : */
51563 118 : __pyx_v_kpiv = (__pyx_v_k + 1);
51564 :
51565 : /* "scipy/linalg/_decomp_interpolative.pyx":1573
51566 : * kpiv = k+1
51567 : *
51568 : * if k < n-1: # <<<<<<<<<<<<<<
51569 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51570 : * ssmax = col_norms[kpiv]
51571 : */
51572 118 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
51573 118 : if (__pyx_t_15) {
51574 :
51575 : /* "scipy/linalg/_decomp_interpolative.pyx":1574
51576 : *
51577 : * if k < n-1:
51578 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1) # <<<<<<<<<<<<<<
51579 : * ssmax = col_norms[kpiv]
51580 : *
51581 : */
51582 118 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1574, __pyx_L1_error)
51583 118 : __Pyx_GOTREF(__pyx_t_21);
51584 118 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_argmax); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1574, __pyx_L1_error)
51585 118 : __Pyx_GOTREF(__pyx_t_11);
51586 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51587 118 : __pyx_t_21 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_k + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1574, __pyx_L1_error)
51588 118 : __Pyx_GOTREF(__pyx_t_21);
51589 118 : __pyx_t_2 = NULL;
51590 118 : __pyx_t_13 = 0;
51591 : #if CYTHON_UNPACK_METHODS
51592 118 : if (unlikely(PyMethod_Check(__pyx_t_11))) {
51593 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
51594 0 : if (likely(__pyx_t_2)) {
51595 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
51596 0 : __Pyx_INCREF(__pyx_t_2);
51597 0 : __Pyx_INCREF(function);
51598 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
51599 : __pyx_t_13 = 1;
51600 : }
51601 : }
51602 : #endif
51603 : {
51604 118 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_21};
51605 118 : __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
51606 118 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
51607 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51608 118 : if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1574, __pyx_L1_error)
51609 118 : __Pyx_GOTREF(__pyx_t_18);
51610 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51611 : }
51612 118 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1574, __pyx_L1_error)
51613 118 : __Pyx_GOTREF(__pyx_t_11);
51614 118 : __pyx_t_21 = PyNumber_Add(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1574, __pyx_L1_error)
51615 118 : __Pyx_GOTREF(__pyx_t_21);
51616 118 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51617 118 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51618 118 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_21); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1574, __pyx_L1_error)
51619 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51620 118 : __pyx_v_kpiv = __pyx_t_23;
51621 :
51622 : /* "scipy/linalg/_decomp_interpolative.pyx":1575
51623 : * if k < n-1:
51624 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51625 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
51626 : *
51627 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
51628 : */
51629 118 : __pyx_t_21 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1575, __pyx_L1_error)
51630 118 : __Pyx_GOTREF(__pyx_t_21);
51631 118 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_21); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L1_error)
51632 118 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51633 : __pyx_v_ssmax = __pyx_t_14;
51634 :
51635 : /* "scipy/linalg/_decomp_interpolative.pyx":1573
51636 : * kpiv = k+1
51637 : *
51638 : * if k < n-1: # <<<<<<<<<<<<<<
51639 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51640 : * ssmax = col_norms[kpiv]
51641 : */
51642 : }
51643 :
51644 : /* "scipy/linalg/_decomp_interpolative.pyx":1577
51645 : * ssmax = col_norms[kpiv]
51646 : *
51647 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
51648 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
51649 : * nupdate += 1
51650 : */
51651 118 : __pyx_t_24 = (__pyx_v_ssmax < ((1000.0 * __pyx_v_feps) * __pyx_v_ssmaxin));
51652 118 : if (!__pyx_t_24) {
51653 70 : goto __pyx_L12_next_or;
51654 : } else {
51655 48 : }
51656 48 : __pyx_t_24 = (__pyx_v_nupdate == 0);
51657 48 : if (!__pyx_t_24) {
51658 : } else {
51659 8 : __pyx_t_15 = __pyx_t_24;
51660 8 : goto __pyx_L11_bool_binop_done;
51661 : }
51662 110 : __pyx_L12_next_or:;
51663 :
51664 : /* "scipy/linalg/_decomp_interpolative.pyx":1578
51665 : *
51666 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
51667 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))): # <<<<<<<<<<<<<<
51668 : * nupdate += 1
51669 : * ssmax = 0
51670 : */
51671 110 : __pyx_t_24 = (__pyx_v_ssmax < (pow((1000.0 * __pyx_v_feps), 2.0) * __pyx_v_ssmaxin));
51672 110 : if (__pyx_t_24) {
51673 0 : } else {
51674 110 : __pyx_t_15 = __pyx_t_24;
51675 110 : goto __pyx_L11_bool_binop_done;
51676 : }
51677 0 : __pyx_t_24 = (__pyx_v_nupdate == 1);
51678 0 : __pyx_t_15 = __pyx_t_24;
51679 118 : __pyx_L11_bool_binop_done:;
51680 :
51681 : /* "scipy/linalg/_decomp_interpolative.pyx":1577
51682 : * ssmax = col_norms[kpiv]
51683 : *
51684 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
51685 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
51686 : * nupdate += 1
51687 : */
51688 118 : if (__pyx_t_15) {
51689 :
51690 : /* "scipy/linalg/_decomp_interpolative.pyx":1579
51691 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
51692 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
51693 : * nupdate += 1 # <<<<<<<<<<<<<<
51694 : * ssmax = 0
51695 : * kpiv = k+1
51696 : */
51697 8 : __pyx_v_nupdate = (__pyx_v_nupdate + 1);
51698 :
51699 : /* "scipy/linalg/_decomp_interpolative.pyx":1580
51700 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
51701 : * nupdate += 1
51702 : * ssmax = 0 # <<<<<<<<<<<<<<
51703 : * kpiv = k+1
51704 : * if k < n-1:
51705 : */
51706 8 : __pyx_v_ssmax = 0.0;
51707 :
51708 : /* "scipy/linalg/_decomp_interpolative.pyx":1581
51709 : * nupdate += 1
51710 : * ssmax = 0
51711 : * kpiv = k+1 # <<<<<<<<<<<<<<
51712 : * if k < n-1:
51713 : * for i in range(k+1, n):
51714 : */
51715 8 : __pyx_v_kpiv = (__pyx_v_k + 1);
51716 :
51717 : /* "scipy/linalg/_decomp_interpolative.pyx":1582
51718 : * ssmax = 0
51719 : * kpiv = k+1
51720 : * if k < n-1: # <<<<<<<<<<<<<<
51721 : * for i in range(k+1, n):
51722 : * tmp_int = m-k-1
51723 : */
51724 8 : __pyx_t_15 = (__pyx_v_k < (__pyx_v_n - 1));
51725 8 : if (__pyx_t_15) {
51726 :
51727 : /* "scipy/linalg/_decomp_interpolative.pyx":1583
51728 : * kpiv = k+1
51729 : * if k < n-1:
51730 : * for i in range(k+1, n): # <<<<<<<<<<<<<<
51731 : * tmp_int = m-k-1
51732 : * col_norms[i] = dznrm2(&tmp_int, &a[k+1, i], &n)**2
51733 : */
51734 1740 : __pyx_t_23 = __pyx_v_n;
51735 : __pyx_t_25 = __pyx_t_23;
51736 1740 : for (__pyx_t_26 = (__pyx_v_k + 1); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
51737 1732 : __pyx_v_i = __pyx_t_26;
51738 :
51739 : /* "scipy/linalg/_decomp_interpolative.pyx":1584
51740 : * if k < n-1:
51741 : * for i in range(k+1, n):
51742 : * tmp_int = m-k-1 # <<<<<<<<<<<<<<
51743 : * col_norms[i] = dznrm2(&tmp_int, &a[k+1, i], &n)**2
51744 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51745 : */
51746 1732 : __pyx_v_tmp_int = ((__pyx_v_m - __pyx_v_k) - 1);
51747 :
51748 : /* "scipy/linalg/_decomp_interpolative.pyx":1585
51749 : * for i in range(k+1, n):
51750 : * tmp_int = m-k-1
51751 : * col_norms[i] = dznrm2(&tmp_int, &a[k+1, i], &n)**2 # <<<<<<<<<<<<<<
51752 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51753 : * ssmax = col_norms[kpiv]
51754 : */
51755 1732 : __pyx_t_17 = (__pyx_v_k + 1);
51756 1732 : __pyx_t_10 = __pyx_v_i;
51757 1732 : __pyx_t_21 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_tmp_int), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1585, __pyx_L1_error)
51758 1732 : __Pyx_GOTREF(__pyx_t_21);
51759 1732 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_21, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1585, __pyx_L1_error)
51760 3464 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51761 : }
51762 :
51763 : /* "scipy/linalg/_decomp_interpolative.pyx":1586
51764 : * tmp_int = m-k-1
51765 : * col_norms[i] = dznrm2(&tmp_int, &a[k+1, i], &n)**2
51766 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1) # <<<<<<<<<<<<<<
51767 : * ssmax = col_norms[kpiv]
51768 : * if (ssmax <= (eps**2)*ssmaxin):
51769 : */
51770 8 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1586, __pyx_L1_error)
51771 8 : __Pyx_GOTREF(__pyx_t_11);
51772 8 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_argmax); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1586, __pyx_L1_error)
51773 8 : __Pyx_GOTREF(__pyx_t_18);
51774 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51775 8 : __pyx_t_11 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_k + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1586, __pyx_L1_error)
51776 8 : __Pyx_GOTREF(__pyx_t_11);
51777 8 : __pyx_t_2 = NULL;
51778 8 : __pyx_t_13 = 0;
51779 : #if CYTHON_UNPACK_METHODS
51780 8 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
51781 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18);
51782 0 : if (likely(__pyx_t_2)) {
51783 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
51784 0 : __Pyx_INCREF(__pyx_t_2);
51785 0 : __Pyx_INCREF(function);
51786 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
51787 : __pyx_t_13 = 1;
51788 : }
51789 : }
51790 : #endif
51791 : {
51792 8 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
51793 8 : __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
51794 8 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
51795 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51796 8 : if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1586, __pyx_L1_error)
51797 8 : __Pyx_GOTREF(__pyx_t_21);
51798 8 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51799 : }
51800 8 : __pyx_t_18 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1586, __pyx_L1_error)
51801 8 : __Pyx_GOTREF(__pyx_t_18);
51802 8 : __pyx_t_11 = PyNumber_Add(__pyx_t_21, __pyx_t_18); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1586, __pyx_L1_error)
51803 8 : __Pyx_GOTREF(__pyx_t_11);
51804 8 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
51805 8 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
51806 8 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1586, __pyx_L1_error)
51807 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51808 8 : __pyx_v_kpiv = __pyx_t_23;
51809 :
51810 : /* "scipy/linalg/_decomp_interpolative.pyx":1587
51811 : * col_norms[i] = dznrm2(&tmp_int, &a[k+1, i], &n)**2
51812 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51813 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
51814 : * if (ssmax <= (eps**2)*ssmaxin):
51815 : * break
51816 : */
51817 8 : __pyx_t_11 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1587, __pyx_L1_error)
51818 8 : __Pyx_GOTREF(__pyx_t_11);
51819 8 : __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1587, __pyx_L1_error)
51820 8 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
51821 : __pyx_v_ssmax = __pyx_t_14;
51822 :
51823 : /* "scipy/linalg/_decomp_interpolative.pyx":1582
51824 : * ssmax = 0
51825 : * kpiv = k+1
51826 : * if k < n-1: # <<<<<<<<<<<<<<
51827 : * for i in range(k+1, n):
51828 : * tmp_int = m-k-1
51829 : */
51830 : }
51831 :
51832 : /* "scipy/linalg/_decomp_interpolative.pyx":1577
51833 : * ssmax = col_norms[kpiv]
51834 : *
51835 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
51836 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
51837 : * nupdate += 1
51838 : */
51839 : }
51840 :
51841 : /* "scipy/linalg/_decomp_interpolative.pyx":1546
51842 : * col_norms[[kpiv, k]] = col_norms[[k, kpiv]]
51843 : *
51844 : * if k < m-1: # <<<<<<<<<<<<<<
51845 : * # Compute the householder reflector for column k
51846 : * tmp_sca = a[k, k]
51847 : */
51848 : }
51849 :
51850 : /* "scipy/linalg/_decomp_interpolative.pyx":1588
51851 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51852 : * ssmax = col_norms[kpiv]
51853 : * if (ssmax <= (eps**2)*ssmaxin): # <<<<<<<<<<<<<<
51854 : * break
51855 : * # a is overwritten; return numerical rank and pivots
51856 : */
51857 118 : __pyx_t_15 = (__pyx_v_ssmax <= (pow(__pyx_v_eps, 2.0) * __pyx_v_ssmaxin));
51858 118 : if (__pyx_t_15) {
51859 :
51860 : /* "scipy/linalg/_decomp_interpolative.pyx":1589
51861 : * ssmax = col_norms[kpiv]
51862 : * if (ssmax <= (eps**2)*ssmaxin):
51863 : * break # <<<<<<<<<<<<<<
51864 : * # a is overwritten; return numerical rank and pivots
51865 : *
51866 : */
51867 8 : goto __pyx_L6_break;
51868 :
51869 : /* "scipy/linalg/_decomp_interpolative.pyx":1588
51870 : * kpiv = np.argmax(col_norms[k+1:]) + (k + 1)
51871 : * ssmax = col_norms[kpiv]
51872 : * if (ssmax <= (eps**2)*ssmaxin): # <<<<<<<<<<<<<<
51873 : * break
51874 : * # a is overwritten; return numerical rank and pivots
51875 : */
51876 : }
51877 : }
51878 0 : __pyx_L6_break:;
51879 :
51880 : /* "scipy/linalg/_decomp_interpolative.pyx":1592
51881 : * # a is overwritten; return numerical rank and pivots
51882 : *
51883 : * return k+1, taus, ind # <<<<<<<<<<<<<<
51884 : *
51885 : *
51886 : */
51887 8 : __Pyx_XDECREF(__pyx_r);
51888 8 : __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1592, __pyx_L1_error)
51889 8 : __Pyx_GOTREF(__pyx_t_11);
51890 8 : __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1592, __pyx_L1_error)
51891 8 : __Pyx_GOTREF(__pyx_t_18);
51892 8 : __Pyx_GIVEREF(__pyx_t_11);
51893 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_11)) __PYX_ERR(0, 1592, __pyx_L1_error);
51894 8 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
51895 8 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
51896 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 1592, __pyx_L1_error);
51897 8 : __Pyx_INCREF((PyObject *)__pyx_v_ind);
51898 8 : __Pyx_GIVEREF((PyObject *)__pyx_v_ind);
51899 8 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 2, ((PyObject *)__pyx_v_ind))) __PYX_ERR(0, 1592, __pyx_L1_error);
51900 8 : __pyx_t_11 = 0;
51901 8 : __pyx_r = __pyx_t_18;
51902 8 : __pyx_t_18 = 0;
51903 8 : goto __pyx_L0;
51904 :
51905 : /* "scipy/linalg/_decomp_interpolative.pyx":1517
51906 : *
51907 : *
51908 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
51909 : * cdef int m = a.shape[0], n = a.shape[1]
51910 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
51911 : */
51912 :
51913 : /* function exit code */
51914 0 : __pyx_L1_error:;
51915 0 : __Pyx_XDECREF(__pyx_t_2);
51916 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
51917 0 : __Pyx_XDECREF(__pyx_t_11);
51918 0 : __Pyx_XDECREF(__pyx_t_12);
51919 0 : __Pyx_XDECREF(__pyx_t_16);
51920 0 : __Pyx_XDECREF(__pyx_t_18);
51921 0 : __Pyx_XDECREF(__pyx_t_19);
51922 0 : __Pyx_XDECREF(__pyx_t_20);
51923 0 : __Pyx_XDECREF(__pyx_t_21);
51924 0 : __Pyx_XDECREF(__pyx_t_22);
51925 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
51926 0 : __Pyx_PyThreadState_declare
51927 0 : __Pyx_PyThreadState_assign
51928 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
51929 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
51930 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
51931 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
51932 0 : __pyx_r = NULL;
51933 0 : goto __pyx_L2;
51934 8 : __pyx_L0:;
51935 8 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
51936 8 : __pyx_L2:;
51937 8 : __Pyx_XDECREF((PyObject *)__pyx_v_col_norms);
51938 8 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
51939 8 : __Pyx_XDECREF((PyObject *)__pyx_v_ind);
51940 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_taus_v, 1);
51941 8 : __Pyx_XGIVEREF(__pyx_r);
51942 8 : __Pyx_RefNannyFinishContext();
51943 8 : return __pyx_r;
51944 : }
51945 :
51946 : /* "scipy/linalg/_decomp_interpolative.pyx":1595
51947 : *
51948 : *
51949 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
51950 : * _, ret = idz_findrank(A, eps, rng=rng)
51951 : * return idzp_id(ret, eps=eps)
51952 : */
51953 :
51954 : /* Python wrapper */
51955 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_61idzp_rid(PyObject *__pyx_self,
51956 : #if CYTHON_METH_FASTCALL
51957 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
51958 : #else
51959 : PyObject *__pyx_args, PyObject *__pyx_kwds
51960 : #endif
51961 : ); /*proto*/
51962 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_61idzp_rid = {"idzp_rid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_61idzp_rid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
51963 2 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_61idzp_rid(PyObject *__pyx_self,
51964 : #if CYTHON_METH_FASTCALL
51965 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
51966 : #else
51967 : PyObject *__pyx_args, PyObject *__pyx_kwds
51968 : #endif
51969 : ) {
51970 2 : PyObject *__pyx_v_A = 0;
51971 2 : __pyx_t_5numpy_float64_t __pyx_v_eps;
51972 2 : PyObject *__pyx_v_rng = 0;
51973 : #if !CYTHON_METH_FASTCALL
51974 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
51975 : #endif
51976 2 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
51977 2 : PyObject* values[3] = {0,0,0};
51978 2 : int __pyx_lineno = 0;
51979 2 : const char *__pyx_filename = NULL;
51980 2 : int __pyx_clineno = 0;
51981 2 : PyObject *__pyx_r = 0;
51982 : __Pyx_RefNannyDeclarations
51983 2 : __Pyx_RefNannySetupContext("idzp_rid (wrapper)", 0);
51984 : #if !CYTHON_METH_FASTCALL
51985 : #if CYTHON_ASSUME_SAFE_MACROS
51986 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
51987 : #else
51988 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
51989 : #endif
51990 : #endif
51991 2 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
51992 : {
51993 2 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
51994 2 : if (likely(__pyx_kwds)) {
51995 2 : Py_ssize_t kw_args;
51996 2 : switch (__pyx_nargs) {
51997 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
51998 2 : CYTHON_FALLTHROUGH;
51999 2 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
52000 2 : CYTHON_FALLTHROUGH;
52001 2 : case 0: break;
52002 0 : default: goto __pyx_L5_argtuple_error;
52003 : }
52004 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
52005 2 : switch (__pyx_nargs) {
52006 : case 0:
52007 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
52008 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
52009 0 : kw_args--;
52010 : }
52011 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
52012 0 : else goto __pyx_L5_argtuple_error;
52013 0 : CYTHON_FALLTHROUGH;
52014 : case 1:
52015 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
52016 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
52017 0 : kw_args--;
52018 : }
52019 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
52020 : else {
52021 0 : __Pyx_RaiseArgtupleInvalid("idzp_rid", 1, 2, 2, 1); __PYX_ERR(0, 1595, __pyx_L3_error)
52022 : }
52023 2 : CYTHON_FALLTHROUGH;
52024 : case 2:
52025 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
52026 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
52027 2 : kw_args--;
52028 : }
52029 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
52030 : else {
52031 0 : __Pyx_RaiseKeywordRequired("idzp_rid", __pyx_n_s_rng); __PYX_ERR(0, 1595, __pyx_L3_error)
52032 : }
52033 : }
52034 2 : if (unlikely(kw_args > 0)) {
52035 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
52036 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_rid") < 0)) __PYX_ERR(0, 1595, __pyx_L3_error)
52037 : }
52038 0 : } else if (unlikely(__pyx_nargs != 2)) {
52039 0 : goto __pyx_L5_argtuple_error;
52040 : } else {
52041 0 : __Pyx_RaiseKeywordRequired("idzp_rid", __pyx_n_s_rng); __PYX_ERR(0, 1595, __pyx_L3_error)
52042 : }
52043 2 : __pyx_v_A = values[0];
52044 2 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
52045 2 : __pyx_v_rng = values[2];
52046 : }
52047 2 : goto __pyx_L6_skip;
52048 0 : __pyx_L5_argtuple_error:;
52049 0 : __Pyx_RaiseArgtupleInvalid("idzp_rid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1595, __pyx_L3_error)
52050 2 : __pyx_L6_skip:;
52051 2 : goto __pyx_L4_argument_unpacking_done;
52052 0 : __pyx_L3_error:;
52053 : {
52054 0 : Py_ssize_t __pyx_temp;
52055 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52056 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52057 : }
52058 : }
52059 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
52060 0 : __Pyx_RefNannyFinishContext();
52061 0 : return NULL;
52062 2 : __pyx_L4_argument_unpacking_done:;
52063 2 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_60idzp_rid(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
52064 :
52065 : /* function exit code */
52066 : {
52067 2 : Py_ssize_t __pyx_temp;
52068 2 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52069 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52070 : }
52071 : }
52072 : __Pyx_RefNannyFinishContext();
52073 : return __pyx_r;
52074 : }
52075 :
52076 2 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_60idzp_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
52077 2 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
52078 2 : PyObject *__pyx_v_ret = NULL;
52079 2 : PyObject *__pyx_r = NULL;
52080 : __Pyx_RefNannyDeclarations
52081 2 : PyObject *__pyx_t_1 = NULL;
52082 2 : PyObject *__pyx_t_2 = NULL;
52083 2 : PyObject *__pyx_t_3 = NULL;
52084 2 : PyObject *__pyx_t_4 = NULL;
52085 2 : PyObject *(*__pyx_t_5)(PyObject *);
52086 2 : int __pyx_lineno = 0;
52087 2 : const char *__pyx_filename = NULL;
52088 2 : int __pyx_clineno = 0;
52089 2 : __Pyx_RefNannySetupContext("idzp_rid", 1);
52090 :
52091 : /* "scipy/linalg/_decomp_interpolative.pyx":1596
52092 : *
52093 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng):
52094 : * _, ret = idz_findrank(A, eps, rng=rng) # <<<<<<<<<<<<<<
52095 : * return idzp_id(ret, eps=eps)
52096 : *
52097 : */
52098 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idz_findrank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error)
52099 2 : __Pyx_GOTREF(__pyx_t_1);
52100 2 : __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error)
52101 2 : __Pyx_GOTREF(__pyx_t_2);
52102 2 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error)
52103 2 : __Pyx_GOTREF(__pyx_t_3);
52104 2 : __Pyx_INCREF(__pyx_v_A);
52105 2 : __Pyx_GIVEREF(__pyx_v_A);
52106 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_A)) __PYX_ERR(0, 1596, __pyx_L1_error);
52107 2 : __Pyx_GIVEREF(__pyx_t_2);
52108 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error);
52109 2 : __pyx_t_2 = 0;
52110 2 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error)
52111 2 : __Pyx_GOTREF(__pyx_t_2);
52112 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1596, __pyx_L1_error)
52113 2 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error)
52114 2 : __Pyx_GOTREF(__pyx_t_4);
52115 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52116 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52117 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52118 2 : if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
52119 2 : PyObject* sequence = __pyx_t_4;
52120 2 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
52121 2 : if (unlikely(size != 2)) {
52122 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
52123 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
52124 0 : __PYX_ERR(0, 1596, __pyx_L1_error)
52125 : }
52126 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52127 2 : if (likely(PyTuple_CheckExact(sequence))) {
52128 2 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
52129 2 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
52130 : } else {
52131 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
52132 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
52133 : }
52134 2 : __Pyx_INCREF(__pyx_t_2);
52135 2 : __Pyx_INCREF(__pyx_t_3);
52136 : #else
52137 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1596, __pyx_L1_error)
52138 : __Pyx_GOTREF(__pyx_t_2);
52139 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error)
52140 : __Pyx_GOTREF(__pyx_t_3);
52141 : #endif
52142 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52143 : } else {
52144 0 : Py_ssize_t index = -1;
52145 0 : __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error)
52146 0 : __Pyx_GOTREF(__pyx_t_1);
52147 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52148 0 : __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
52149 0 : index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
52150 0 : __Pyx_GOTREF(__pyx_t_2);
52151 0 : index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
52152 0 : __Pyx_GOTREF(__pyx_t_3);
52153 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1596, __pyx_L1_error)
52154 0 : __pyx_t_5 = NULL;
52155 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52156 0 : goto __pyx_L4_unpacking_done;
52157 0 : __pyx_L3_unpacking_failed:;
52158 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52159 0 : __pyx_t_5 = NULL;
52160 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
52161 0 : __PYX_ERR(0, 1596, __pyx_L1_error)
52162 0 : __pyx_L4_unpacking_done:;
52163 : }
52164 2 : __pyx_v__ = __pyx_t_2;
52165 2 : __pyx_t_2 = 0;
52166 2 : __pyx_v_ret = __pyx_t_3;
52167 2 : __pyx_t_3 = 0;
52168 :
52169 : /* "scipy/linalg/_decomp_interpolative.pyx":1597
52170 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng):
52171 : * _, ret = idz_findrank(A, eps, rng=rng)
52172 : * return idzp_id(ret, eps=eps) # <<<<<<<<<<<<<<
52173 : *
52174 : *
52175 : */
52176 2 : __Pyx_XDECREF(__pyx_r);
52177 2 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_idzp_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __pyx_L1_error)
52178 2 : __Pyx_GOTREF(__pyx_t_4);
52179 2 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L1_error)
52180 2 : __Pyx_GOTREF(__pyx_t_3);
52181 2 : __Pyx_INCREF(__pyx_v_ret);
52182 2 : __Pyx_GIVEREF(__pyx_v_ret);
52183 2 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ret)) __PYX_ERR(0, 1597, __pyx_L1_error);
52184 2 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1597, __pyx_L1_error)
52185 2 : __Pyx_GOTREF(__pyx_t_2);
52186 2 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
52187 2 : __Pyx_GOTREF(__pyx_t_1);
52188 2 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_eps, __pyx_t_1) < 0) __PYX_ERR(0, 1597, __pyx_L1_error)
52189 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52190 2 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
52191 2 : __Pyx_GOTREF(__pyx_t_1);
52192 2 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52193 2 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52194 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52195 2 : __pyx_r = __pyx_t_1;
52196 2 : __pyx_t_1 = 0;
52197 2 : goto __pyx_L0;
52198 :
52199 : /* "scipy/linalg/_decomp_interpolative.pyx":1595
52200 : *
52201 : *
52202 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
52203 : * _, ret = idz_findrank(A, eps, rng=rng)
52204 : * return idzp_id(ret, eps=eps)
52205 : */
52206 :
52207 : /* function exit code */
52208 0 : __pyx_L1_error:;
52209 0 : __Pyx_XDECREF(__pyx_t_1);
52210 0 : __Pyx_XDECREF(__pyx_t_2);
52211 0 : __Pyx_XDECREF(__pyx_t_3);
52212 0 : __Pyx_XDECREF(__pyx_t_4);
52213 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
52214 0 : __pyx_r = NULL;
52215 2 : __pyx_L0:;
52216 2 : __Pyx_XDECREF(__pyx_v__);
52217 2 : __Pyx_XDECREF(__pyx_v_ret);
52218 2 : __Pyx_XGIVEREF(__pyx_r);
52219 2 : __Pyx_RefNannyFinishContext();
52220 2 : return __pyx_r;
52221 : }
52222 :
52223 : /* "scipy/linalg/_decomp_interpolative.pyx":1600
52224 : *
52225 : *
52226 : * def idzp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
52227 : * cdef int n = A.shape[1]
52228 : * cdef int krank, j
52229 : */
52230 :
52231 : /* Python wrapper */
52232 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_63idzp_rsvd(PyObject *__pyx_self,
52233 : #if CYTHON_METH_FASTCALL
52234 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
52235 : #else
52236 : PyObject *__pyx_args, PyObject *__pyx_kwds
52237 : #endif
52238 : ); /*proto*/
52239 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_63idzp_rsvd = {"idzp_rsvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_63idzp_rsvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
52240 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_63idzp_rsvd(PyObject *__pyx_self,
52241 : #if CYTHON_METH_FASTCALL
52242 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
52243 : #else
52244 : PyObject *__pyx_args, PyObject *__pyx_kwds
52245 : #endif
52246 : ) {
52247 1 : PyObject *__pyx_v_A = 0;
52248 1 : __pyx_t_5numpy_float64_t __pyx_v_eps;
52249 1 : PyObject *__pyx_v_rng = 0;
52250 : #if !CYTHON_METH_FASTCALL
52251 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
52252 : #endif
52253 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
52254 1 : PyObject* values[3] = {0,0,0};
52255 1 : int __pyx_lineno = 0;
52256 1 : const char *__pyx_filename = NULL;
52257 1 : int __pyx_clineno = 0;
52258 1 : PyObject *__pyx_r = 0;
52259 : __Pyx_RefNannyDeclarations
52260 1 : __Pyx_RefNannySetupContext("idzp_rsvd (wrapper)", 0);
52261 : #if !CYTHON_METH_FASTCALL
52262 : #if CYTHON_ASSUME_SAFE_MACROS
52263 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
52264 : #else
52265 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
52266 : #endif
52267 : #endif
52268 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
52269 : {
52270 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_eps,&__pyx_n_s_rng,0};
52271 1 : if (likely(__pyx_kwds)) {
52272 1 : Py_ssize_t kw_args;
52273 1 : switch (__pyx_nargs) {
52274 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
52275 1 : CYTHON_FALLTHROUGH;
52276 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
52277 1 : CYTHON_FALLTHROUGH;
52278 1 : case 0: break;
52279 0 : default: goto __pyx_L5_argtuple_error;
52280 : }
52281 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
52282 1 : switch (__pyx_nargs) {
52283 : case 0:
52284 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
52285 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
52286 0 : kw_args--;
52287 : }
52288 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
52289 0 : else goto __pyx_L5_argtuple_error;
52290 0 : CYTHON_FALLTHROUGH;
52291 : case 1:
52292 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
52293 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
52294 0 : kw_args--;
52295 : }
52296 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
52297 : else {
52298 0 : __Pyx_RaiseArgtupleInvalid("idzp_rsvd", 1, 2, 2, 1); __PYX_ERR(0, 1600, __pyx_L3_error)
52299 : }
52300 1 : CYTHON_FALLTHROUGH;
52301 : case 2:
52302 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
52303 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
52304 1 : kw_args--;
52305 : }
52306 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
52307 : else {
52308 0 : __Pyx_RaiseKeywordRequired("idzp_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1600, __pyx_L3_error)
52309 : }
52310 : }
52311 1 : if (unlikely(kw_args > 0)) {
52312 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
52313 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_rsvd") < 0)) __PYX_ERR(0, 1600, __pyx_L3_error)
52314 : }
52315 0 : } else if (unlikely(__pyx_nargs != 2)) {
52316 0 : goto __pyx_L5_argtuple_error;
52317 : } else {
52318 0 : __Pyx_RaiseKeywordRequired("idzp_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1600, __pyx_L3_error)
52319 : }
52320 1 : __pyx_v_A = values[0];
52321 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error)
52322 1 : __pyx_v_rng = values[2];
52323 : }
52324 1 : goto __pyx_L6_skip;
52325 0 : __pyx_L5_argtuple_error:;
52326 0 : __Pyx_RaiseArgtupleInvalid("idzp_rsvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1600, __pyx_L3_error)
52327 1 : __pyx_L6_skip:;
52328 1 : goto __pyx_L4_argument_unpacking_done;
52329 0 : __pyx_L3_error:;
52330 : {
52331 0 : Py_ssize_t __pyx_temp;
52332 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52333 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52334 : }
52335 : }
52336 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
52337 0 : __Pyx_RefNannyFinishContext();
52338 0 : return NULL;
52339 1 : __pyx_L4_argument_unpacking_done:;
52340 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_62idzp_rsvd(__pyx_self, __pyx_v_A, __pyx_v_eps, __pyx_v_rng);
52341 :
52342 : /* function exit code */
52343 : {
52344 1 : Py_ssize_t __pyx_temp;
52345 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52346 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52347 : }
52348 : }
52349 : __Pyx_RefNannyFinishContext();
52350 : return __pyx_r;
52351 : }
52352 :
52353 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_62idzp_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, __pyx_t_5numpy_float64_t __pyx_v_eps, PyObject *__pyx_v_rng) {
52354 1 : int __pyx_v_n;
52355 1 : int __pyx_v_krank;
52356 1 : int __pyx_v_j;
52357 1 : PyArrayObject *__pyx_v_perms = 0;
52358 1 : PyArrayObject *__pyx_v_proj = 0;
52359 1 : PyArrayObject *__pyx_v_col = 0;
52360 1 : PyArrayObject *__pyx_v_x = 0;
52361 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
52362 1 : __Pyx_Buffer __pyx_pybuffer_col;
52363 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
52364 1 : __Pyx_Buffer __pyx_pybuffer_perms;
52365 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
52366 1 : __Pyx_Buffer __pyx_pybuffer_proj;
52367 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
52368 1 : __Pyx_Buffer __pyx_pybuffer_x;
52369 1 : PyObject *__pyx_r = NULL;
52370 : __Pyx_RefNannyDeclarations
52371 1 : PyObject *__pyx_t_1 = NULL;
52372 1 : PyObject *__pyx_t_2 = NULL;
52373 1 : int __pyx_t_3;
52374 1 : PyObject *__pyx_t_4 = NULL;
52375 1 : PyObject *__pyx_t_5 = NULL;
52376 1 : PyObject *__pyx_t_6 = NULL;
52377 1 : PyObject *(*__pyx_t_7)(PyObject *);
52378 1 : PyArrayObject *__pyx_t_8 = NULL;
52379 1 : PyObject *__pyx_t_9 = NULL;
52380 1 : PyObject *__pyx_t_10 = NULL;
52381 1 : PyObject *__pyx_t_11 = NULL;
52382 1 : PyArrayObject *__pyx_t_12 = NULL;
52383 1 : int __pyx_t_13;
52384 1 : npy_intp __pyx_t_14[2];
52385 1 : PyArrayObject *__pyx_t_15 = NULL;
52386 1 : npy_intp __pyx_t_16[1];
52387 1 : PyArrayObject *__pyx_t_17 = NULL;
52388 1 : int __pyx_t_18;
52389 1 : int __pyx_t_19;
52390 1 : Py_ssize_t __pyx_t_20;
52391 1 : __pyx_t_5numpy_int64_t __pyx_t_21;
52392 1 : unsigned int __pyx_t_22;
52393 1 : int __pyx_lineno = 0;
52394 1 : const char *__pyx_filename = NULL;
52395 1 : int __pyx_clineno = 0;
52396 1 : __Pyx_RefNannySetupContext("idzp_rsvd", 1);
52397 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
52398 1 : __pyx_pybuffer_perms.refcount = 0;
52399 1 : __pyx_pybuffernd_perms.data = NULL;
52400 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
52401 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
52402 1 : __pyx_pybuffer_proj.refcount = 0;
52403 1 : __pyx_pybuffernd_proj.data = NULL;
52404 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
52405 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
52406 1 : __pyx_pybuffer_col.refcount = 0;
52407 1 : __pyx_pybuffernd_col.data = NULL;
52408 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
52409 1 : __pyx_pybuffer_x.pybuffer.buf = NULL;
52410 1 : __pyx_pybuffer_x.refcount = 0;
52411 1 : __pyx_pybuffernd_x.data = NULL;
52412 1 : __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
52413 :
52414 : /* "scipy/linalg/_decomp_interpolative.pyx":1601
52415 : *
52416 : * def idzp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng):
52417 : * cdef int n = A.shape[1] # <<<<<<<<<<<<<<
52418 : * cdef int krank, j
52419 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
52420 : */
52421 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
52422 1 : __Pyx_GOTREF(__pyx_t_1);
52423 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1601, __pyx_L1_error)
52424 1 : __Pyx_GOTREF(__pyx_t_2);
52425 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52426 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1601, __pyx_L1_error)
52427 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52428 1 : __pyx_v_n = __pyx_t_3;
52429 :
52430 : /* "scipy/linalg/_decomp_interpolative.pyx":1608
52431 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] x
52432 : *
52433 : * krank, perms, proj = idzp_rid(A, eps, rng=rng) # <<<<<<<<<<<<<<
52434 : *
52435 : * if krank > 0:
52436 : */
52437 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzp_rid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error)
52438 1 : __Pyx_GOTREF(__pyx_t_2);
52439 1 : __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
52440 1 : __Pyx_GOTREF(__pyx_t_1);
52441 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error)
52442 1 : __Pyx_GOTREF(__pyx_t_4);
52443 1 : __Pyx_INCREF(__pyx_v_A);
52444 1 : __Pyx_GIVEREF(__pyx_v_A);
52445 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1608, __pyx_L1_error);
52446 1 : __Pyx_GIVEREF(__pyx_t_1);
52447 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error);
52448 1 : __pyx_t_1 = 0;
52449 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
52450 1 : __Pyx_GOTREF(__pyx_t_1);
52451 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1608, __pyx_L1_error)
52452 1 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1608, __pyx_L1_error)
52453 1 : __Pyx_GOTREF(__pyx_t_5);
52454 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52455 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52456 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52457 1 : if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
52458 1 : PyObject* sequence = __pyx_t_5;
52459 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
52460 1 : if (unlikely(size != 3)) {
52461 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
52462 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
52463 0 : __PYX_ERR(0, 1608, __pyx_L1_error)
52464 : }
52465 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52466 1 : if (likely(PyTuple_CheckExact(sequence))) {
52467 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
52468 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
52469 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
52470 : } else {
52471 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
52472 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
52473 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
52474 : }
52475 1 : __Pyx_INCREF(__pyx_t_1);
52476 1 : __Pyx_INCREF(__pyx_t_4);
52477 1 : __Pyx_INCREF(__pyx_t_2);
52478 : #else
52479 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
52480 : __Pyx_GOTREF(__pyx_t_1);
52481 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error)
52482 : __Pyx_GOTREF(__pyx_t_4);
52483 : __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error)
52484 : __Pyx_GOTREF(__pyx_t_2);
52485 : #endif
52486 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
52487 : } else {
52488 0 : Py_ssize_t index = -1;
52489 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1608, __pyx_L1_error)
52490 0 : __Pyx_GOTREF(__pyx_t_6);
52491 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
52492 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
52493 0 : index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
52494 0 : __Pyx_GOTREF(__pyx_t_1);
52495 0 : index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
52496 0 : __Pyx_GOTREF(__pyx_t_4);
52497 0 : index = 2; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
52498 0 : __Pyx_GOTREF(__pyx_t_2);
52499 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1608, __pyx_L1_error)
52500 0 : __pyx_t_7 = NULL;
52501 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52502 0 : goto __pyx_L4_unpacking_done;
52503 0 : __pyx_L3_unpacking_failed:;
52504 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52505 0 : __pyx_t_7 = NULL;
52506 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
52507 0 : __PYX_ERR(0, 1608, __pyx_L1_error)
52508 0 : __pyx_L4_unpacking_done:;
52509 : }
52510 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1608, __pyx_L1_error)
52511 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52512 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1608, __pyx_L1_error)
52513 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1608, __pyx_L1_error)
52514 1 : __pyx_v_krank = __pyx_t_3;
52515 1 : __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
52516 : {
52517 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
52518 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
52519 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
52520 1 : if (unlikely(__pyx_t_3 < 0)) {
52521 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
52522 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
52523 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
52524 : __Pyx_RaiseBufferFallbackError();
52525 : } else {
52526 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
52527 : }
52528 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
52529 : }
52530 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
52531 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1608, __pyx_L1_error)
52532 : }
52533 1 : __pyx_t_8 = 0;
52534 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_4);
52535 1 : __pyx_t_4 = 0;
52536 1 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
52537 : {
52538 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
52539 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
52540 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
52541 1 : if (unlikely(__pyx_t_3 < 0)) {
52542 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
52543 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
52544 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
52545 : __Pyx_RaiseBufferFallbackError();
52546 : } else {
52547 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
52548 : }
52549 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
52550 : }
52551 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
52552 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1608, __pyx_L1_error)
52553 : }
52554 1 : __pyx_t_12 = 0;
52555 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_2);
52556 1 : __pyx_t_2 = 0;
52557 :
52558 : /* "scipy/linalg/_decomp_interpolative.pyx":1610
52559 : * krank, perms, proj = idzp_rid(A, eps, rng=rng)
52560 : *
52561 : * if krank > 0: # <<<<<<<<<<<<<<
52562 : * # idd_getcols
52563 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
52564 : */
52565 1 : __pyx_t_13 = (__pyx_v_krank > 0);
52566 1 : if (__pyx_t_13) {
52567 :
52568 : /* "scipy/linalg/_decomp_interpolative.pyx":1612
52569 : * if krank > 0:
52570 : * # idd_getcols
52571 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
52572 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
52573 : *
52574 : */
52575 1 : __pyx_t_14[0] = __pyx_v_n;
52576 1 : __pyx_t_14[1] = __pyx_v_krank;
52577 1 : __pyx_t_5 = PyArray_EMPTY(2, __pyx_t_14, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1612, __pyx_L1_error)
52578 1 : __Pyx_GOTREF(__pyx_t_5);
52579 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1612, __pyx_L1_error)
52580 1 : __pyx_t_15 = ((PyArrayObject *)__pyx_t_5);
52581 : {
52582 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
52583 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
52584 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
52585 1 : if (unlikely(__pyx_t_3 < 0)) {
52586 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
52587 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
52588 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
52589 : __Pyx_RaiseBufferFallbackError();
52590 : } else {
52591 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
52592 : }
52593 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
52594 : }
52595 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
52596 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1612, __pyx_L1_error)
52597 : }
52598 1 : __pyx_t_15 = 0;
52599 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_5);
52600 1 : __pyx_t_5 = 0;
52601 :
52602 : /* "scipy/linalg/_decomp_interpolative.pyx":1613
52603 : * # idd_getcols
52604 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
52605 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
52606 : *
52607 : * for j in range(krank):
52608 : */
52609 1 : __pyx_t_16[0] = __pyx_v_n;
52610 1 : __pyx_t_5 = PyArray_ZEROS(1, __pyx_t_16, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1613, __pyx_L1_error)
52611 1 : __Pyx_GOTREF(__pyx_t_5);
52612 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1613, __pyx_L1_error)
52613 1 : __pyx_t_17 = ((PyArrayObject *)__pyx_t_5);
52614 : {
52615 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
52616 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
52617 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack);
52618 1 : if (unlikely(__pyx_t_3 < 0)) {
52619 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
52620 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
52621 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
52622 : __Pyx_RaiseBufferFallbackError();
52623 : } else {
52624 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
52625 : }
52626 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
52627 : }
52628 1 : __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
52629 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1613, __pyx_L1_error)
52630 : }
52631 1 : __pyx_t_17 = 0;
52632 1 : __pyx_v_x = ((PyArrayObject *)__pyx_t_5);
52633 1 : __pyx_t_5 = 0;
52634 :
52635 : /* "scipy/linalg/_decomp_interpolative.pyx":1615
52636 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
52637 : *
52638 : * for j in range(krank): # <<<<<<<<<<<<<<
52639 : * x[perms[j]] = 1.
52640 : * col[:, j] = A.matvec(x)
52641 : */
52642 1 : __pyx_t_3 = __pyx_v_krank;
52643 1 : __pyx_t_18 = __pyx_t_3;
52644 18 : for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
52645 17 : __pyx_v_j = __pyx_t_19;
52646 :
52647 : /* "scipy/linalg/_decomp_interpolative.pyx":1616
52648 : *
52649 : * for j in range(krank):
52650 : * x[perms[j]] = 1. # <<<<<<<<<<<<<<
52651 : * col[:, j] = A.matvec(x)
52652 : * x[perms[j]] = 0.
52653 : */
52654 17 : __pyx_t_20 = __pyx_v_j;
52655 17 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_perms.diminfo[0].strides));
52656 17 : *__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides) = __pyx_t_double_complex_from_parts(1., 0);
52657 :
52658 : /* "scipy/linalg/_decomp_interpolative.pyx":1617
52659 : * for j in range(krank):
52660 : * x[perms[j]] = 1.
52661 : * col[:, j] = A.matvec(x) # <<<<<<<<<<<<<<
52662 : * x[perms[j]] = 0.
52663 : *
52664 : */
52665 17 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
52666 17 : __Pyx_GOTREF(__pyx_t_2);
52667 17 : __pyx_t_4 = NULL;
52668 17 : __pyx_t_22 = 0;
52669 : #if CYTHON_UNPACK_METHODS
52670 17 : if (likely(PyMethod_Check(__pyx_t_2))) {
52671 17 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
52672 17 : if (likely(__pyx_t_4)) {
52673 17 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52674 17 : __Pyx_INCREF(__pyx_t_4);
52675 17 : __Pyx_INCREF(function);
52676 17 : __Pyx_DECREF_SET(__pyx_t_2, function);
52677 : __pyx_t_22 = 1;
52678 : }
52679 : }
52680 : #endif
52681 : {
52682 17 : PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_x)};
52683 17 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_22, 1+__pyx_t_22);
52684 17 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
52685 17 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1617, __pyx_L1_error)
52686 17 : __Pyx_GOTREF(__pyx_t_5);
52687 17 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52688 : }
52689 17 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
52690 17 : __Pyx_GOTREF(__pyx_t_2);
52691 17 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
52692 17 : __Pyx_GOTREF(__pyx_t_4);
52693 17 : __Pyx_INCREF(__pyx_slice__5);
52694 17 : __Pyx_GIVEREF(__pyx_slice__5);
52695 17 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__5)) __PYX_ERR(0, 1617, __pyx_L1_error);
52696 17 : __Pyx_GIVEREF(__pyx_t_2);
52697 17 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error);
52698 17 : __pyx_t_2 = 0;
52699 17 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col), __pyx_t_4, __pyx_t_5) < 0))) __PYX_ERR(0, 1617, __pyx_L1_error)
52700 17 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52701 17 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
52702 :
52703 : /* "scipy/linalg/_decomp_interpolative.pyx":1618
52704 : * x[perms[j]] = 1.
52705 : * col[:, j] = A.matvec(x)
52706 : * x[perms[j]] = 0. # <<<<<<<<<<<<<<
52707 : *
52708 : * return idz_id2svd(cols=col, perms=perms, proj=proj)
52709 : */
52710 17 : __pyx_t_20 = __pyx_v_j;
52711 17 : __pyx_t_21 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_perms.diminfo[0].strides));
52712 17 : *__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides) = __pyx_t_double_complex_from_parts(0., 0);
52713 : }
52714 :
52715 : /* "scipy/linalg/_decomp_interpolative.pyx":1620
52716 : * x[perms[j]] = 0.
52717 : *
52718 : * return idz_id2svd(cols=col, perms=perms, proj=proj) # <<<<<<<<<<<<<<
52719 : *
52720 : * # TODO: figure out empty return
52721 : */
52722 1 : __Pyx_XDECREF(__pyx_r);
52723 1 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idz_id2svd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L1_error)
52724 1 : __Pyx_GOTREF(__pyx_t_5);
52725 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1620, __pyx_L1_error)
52726 1 : __Pyx_GOTREF(__pyx_t_4);
52727 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cols, ((PyObject *)__pyx_v_col)) < 0) __PYX_ERR(0, 1620, __pyx_L1_error)
52728 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_perms, ((PyObject *)__pyx_v_perms)) < 0) __PYX_ERR(0, 1620, __pyx_L1_error)
52729 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_proj, ((PyObject *)__pyx_v_proj)) < 0) __PYX_ERR(0, 1620, __pyx_L1_error)
52730 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error)
52731 1 : __Pyx_GOTREF(__pyx_t_2);
52732 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
52733 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52734 1 : __pyx_r = __pyx_t_2;
52735 1 : __pyx_t_2 = 0;
52736 1 : goto __pyx_L0;
52737 :
52738 : /* "scipy/linalg/_decomp_interpolative.pyx":1610
52739 : * krank, perms, proj = idzp_rid(A, eps, rng=rng)
52740 : *
52741 : * if krank > 0: # <<<<<<<<<<<<<<
52742 : * # idd_getcols
52743 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
52744 : */
52745 : }
52746 :
52747 : /* "scipy/linalg/_decomp_interpolative.pyx":1623
52748 : *
52749 : * # TODO: figure out empty return
52750 : * return None # <<<<<<<<<<<<<<
52751 : *
52752 : *
52753 : */
52754 0 : __Pyx_XDECREF(__pyx_r);
52755 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52756 0 : goto __pyx_L0;
52757 :
52758 : /* "scipy/linalg/_decomp_interpolative.pyx":1600
52759 : *
52760 : *
52761 : * def idzp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
52762 : * cdef int n = A.shape[1]
52763 : * cdef int krank, j
52764 : */
52765 :
52766 : /* function exit code */
52767 0 : __pyx_L1_error:;
52768 0 : __Pyx_XDECREF(__pyx_t_1);
52769 0 : __Pyx_XDECREF(__pyx_t_2);
52770 0 : __Pyx_XDECREF(__pyx_t_4);
52771 0 : __Pyx_XDECREF(__pyx_t_5);
52772 0 : __Pyx_XDECREF(__pyx_t_6);
52773 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
52774 0 : __Pyx_PyThreadState_declare
52775 0 : __Pyx_PyThreadState_assign
52776 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
52777 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
52778 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
52779 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
52780 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
52781 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
52782 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
52783 0 : __pyx_r = NULL;
52784 0 : goto __pyx_L2;
52785 1 : __pyx_L0:;
52786 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
52787 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
52788 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
52789 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
52790 1 : __pyx_L2:;
52791 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
52792 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
52793 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
52794 1 : __Pyx_XDECREF((PyObject *)__pyx_v_x);
52795 1 : __Pyx_XGIVEREF(__pyx_r);
52796 1 : __Pyx_RefNannyFinishContext();
52797 1 : return __pyx_r;
52798 : }
52799 :
52800 : /* "scipy/linalg/_decomp_interpolative.pyx":1626
52801 : *
52802 : *
52803 : * def idzp_svd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
52804 : * cdef int m = a.shape[0], krank, info
52805 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
52806 : */
52807 :
52808 : /* Python wrapper */
52809 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_65idzp_svd(PyObject *__pyx_self,
52810 : #if CYTHON_METH_FASTCALL
52811 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
52812 : #else
52813 : PyObject *__pyx_args, PyObject *__pyx_kwds
52814 : #endif
52815 : ); /*proto*/
52816 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_65idzp_svd = {"idzp_svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_65idzp_svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
52817 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_65idzp_svd(PyObject *__pyx_self,
52818 : #if CYTHON_METH_FASTCALL
52819 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
52820 : #else
52821 : PyObject *__pyx_args, PyObject *__pyx_kwds
52822 : #endif
52823 : ) {
52824 1 : PyArrayObject *__pyx_v_a = 0;
52825 1 : __pyx_t_5numpy_float64_t __pyx_v_eps;
52826 : #if !CYTHON_METH_FASTCALL
52827 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
52828 : #endif
52829 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
52830 1 : PyObject* values[2] = {0,0};
52831 1 : int __pyx_lineno = 0;
52832 1 : const char *__pyx_filename = NULL;
52833 1 : int __pyx_clineno = 0;
52834 1 : PyObject *__pyx_r = 0;
52835 : __Pyx_RefNannyDeclarations
52836 1 : __Pyx_RefNannySetupContext("idzp_svd (wrapper)", 0);
52837 : #if !CYTHON_METH_FASTCALL
52838 : #if CYTHON_ASSUME_SAFE_MACROS
52839 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
52840 : #else
52841 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
52842 : #endif
52843 : #endif
52844 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
52845 : {
52846 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_eps,0};
52847 1 : if (__pyx_kwds) {
52848 0 : Py_ssize_t kw_args;
52849 0 : switch (__pyx_nargs) {
52850 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
52851 0 : CYTHON_FALLTHROUGH;
52852 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
52853 0 : CYTHON_FALLTHROUGH;
52854 0 : case 0: break;
52855 0 : default: goto __pyx_L5_argtuple_error;
52856 : }
52857 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
52858 0 : switch (__pyx_nargs) {
52859 : case 0:
52860 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
52861 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
52862 0 : kw_args--;
52863 : }
52864 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1626, __pyx_L3_error)
52865 0 : else goto __pyx_L5_argtuple_error;
52866 0 : CYTHON_FALLTHROUGH;
52867 : case 1:
52868 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_eps)) != 0)) {
52869 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
52870 0 : kw_args--;
52871 : }
52872 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1626, __pyx_L3_error)
52873 : else {
52874 0 : __Pyx_RaiseArgtupleInvalid("idzp_svd", 1, 2, 2, 1); __PYX_ERR(0, 1626, __pyx_L3_error)
52875 : }
52876 : }
52877 0 : if (unlikely(kw_args > 0)) {
52878 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
52879 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzp_svd") < 0)) __PYX_ERR(0, 1626, __pyx_L3_error)
52880 : }
52881 1 : } else if (unlikely(__pyx_nargs != 2)) {
52882 0 : goto __pyx_L5_argtuple_error;
52883 : } else {
52884 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
52885 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
52886 : }
52887 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
52888 1 : __pyx_v_eps = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_eps == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1626, __pyx_L3_error)
52889 : }
52890 1 : goto __pyx_L6_skip;
52891 0 : __pyx_L5_argtuple_error:;
52892 0 : __Pyx_RaiseArgtupleInvalid("idzp_svd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1626, __pyx_L3_error)
52893 1 : __pyx_L6_skip:;
52894 1 : goto __pyx_L4_argument_unpacking_done;
52895 0 : __pyx_L3_error:;
52896 : {
52897 0 : Py_ssize_t __pyx_temp;
52898 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52899 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52900 : }
52901 : }
52902 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
52903 0 : __Pyx_RefNannyFinishContext();
52904 0 : return NULL;
52905 1 : __pyx_L4_argument_unpacking_done:;
52906 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1626, __pyx_L1_error)
52907 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_64idzp_svd(__pyx_self, __pyx_v_a, __pyx_v_eps);
52908 :
52909 : /* function exit code */
52910 1 : goto __pyx_L0;
52911 0 : __pyx_L1_error:;
52912 0 : __pyx_r = NULL;
52913 1 : __pyx_L0:;
52914 : {
52915 1 : Py_ssize_t __pyx_temp;
52916 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
52917 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
52918 : }
52919 : }
52920 : __Pyx_RefNannyFinishContext();
52921 : return __pyx_r;
52922 : }
52923 :
52924 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_64idzp_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_eps) {
52925 1 : int __pyx_v_m;
52926 1 : int __pyx_v_krank;
52927 1 : int __pyx_v_info;
52928 1 : PyArrayObject *__pyx_v_taus = 0;
52929 1 : PyArrayObject *__pyx_v_UU = 0;
52930 1 : PyArrayObject *__pyx_v_V = 0;
52931 1 : PyArrayObject *__pyx_v_r = 0;
52932 1 : PyArrayObject *__pyx_v_C = 0;
52933 1 : PyArrayObject *__pyx_v_S = 0;
52934 1 : PyObject *__pyx_v_inds = NULL;
52935 1 : long __pyx_v_p;
52936 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
52937 1 : __Pyx_Buffer __pyx_pybuffer_C;
52938 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
52939 1 : __Pyx_Buffer __pyx_pybuffer_S;
52940 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
52941 1 : __Pyx_Buffer __pyx_pybuffer_UU;
52942 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
52943 1 : __Pyx_Buffer __pyx_pybuffer_V;
52944 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
52945 1 : __Pyx_Buffer __pyx_pybuffer_a;
52946 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_r;
52947 1 : __Pyx_Buffer __pyx_pybuffer_r;
52948 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_taus;
52949 1 : __Pyx_Buffer __pyx_pybuffer_taus;
52950 1 : PyObject *__pyx_r = NULL;
52951 : __Pyx_RefNannyDeclarations
52952 1 : PyObject *__pyx_t_1 = NULL;
52953 1 : PyObject *__pyx_t_2 = NULL;
52954 1 : PyObject *__pyx_t_3 = NULL;
52955 1 : PyObject *__pyx_t_4 = NULL;
52956 1 : unsigned int __pyx_t_5;
52957 1 : PyObject *__pyx_t_6 = NULL;
52958 1 : PyObject *(*__pyx_t_7)(PyObject *);
52959 1 : int __pyx_t_8;
52960 1 : PyArrayObject *__pyx_t_9 = NULL;
52961 1 : PyObject *__pyx_t_10 = NULL;
52962 1 : PyObject *__pyx_t_11 = NULL;
52963 1 : PyObject *__pyx_t_12 = NULL;
52964 1 : npy_intp __pyx_t_13[2];
52965 1 : PyArrayObject *__pyx_t_14 = NULL;
52966 1 : int __pyx_t_15;
52967 1 : PyArrayObject *__pyx_t_16 = NULL;
52968 1 : long __pyx_t_17;
52969 1 : PyObject *__pyx_t_18 = NULL;
52970 1 : PyObject *__pyx_t_19 = NULL;
52971 1 : PyArrayObject *__pyx_t_20 = NULL;
52972 1 : PyArrayObject *__pyx_t_21 = NULL;
52973 1 : PyArrayObject *__pyx_t_22 = NULL;
52974 1 : Py_ssize_t __pyx_t_23;
52975 1 : Py_ssize_t __pyx_t_24;
52976 1 : Py_ssize_t __pyx_t_25;
52977 1 : Py_ssize_t __pyx_t_26;
52978 1 : Py_ssize_t __pyx_t_27;
52979 1 : Py_ssize_t __pyx_t_28;
52980 1 : Py_ssize_t __pyx_t_29;
52981 1 : int __pyx_lineno = 0;
52982 1 : const char *__pyx_filename = NULL;
52983 1 : int __pyx_clineno = 0;
52984 1 : __Pyx_RefNannySetupContext("idzp_svd", 1);
52985 1 : __pyx_pybuffer_taus.pybuffer.buf = NULL;
52986 1 : __pyx_pybuffer_taus.refcount = 0;
52987 1 : __pyx_pybuffernd_taus.data = NULL;
52988 1 : __pyx_pybuffernd_taus.rcbuffer = &__pyx_pybuffer_taus;
52989 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
52990 1 : __pyx_pybuffer_UU.refcount = 0;
52991 1 : __pyx_pybuffernd_UU.data = NULL;
52992 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
52993 1 : __pyx_pybuffer_V.pybuffer.buf = NULL;
52994 1 : __pyx_pybuffer_V.refcount = 0;
52995 1 : __pyx_pybuffernd_V.data = NULL;
52996 1 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
52997 1 : __pyx_pybuffer_r.pybuffer.buf = NULL;
52998 1 : __pyx_pybuffer_r.refcount = 0;
52999 1 : __pyx_pybuffernd_r.data = NULL;
53000 1 : __pyx_pybuffernd_r.rcbuffer = &__pyx_pybuffer_r;
53001 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
53002 1 : __pyx_pybuffer_C.refcount = 0;
53003 1 : __pyx_pybuffernd_C.data = NULL;
53004 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
53005 1 : __pyx_pybuffer_S.pybuffer.buf = NULL;
53006 1 : __pyx_pybuffer_S.refcount = 0;
53007 1 : __pyx_pybuffernd_S.data = NULL;
53008 1 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
53009 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
53010 1 : __pyx_pybuffer_a.refcount = 0;
53011 1 : __pyx_pybuffernd_a.data = NULL;
53012 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
53013 : {
53014 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53015 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1626, __pyx_L1_error)
53016 : }
53017 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
53018 :
53019 : /* "scipy/linalg/_decomp_interpolative.pyx":1627
53020 : *
53021 : * def idzp_svd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps):
53022 : * cdef int m = a.shape[0], krank, info # <<<<<<<<<<<<<<
53023 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
53024 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] UU
53025 : */
53026 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
53027 :
53028 : /* "scipy/linalg/_decomp_interpolative.pyx":1636
53029 : *
53030 : * # Get the pivoted QR
53031 : * krank, taus, inds = idzp_qrpiv(a, eps) # <<<<<<<<<<<<<<
53032 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
53033 : *
53034 : */
53035 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzp_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error)
53036 1 : __Pyx_GOTREF(__pyx_t_2);
53037 1 : __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
53038 1 : __Pyx_GOTREF(__pyx_t_3);
53039 1 : __pyx_t_4 = NULL;
53040 1 : __pyx_t_5 = 0;
53041 : #if CYTHON_UNPACK_METHODS
53042 1 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
53043 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
53044 0 : if (likely(__pyx_t_4)) {
53045 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
53046 0 : __Pyx_INCREF(__pyx_t_4);
53047 0 : __Pyx_INCREF(function);
53048 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
53049 : __pyx_t_5 = 1;
53050 : }
53051 : }
53052 : #endif
53053 : {
53054 1 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
53055 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
53056 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
53057 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53058 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error)
53059 1 : __Pyx_GOTREF(__pyx_t_1);
53060 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53061 : }
53062 1 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
53063 1 : PyObject* sequence = __pyx_t_1;
53064 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
53065 1 : if (unlikely(size != 3)) {
53066 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
53067 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
53068 0 : __PYX_ERR(0, 1636, __pyx_L1_error)
53069 : }
53070 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
53071 1 : if (likely(PyTuple_CheckExact(sequence))) {
53072 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
53073 1 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
53074 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
53075 : } else {
53076 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
53077 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
53078 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
53079 : }
53080 1 : __Pyx_INCREF(__pyx_t_2);
53081 1 : __Pyx_INCREF(__pyx_t_3);
53082 1 : __Pyx_INCREF(__pyx_t_4);
53083 : #else
53084 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error)
53085 : __Pyx_GOTREF(__pyx_t_2);
53086 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
53087 : __Pyx_GOTREF(__pyx_t_3);
53088 : __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1636, __pyx_L1_error)
53089 : __Pyx_GOTREF(__pyx_t_4);
53090 : #endif
53091 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53092 : } else {
53093 0 : Py_ssize_t index = -1;
53094 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1636, __pyx_L1_error)
53095 0 : __Pyx_GOTREF(__pyx_t_6);
53096 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53097 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
53098 0 : index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
53099 0 : __Pyx_GOTREF(__pyx_t_2);
53100 0 : index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
53101 0 : __Pyx_GOTREF(__pyx_t_3);
53102 0 : index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
53103 0 : __Pyx_GOTREF(__pyx_t_4);
53104 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1636, __pyx_L1_error)
53105 0 : __pyx_t_7 = NULL;
53106 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53107 0 : goto __pyx_L4_unpacking_done;
53108 0 : __pyx_L3_unpacking_failed:;
53109 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53110 0 : __pyx_t_7 = NULL;
53111 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
53112 0 : __PYX_ERR(0, 1636, __pyx_L1_error)
53113 0 : __pyx_L4_unpacking_done:;
53114 : }
53115 1 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L1_error)
53116 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53117 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1636, __pyx_L1_error)
53118 1 : __pyx_v_krank = __pyx_t_8;
53119 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
53120 : {
53121 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53122 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
53123 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
53124 1 : if (unlikely(__pyx_t_8 < 0)) {
53125 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
53126 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_v_taus, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
53127 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
53128 : __Pyx_RaiseBufferFallbackError();
53129 : } else {
53130 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
53131 : }
53132 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
53133 : }
53134 1 : __pyx_pybuffernd_taus.diminfo[0].strides = __pyx_pybuffernd_taus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_taus.diminfo[0].shape = __pyx_pybuffernd_taus.rcbuffer->pybuffer.shape[0];
53135 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1636, __pyx_L1_error)
53136 : }
53137 1 : __pyx_t_9 = 0;
53138 1 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_3);
53139 1 : __pyx_t_3 = 0;
53140 1 : __pyx_v_inds = __pyx_t_4;
53141 1 : __pyx_t_4 = 0;
53142 :
53143 : /* "scipy/linalg/_decomp_interpolative.pyx":1637
53144 : * # Get the pivoted QR
53145 : * krank, taus, inds = idzp_qrpiv(a, eps)
53146 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
53147 : *
53148 : * if krank > 0:
53149 : */
53150 1 : __pyx_t_13[0] = __pyx_v_m;
53151 1 : __pyx_t_13[1] = __pyx_v_krank;
53152 1 : __pyx_t_1 = PyArray_ZEROS(2, __pyx_t_13, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error)
53153 1 : __Pyx_GOTREF(__pyx_t_1);
53154 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1637, __pyx_L1_error)
53155 1 : __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
53156 : {
53157 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53158 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
53159 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
53160 1 : if (unlikely(__pyx_t_8 < 0)) {
53161 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
53162 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
53163 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
53164 : __Pyx_RaiseBufferFallbackError();
53165 : } else {
53166 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
53167 : }
53168 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
53169 : }
53170 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
53171 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1637, __pyx_L1_error)
53172 : }
53173 1 : __pyx_t_14 = 0;
53174 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_1);
53175 1 : __pyx_t_1 = 0;
53176 :
53177 : /* "scipy/linalg/_decomp_interpolative.pyx":1639
53178 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
53179 : *
53180 : * if krank > 0: # <<<<<<<<<<<<<<
53181 : * r = np.triu(a[:krank, :])
53182 : *
53183 : */
53184 1 : __pyx_t_15 = (__pyx_v_krank > 0);
53185 1 : if (__pyx_t_15) {
53186 :
53187 : /* "scipy/linalg/_decomp_interpolative.pyx":1640
53188 : *
53189 : * if krank > 0:
53190 : * r = np.triu(a[:krank, :]) # <<<<<<<<<<<<<<
53191 : *
53192 : * for p in range(krank-1, -1, -1):
53193 : */
53194 1 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error)
53195 1 : __Pyx_GOTREF(__pyx_t_4);
53196 1 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_triu); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __pyx_L1_error)
53197 1 : __Pyx_GOTREF(__pyx_t_3);
53198 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53199 1 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error)
53200 1 : __Pyx_GOTREF(__pyx_t_4);
53201 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1640, __pyx_L1_error)
53202 1 : __Pyx_GOTREF(__pyx_t_2);
53203 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53204 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error)
53205 1 : __Pyx_GOTREF(__pyx_t_4);
53206 1 : __Pyx_GIVEREF(__pyx_t_2);
53207 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 1640, __pyx_L1_error);
53208 1 : __Pyx_INCREF(__pyx_slice__5);
53209 1 : __Pyx_GIVEREF(__pyx_slice__5);
53210 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__5)) __PYX_ERR(0, 1640, __pyx_L1_error);
53211 1 : __pyx_t_2 = 0;
53212 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1640, __pyx_L1_error)
53213 1 : __Pyx_GOTREF(__pyx_t_2);
53214 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53215 1 : __pyx_t_4 = NULL;
53216 1 : __pyx_t_5 = 0;
53217 : #if CYTHON_UNPACK_METHODS
53218 1 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
53219 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
53220 0 : if (likely(__pyx_t_4)) {
53221 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
53222 0 : __Pyx_INCREF(__pyx_t_4);
53223 0 : __Pyx_INCREF(function);
53224 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
53225 : __pyx_t_5 = 1;
53226 : }
53227 : }
53228 : #endif
53229 : {
53230 1 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
53231 1 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
53232 1 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
53233 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53234 1 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
53235 1 : __Pyx_GOTREF(__pyx_t_1);
53236 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53237 : }
53238 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1640, __pyx_L1_error)
53239 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
53240 : {
53241 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53242 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
53243 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
53244 1 : if (unlikely(__pyx_t_8 < 0)) {
53245 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
53246 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_r, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
53247 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
53248 : __Pyx_RaiseBufferFallbackError();
53249 : } else {
53250 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
53251 : }
53252 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
53253 : }
53254 1 : __pyx_pybuffernd_r.diminfo[0].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_r.diminfo[0].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_r.diminfo[1].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_r.diminfo[1].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[1];
53255 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1640, __pyx_L1_error)
53256 : }
53257 1 : __pyx_t_16 = 0;
53258 1 : __pyx_v_r = ((PyArrayObject *)__pyx_t_1);
53259 1 : __pyx_t_1 = 0;
53260 :
53261 : /* "scipy/linalg/_decomp_interpolative.pyx":1642
53262 : * r = np.triu(a[:krank, :])
53263 : *
53264 : * for p in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
53265 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]]
53266 : *
53267 : */
53268 20 : for (__pyx_t_17 = (__pyx_v_krank - 1); __pyx_t_17 > -1L; __pyx_t_17-=1) {
53269 19 : __pyx_v_p = __pyx_t_17;
53270 :
53271 : /* "scipy/linalg/_decomp_interpolative.pyx":1643
53272 : *
53273 : * for p in range(krank-1, -1, -1):
53274 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]] # <<<<<<<<<<<<<<
53275 : *
53276 : * UU[:krank, :krank], S, V = la.svd(r, full_matrices=False)
53277 : */
53278 19 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
53279 19 : __Pyx_GOTREF(__pyx_t_1);
53280 19 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
53281 19 : __Pyx_GOTREF(__pyx_t_3);
53282 19 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
53283 19 : __Pyx_GOTREF(__pyx_t_2);
53284 19 : __Pyx_GIVEREF(__pyx_t_1);
53285 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error);
53286 19 : __Pyx_GIVEREF(__pyx_t_3);
53287 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error);
53288 19 : __pyx_t_1 = 0;
53289 19 : __pyx_t_3 = 0;
53290 19 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
53291 19 : __Pyx_GOTREF(__pyx_t_3);
53292 19 : __Pyx_INCREF(__pyx_slice__5);
53293 19 : __Pyx_GIVEREF(__pyx_slice__5);
53294 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__5)) __PYX_ERR(0, 1643, __pyx_L1_error);
53295 19 : __Pyx_GIVEREF(__pyx_t_2);
53296 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error);
53297 19 : __pyx_t_2 = 0;
53298 19 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
53299 19 : __Pyx_GOTREF(__pyx_t_2);
53300 19 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53301 19 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
53302 19 : __Pyx_GOTREF(__pyx_t_3);
53303 19 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_inds, __pyx_v_p, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
53304 19 : __Pyx_GOTREF(__pyx_t_1);
53305 19 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error)
53306 19 : __Pyx_GOTREF(__pyx_t_4);
53307 19 : __Pyx_GIVEREF(__pyx_t_3);
53308 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error);
53309 19 : __Pyx_GIVEREF(__pyx_t_1);
53310 19 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error);
53311 19 : __pyx_t_3 = 0;
53312 19 : __pyx_t_1 = 0;
53313 19 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
53314 19 : __Pyx_GOTREF(__pyx_t_1);
53315 19 : __Pyx_INCREF(__pyx_slice__5);
53316 19 : __Pyx_GIVEREF(__pyx_slice__5);
53317 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1643, __pyx_L1_error);
53318 19 : __Pyx_GIVEREF(__pyx_t_4);
53319 19 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error);
53320 19 : __pyx_t_4 = 0;
53321 19 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_r), __pyx_t_1, __pyx_t_2) < 0))) __PYX_ERR(0, 1643, __pyx_L1_error)
53322 19 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53323 38 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53324 : }
53325 :
53326 : /* "scipy/linalg/_decomp_interpolative.pyx":1645
53327 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]]
53328 : *
53329 : * UU[:krank, :krank], S, V = la.svd(r, full_matrices=False) # <<<<<<<<<<<<<<
53330 : * # Apply Q to U via zunm2r
53331 : * np.conjugate(taus, out=taus)
53332 : */
53333 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_la); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error)
53334 1 : __Pyx_GOTREF(__pyx_t_2);
53335 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
53336 1 : __Pyx_GOTREF(__pyx_t_1);
53337 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53338 1 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error)
53339 1 : __Pyx_GOTREF(__pyx_t_2);
53340 1 : __Pyx_INCREF((PyObject *)__pyx_v_r);
53341 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_r);
53342 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_r))) __PYX_ERR(0, 1645, __pyx_L1_error);
53343 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
53344 1 : __Pyx_GOTREF(__pyx_t_4);
53345 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1645, __pyx_L1_error)
53346 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error)
53347 1 : __Pyx_GOTREF(__pyx_t_3);
53348 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53349 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53350 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53351 1 : if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
53352 1 : PyObject* sequence = __pyx_t_3;
53353 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
53354 1 : if (unlikely(size != 3)) {
53355 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
53356 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
53357 0 : __PYX_ERR(0, 1645, __pyx_L1_error)
53358 : }
53359 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
53360 1 : if (likely(PyTuple_CheckExact(sequence))) {
53361 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
53362 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
53363 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
53364 : } else {
53365 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
53366 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
53367 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
53368 : }
53369 1 : __Pyx_INCREF(__pyx_t_4);
53370 1 : __Pyx_INCREF(__pyx_t_2);
53371 1 : __Pyx_INCREF(__pyx_t_1);
53372 : #else
53373 : __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
53374 : __Pyx_GOTREF(__pyx_t_4);
53375 : __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error)
53376 : __Pyx_GOTREF(__pyx_t_2);
53377 : __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
53378 : __Pyx_GOTREF(__pyx_t_1);
53379 : #endif
53380 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53381 : } else {
53382 0 : Py_ssize_t index = -1;
53383 0 : __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
53384 0 : __Pyx_GOTREF(__pyx_t_6);
53385 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53386 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
53387 0 : index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
53388 0 : __Pyx_GOTREF(__pyx_t_4);
53389 0 : index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
53390 0 : __Pyx_GOTREF(__pyx_t_2);
53391 0 : index = 2; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
53392 0 : __Pyx_GOTREF(__pyx_t_1);
53393 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1645, __pyx_L1_error)
53394 0 : __pyx_t_7 = NULL;
53395 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53396 0 : goto __pyx_L9_unpacking_done;
53397 0 : __pyx_L8_unpacking_failed:;
53398 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53399 0 : __pyx_t_7 = NULL;
53400 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
53401 0 : __PYX_ERR(0, 1645, __pyx_L1_error)
53402 0 : __pyx_L9_unpacking_done:;
53403 : }
53404 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1645, __pyx_L1_error)
53405 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1645, __pyx_L1_error)
53406 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
53407 1 : __Pyx_GOTREF(__pyx_t_6);
53408 1 : __pyx_t_18 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1645, __pyx_L1_error)
53409 1 : __Pyx_GOTREF(__pyx_t_18);
53410 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53411 1 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
53412 1 : __Pyx_GOTREF(__pyx_t_6);
53413 1 : __pyx_t_19 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1645, __pyx_L1_error)
53414 1 : __Pyx_GOTREF(__pyx_t_19);
53415 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53416 1 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1645, __pyx_L1_error)
53417 1 : __Pyx_GOTREF(__pyx_t_6);
53418 1 : __Pyx_GIVEREF(__pyx_t_18);
53419 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_18)) __PYX_ERR(0, 1645, __pyx_L1_error);
53420 1 : __Pyx_GIVEREF(__pyx_t_19);
53421 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_19)) __PYX_ERR(0, 1645, __pyx_L1_error);
53422 1 : __pyx_t_18 = 0;
53423 1 : __pyx_t_19 = 0;
53424 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_6, __pyx_t_4) < 0))) __PYX_ERR(0, 1645, __pyx_L1_error)
53425 1 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53426 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53427 1 : __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
53428 : {
53429 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53430 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
53431 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
53432 1 : if (unlikely(__pyx_t_8 < 0)) {
53433 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
53434 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
53435 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
53436 : __Pyx_RaiseBufferFallbackError();
53437 : } else {
53438 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
53439 : }
53440 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
53441 : }
53442 1 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
53443 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1645, __pyx_L1_error)
53444 : }
53445 1 : __pyx_t_20 = 0;
53446 1 : __pyx_v_S = ((PyArrayObject *)__pyx_t_2);
53447 1 : __pyx_t_2 = 0;
53448 1 : __pyx_t_21 = ((PyArrayObject *)__pyx_t_1);
53449 : {
53450 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53451 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
53452 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
53453 1 : if (unlikely(__pyx_t_8 < 0)) {
53454 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
53455 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
53456 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
53457 : __Pyx_RaiseBufferFallbackError();
53458 : } else {
53459 0 : PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
53460 : }
53461 0 : __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
53462 : }
53463 1 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
53464 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1645, __pyx_L1_error)
53465 : }
53466 1 : __pyx_t_21 = 0;
53467 1 : __pyx_v_V = ((PyArrayObject *)__pyx_t_1);
53468 1 : __pyx_t_1 = 0;
53469 :
53470 : /* "scipy/linalg/_decomp_interpolative.pyx":1647
53471 : * UU[:krank, :krank], S, V = la.svd(r, full_matrices=False)
53472 : * # Apply Q to U via zunm2r
53473 : * np.conjugate(taus, out=taus) # <<<<<<<<<<<<<<
53474 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
53475 : * C = a[:, :krank].conj().copy(order='F')
53476 : */
53477 1 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error)
53478 1 : __Pyx_GOTREF(__pyx_t_3);
53479 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1647, __pyx_L1_error)
53480 1 : __Pyx_GOTREF(__pyx_t_1);
53481 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53482 1 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error)
53483 1 : __Pyx_GOTREF(__pyx_t_3);
53484 1 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
53485 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
53486 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 1647, __pyx_L1_error);
53487 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1647, __pyx_L1_error)
53488 1 : __Pyx_GOTREF(__pyx_t_2);
53489 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, ((PyObject *)__pyx_v_taus)) < 0) __PYX_ERR(0, 1647, __pyx_L1_error)
53490 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1647, __pyx_L1_error)
53491 1 : __Pyx_GOTREF(__pyx_t_4);
53492 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53493 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53494 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53495 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53496 :
53497 : /* "scipy/linalg/_decomp_interpolative.pyx":1649
53498 : * np.conjugate(taus, out=taus)
53499 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
53500 : * C = a[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
53501 : * zunm2r(<char*>'R', <char*>'C',
53502 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
53503 : */
53504 1 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
53505 1 : __Pyx_GOTREF(__pyx_t_2);
53506 1 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
53507 1 : __Pyx_GOTREF(__pyx_t_3);
53508 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53509 1 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
53510 1 : __Pyx_GOTREF(__pyx_t_2);
53511 1 : __Pyx_INCREF(__pyx_slice__5);
53512 1 : __Pyx_GIVEREF(__pyx_slice__5);
53513 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1649, __pyx_L1_error);
53514 1 : __Pyx_GIVEREF(__pyx_t_3);
53515 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error);
53516 1 : __pyx_t_3 = 0;
53517 1 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
53518 1 : __Pyx_GOTREF(__pyx_t_3);
53519 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53520 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
53521 1 : __Pyx_GOTREF(__pyx_t_2);
53522 1 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53523 1 : __pyx_t_3 = NULL;
53524 1 : __pyx_t_5 = 0;
53525 : #if CYTHON_UNPACK_METHODS
53526 1 : if (likely(PyMethod_Check(__pyx_t_2))) {
53527 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
53528 0 : if (likely(__pyx_t_3)) {
53529 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
53530 0 : __Pyx_INCREF(__pyx_t_3);
53531 0 : __Pyx_INCREF(function);
53532 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
53533 : __pyx_t_5 = 1;
53534 : }
53535 : }
53536 : #endif
53537 : {
53538 1 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
53539 1 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
53540 1 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53541 1 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error)
53542 1 : __Pyx_GOTREF(__pyx_t_4);
53543 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53544 : }
53545 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error)
53546 1 : __Pyx_GOTREF(__pyx_t_2);
53547 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53548 1 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error)
53549 1 : __Pyx_GOTREF(__pyx_t_4);
53550 1 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1649, __pyx_L1_error)
53551 1 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error)
53552 1 : __Pyx_GOTREF(__pyx_t_3);
53553 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53554 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
53555 1 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1649, __pyx_L1_error)
53556 1 : __pyx_t_22 = ((PyArrayObject *)__pyx_t_3);
53557 : {
53558 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53559 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
53560 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
53561 1 : if (unlikely(__pyx_t_8 < 0)) {
53562 0 : PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
53563 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
53564 : Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
53565 : __Pyx_RaiseBufferFallbackError();
53566 : } else {
53567 0 : PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
53568 : }
53569 0 : __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
53570 : }
53571 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
53572 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1649, __pyx_L1_error)
53573 : }
53574 1 : __pyx_t_22 = 0;
53575 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_3);
53576 1 : __pyx_t_3 = 0;
53577 :
53578 : /* "scipy/linalg/_decomp_interpolative.pyx":1651
53579 : * C = a[:, :krank].conj().copy(order='F')
53580 : * zunm2r(<char*>'R', <char*>'C',
53581 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0], # <<<<<<<<<<<<<<
53582 : * &UU[0,0], &krank, &a[0, 0], &info)
53583 : *
53584 : */
53585 1 : __pyx_t_23 = 0;
53586 1 : __pyx_t_24 = 0;
53587 1 : __pyx_t_25 = 0;
53588 :
53589 : /* "scipy/linalg/_decomp_interpolative.pyx":1652
53590 : * zunm2r(<char*>'R', <char*>'C',
53591 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
53592 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
53593 : *
53594 : * return UU, S, V
53595 : */
53596 1 : __pyx_t_26 = 0;
53597 1 : __pyx_t_27 = 0;
53598 1 : __pyx_t_28 = 0;
53599 1 : __pyx_t_29 = 0;
53600 :
53601 : /* "scipy/linalg/_decomp_interpolative.pyx":1650
53602 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
53603 : * C = a[:, :krank].conj().copy(order='F')
53604 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
53605 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
53606 : * &UU[0,0], &krank, &a[0, 0], &info)
53607 : */
53608 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_taus.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_taus.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
53609 :
53610 : /* "scipy/linalg/_decomp_interpolative.pyx":1639
53611 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
53612 : *
53613 : * if krank > 0: # <<<<<<<<<<<<<<
53614 : * r = np.triu(a[:krank, :])
53615 : *
53616 : */
53617 : }
53618 :
53619 : /* "scipy/linalg/_decomp_interpolative.pyx":1654
53620 : * &UU[0,0], &krank, &a[0, 0], &info)
53621 : *
53622 : * return UU, S, V # <<<<<<<<<<<<<<
53623 : *
53624 : *
53625 : */
53626 1 : __Pyx_XDECREF(__pyx_r);
53627 1 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1654, __pyx_L1_error)
53628 1 : __Pyx_GOTREF(__pyx_t_3);
53629 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
53630 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
53631 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1654, __pyx_L1_error);
53632 1 : __Pyx_INCREF((PyObject *)__pyx_v_S);
53633 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
53634 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 1654, __pyx_L1_error);
53635 1 : __Pyx_INCREF((PyObject *)__pyx_v_V);
53636 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_V);
53637 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_V))) __PYX_ERR(0, 1654, __pyx_L1_error);
53638 1 : __pyx_r = __pyx_t_3;
53639 1 : __pyx_t_3 = 0;
53640 1 : goto __pyx_L0;
53641 :
53642 : /* "scipy/linalg/_decomp_interpolative.pyx":1626
53643 : *
53644 : *
53645 : * def idzp_svd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
53646 : * cdef int m = a.shape[0], krank, info
53647 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
53648 : */
53649 :
53650 : /* function exit code */
53651 0 : __pyx_L1_error:;
53652 0 : __Pyx_XDECREF(__pyx_t_1);
53653 0 : __Pyx_XDECREF(__pyx_t_2);
53654 0 : __Pyx_XDECREF(__pyx_t_3);
53655 0 : __Pyx_XDECREF(__pyx_t_4);
53656 0 : __Pyx_XDECREF(__pyx_t_6);
53657 0 : __Pyx_XDECREF(__pyx_t_18);
53658 0 : __Pyx_XDECREF(__pyx_t_19);
53659 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
53660 0 : __Pyx_PyThreadState_declare
53661 0 : __Pyx_PyThreadState_assign
53662 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
53663 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
53664 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
53665 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
53666 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
53667 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
53668 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
53669 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
53670 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
53671 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzp_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
53672 0 : __pyx_r = NULL;
53673 0 : goto __pyx_L2;
53674 1 : __pyx_L0:;
53675 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
53676 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
53677 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
53678 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
53679 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
53680 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
53681 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
53682 1 : __pyx_L2:;
53683 1 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
53684 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
53685 1 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
53686 1 : __Pyx_XDECREF((PyObject *)__pyx_v_r);
53687 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
53688 1 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
53689 1 : __Pyx_XDECREF(__pyx_v_inds);
53690 1 : __Pyx_XGIVEREF(__pyx_r);
53691 1 : __Pyx_RefNannyFinishContext();
53692 1 : return __pyx_r;
53693 : }
53694 :
53695 : /* "scipy/linalg/_decomp_interpolative.pyx":1657
53696 : *
53697 : *
53698 : * def idzr_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
53699 : * rng):
53700 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
53701 : */
53702 :
53703 : /* Python wrapper */
53704 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_67idzr_aid(PyObject *__pyx_self,
53705 : #if CYTHON_METH_FASTCALL
53706 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
53707 : #else
53708 : PyObject *__pyx_args, PyObject *__pyx_kwds
53709 : #endif
53710 : ); /*proto*/
53711 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_67idzr_aid = {"idzr_aid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_67idzr_aid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
53712 3 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_67idzr_aid(PyObject *__pyx_self,
53713 : #if CYTHON_METH_FASTCALL
53714 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
53715 : #else
53716 : PyObject *__pyx_args, PyObject *__pyx_kwds
53717 : #endif
53718 : ) {
53719 3 : PyArrayObject *__pyx_v_a = 0;
53720 3 : int __pyx_v_krank;
53721 3 : PyObject *__pyx_v_rng = 0;
53722 : #if !CYTHON_METH_FASTCALL
53723 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
53724 : #endif
53725 3 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
53726 3 : PyObject* values[3] = {0,0,0};
53727 3 : int __pyx_lineno = 0;
53728 3 : const char *__pyx_filename = NULL;
53729 3 : int __pyx_clineno = 0;
53730 3 : PyObject *__pyx_r = 0;
53731 : __Pyx_RefNannyDeclarations
53732 3 : __Pyx_RefNannySetupContext("idzr_aid (wrapper)", 0);
53733 : #if !CYTHON_METH_FASTCALL
53734 : #if CYTHON_ASSUME_SAFE_MACROS
53735 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
53736 : #else
53737 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
53738 : #endif
53739 : #endif
53740 3 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
53741 : {
53742 3 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
53743 3 : if (likely(__pyx_kwds)) {
53744 3 : Py_ssize_t kw_args;
53745 3 : switch (__pyx_nargs) {
53746 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
53747 3 : CYTHON_FALLTHROUGH;
53748 3 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
53749 3 : CYTHON_FALLTHROUGH;
53750 3 : case 0: break;
53751 0 : default: goto __pyx_L5_argtuple_error;
53752 : }
53753 3 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
53754 3 : switch (__pyx_nargs) {
53755 : case 0:
53756 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
53757 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
53758 0 : kw_args--;
53759 : }
53760 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
53761 0 : else goto __pyx_L5_argtuple_error;
53762 1 : CYTHON_FALLTHROUGH;
53763 : case 1:
53764 1 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
53765 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
53766 1 : kw_args--;
53767 : }
53768 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
53769 : else {
53770 0 : __Pyx_RaiseArgtupleInvalid("idzr_aid", 1, 2, 2, 1); __PYX_ERR(0, 1657, __pyx_L3_error)
53771 : }
53772 3 : CYTHON_FALLTHROUGH;
53773 : case 2:
53774 3 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
53775 3 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
53776 3 : kw_args--;
53777 : }
53778 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
53779 : else {
53780 0 : __Pyx_RaiseKeywordRequired("idzr_aid", __pyx_n_s_rng); __PYX_ERR(0, 1657, __pyx_L3_error)
53781 : }
53782 : }
53783 3 : if (unlikely(kw_args > 0)) {
53784 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
53785 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_aid") < 0)) __PYX_ERR(0, 1657, __pyx_L3_error)
53786 : }
53787 0 : } else if (unlikely(__pyx_nargs != 2)) {
53788 0 : goto __pyx_L5_argtuple_error;
53789 : } else {
53790 0 : __Pyx_RaiseKeywordRequired("idzr_aid", __pyx_n_s_rng); __PYX_ERR(0, 1657, __pyx_L3_error)
53791 : }
53792 3 : __pyx_v_a = ((PyArrayObject *)values[0]);
53793 3 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L3_error)
53794 3 : __pyx_v_rng = values[2];
53795 : }
53796 3 : goto __pyx_L6_skip;
53797 0 : __pyx_L5_argtuple_error:;
53798 0 : __Pyx_RaiseArgtupleInvalid("idzr_aid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1657, __pyx_L3_error)
53799 3 : __pyx_L6_skip:;
53800 3 : goto __pyx_L4_argument_unpacking_done;
53801 0 : __pyx_L3_error:;
53802 : {
53803 0 : Py_ssize_t __pyx_temp;
53804 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
53805 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
53806 : }
53807 : }
53808 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
53809 0 : __Pyx_RefNannyFinishContext();
53810 0 : return NULL;
53811 3 : __pyx_L4_argument_unpacking_done:;
53812 3 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1657, __pyx_L1_error)
53813 3 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_66idzr_aid(__pyx_self, __pyx_v_a, __pyx_v_krank, __pyx_v_rng);
53814 :
53815 : /* function exit code */
53816 3 : goto __pyx_L0;
53817 0 : __pyx_L1_error:;
53818 0 : __pyx_r = NULL;
53819 3 : __pyx_L0:;
53820 : {
53821 3 : Py_ssize_t __pyx_temp;
53822 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
53823 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
53824 : }
53825 : }
53826 : __Pyx_RefNannyFinishContext();
53827 : return __pyx_r;
53828 : }
53829 :
53830 3 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_66idzr_aid(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng) {
53831 3 : int __pyx_v_m;
53832 3 : int __pyx_v_n2;
53833 3 : int __pyx_v_L;
53834 3 : int __pyx_v_nblock;
53835 3 : int __pyx_v_nsteps;
53836 3 : int __pyx_v_mb;
53837 3 : __pyx_t_5numpy_float64_t __pyx_v_twopi;
53838 3 : __pyx_t_5numpy_float64_t __pyx_v_fact;
53839 3 : __pyx_t_double_complex __pyx_v_twopii;
53840 3 : PyArrayObject *__pyx_v_ind = 0;
53841 3 : PyArrayObject *__pyx_v_subselect = 0;
53842 3 : PyArrayObject *__pyx_v_dm1 = 0;
53843 3 : PyArrayObject *__pyx_v_dm2 = 0;
53844 3 : PyArrayObject *__pyx_v_albetas = 0;
53845 3 : PyArrayObject *__pyx_v_rta = 0;
53846 3 : PyArrayObject *__pyx_v_giv2x2 = 0;
53847 3 : PyObject *__pyx_v_inds = NULL;
53848 3 : PyObject *__pyx_v_proj = NULL;
53849 3 : int __pyx_v_nstep;
53850 3 : PyObject *__pyx_v_row = NULL;
53851 3 : PyObject *__pyx_v_alpha = NULL;
53852 3 : PyObject *__pyx_v_beta = NULL;
53853 3 : PyObject *__pyx_v_wsave = NULL;
53854 3 : PyObject *__pyx_v_F = NULL;
53855 3 : PyObject *__pyx_v_V = NULL;
53856 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
53857 3 : __Pyx_Buffer __pyx_pybuffer_a;
53858 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_albetas;
53859 3 : __Pyx_Buffer __pyx_pybuffer_albetas;
53860 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_dm1;
53861 3 : __Pyx_Buffer __pyx_pybuffer_dm1;
53862 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_dm2;
53863 3 : __Pyx_Buffer __pyx_pybuffer_dm2;
53864 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_giv2x2;
53865 3 : __Pyx_Buffer __pyx_pybuffer_giv2x2;
53866 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
53867 3 : __Pyx_Buffer __pyx_pybuffer_ind;
53868 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_rta;
53869 3 : __Pyx_Buffer __pyx_pybuffer_rta;
53870 3 : __Pyx_LocalBuf_ND __pyx_pybuffernd_subselect;
53871 3 : __Pyx_Buffer __pyx_pybuffer_subselect;
53872 3 : PyObject *__pyx_r = NULL;
53873 : __Pyx_RefNannyDeclarations
53874 3 : PyObject *__pyx_t_1 = NULL;
53875 3 : PyObject *__pyx_t_2 = NULL;
53876 3 : __pyx_t_5numpy_float64_t __pyx_t_3;
53877 3 : __pyx_t_double_complex __pyx_t_4;
53878 3 : __pyx_t_npy_float64_complex __pyx_t_5;
53879 3 : int __pyx_t_6;
53880 3 : int __pyx_t_7;
53881 3 : PyObject *__pyx_t_8 = NULL;
53882 3 : PyObject *__pyx_t_9 = NULL;
53883 3 : unsigned int __pyx_t_10;
53884 3 : PyObject *(*__pyx_t_11)(PyObject *);
53885 3 : PyObject *__pyx_t_12 = NULL;
53886 3 : PyArrayObject *__pyx_t_13 = NULL;
53887 3 : int __pyx_t_14;
53888 3 : PyObject *__pyx_t_15 = NULL;
53889 3 : PyObject *__pyx_t_16 = NULL;
53890 3 : PyObject *__pyx_t_17 = NULL;
53891 3 : PyObject *__pyx_t_18 = NULL;
53892 3 : PyArrayObject *__pyx_t_19 = NULL;
53893 3 : PyArrayObject *__pyx_t_20 = NULL;
53894 3 : int __pyx_t_21;
53895 3 : int __pyx_t_22;
53896 3 : int __pyx_t_23;
53897 3 : Py_ssize_t __pyx_t_24;
53898 3 : PyObject *(*__pyx_t_25)(PyObject *);
53899 3 : npy_float64 __pyx_t_26;
53900 3 : Py_ssize_t __pyx_t_27;
53901 3 : Py_ssize_t __pyx_t_28;
53902 3 : PyObject *__pyx_t_29 = NULL;
53903 3 : PyArrayObject *__pyx_t_30 = NULL;
53904 3 : PyArrayObject *__pyx_t_31 = NULL;
53905 3 : PyArrayObject *__pyx_t_32 = NULL;
53906 3 : PyArrayObject *__pyx_t_33 = NULL;
53907 3 : PyObject *__pyx_t_34 = NULL;
53908 3 : int __pyx_lineno = 0;
53909 3 : const char *__pyx_filename = NULL;
53910 3 : int __pyx_clineno = 0;
53911 3 : __Pyx_RefNannySetupContext("idzr_aid", 1);
53912 3 : __pyx_pybuffer_ind.pybuffer.buf = NULL;
53913 3 : __pyx_pybuffer_ind.refcount = 0;
53914 3 : __pyx_pybuffernd_ind.data = NULL;
53915 3 : __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
53916 3 : __pyx_pybuffer_subselect.pybuffer.buf = NULL;
53917 3 : __pyx_pybuffer_subselect.refcount = 0;
53918 3 : __pyx_pybuffernd_subselect.data = NULL;
53919 3 : __pyx_pybuffernd_subselect.rcbuffer = &__pyx_pybuffer_subselect;
53920 3 : __pyx_pybuffer_dm1.pybuffer.buf = NULL;
53921 3 : __pyx_pybuffer_dm1.refcount = 0;
53922 3 : __pyx_pybuffernd_dm1.data = NULL;
53923 3 : __pyx_pybuffernd_dm1.rcbuffer = &__pyx_pybuffer_dm1;
53924 3 : __pyx_pybuffer_dm2.pybuffer.buf = NULL;
53925 3 : __pyx_pybuffer_dm2.refcount = 0;
53926 3 : __pyx_pybuffernd_dm2.data = NULL;
53927 3 : __pyx_pybuffernd_dm2.rcbuffer = &__pyx_pybuffer_dm2;
53928 3 : __pyx_pybuffer_albetas.pybuffer.buf = NULL;
53929 3 : __pyx_pybuffer_albetas.refcount = 0;
53930 3 : __pyx_pybuffernd_albetas.data = NULL;
53931 3 : __pyx_pybuffernd_albetas.rcbuffer = &__pyx_pybuffer_albetas;
53932 3 : __pyx_pybuffer_rta.pybuffer.buf = NULL;
53933 3 : __pyx_pybuffer_rta.refcount = 0;
53934 3 : __pyx_pybuffernd_rta.data = NULL;
53935 3 : __pyx_pybuffernd_rta.rcbuffer = &__pyx_pybuffer_rta;
53936 3 : __pyx_pybuffer_giv2x2.pybuffer.buf = NULL;
53937 3 : __pyx_pybuffer_giv2x2.refcount = 0;
53938 3 : __pyx_pybuffernd_giv2x2.data = NULL;
53939 3 : __pyx_pybuffernd_giv2x2.rcbuffer = &__pyx_pybuffer_giv2x2;
53940 3 : __pyx_pybuffer_a.pybuffer.buf = NULL;
53941 3 : __pyx_pybuffer_a.refcount = 0;
53942 3 : __pyx_pybuffernd_a.data = NULL;
53943 3 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
53944 : {
53945 3 : __Pyx_BufFmt_StackElem __pyx_stack[1];
53946 3 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1657, __pyx_L1_error)
53947 : }
53948 3 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
53949 :
53950 : /* "scipy/linalg/_decomp_interpolative.pyx":1659
53951 : * def idzr_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, int krank, *,
53952 : * rng):
53953 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb # <<<<<<<<<<<<<<
53954 : * cdef cnp.float64_t twopi = 2*np.pi, fact
53955 : * cdef double complex twopii = twopi*1.j
53956 : */
53957 3 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
53958 3 : __pyx_v_nsteps = 3;
53959 :
53960 : /* "scipy/linalg/_decomp_interpolative.pyx":1660
53961 : * rng):
53962 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
53963 : * cdef cnp.float64_t twopi = 2*np.pi, fact # <<<<<<<<<<<<<<
53964 : * cdef double complex twopii = twopi*1.j
53965 : * cdef cnp.ndarray[cnp.npy_int64, mode='c', ndim=1] ind
53966 : */
53967 3 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error)
53968 3 : __Pyx_GOTREF(__pyx_t_1);
53969 3 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1660, __pyx_L1_error)
53970 3 : __Pyx_GOTREF(__pyx_t_2);
53971 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53972 3 : __pyx_t_1 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error)
53973 3 : __Pyx_GOTREF(__pyx_t_1);
53974 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53975 3 : __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1660, __pyx_L1_error)
53976 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53977 3 : __pyx_v_twopi = __pyx_t_3;
53978 :
53979 : /* "scipy/linalg/_decomp_interpolative.pyx":1661
53980 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
53981 : * cdef cnp.float64_t twopi = 2*np.pi, fact
53982 : * cdef double complex twopii = twopi*1.j # <<<<<<<<<<<<<<
53983 : * cdef cnp.ndarray[cnp.npy_int64, mode='c', ndim=1] ind
53984 : * cdef cnp.ndarray[cnp.npy_int64, mode='c', ndim=1] subselect
53985 : */
53986 3 : __pyx_t_4 = __pyx_t_double_complex_from_parts(0, 1.0);
53987 3 : __pyx_t_5 = __Pyx_c_prod_npy_float64(__pyx_t_npy_float64_complex_from_parts(__pyx_v_twopi, 0), __pyx_t_npy_float64_complex_from_parts(__Pyx_CREAL(__pyx_t_4), __Pyx_CIMAG(__pyx_t_4)));
53988 3 : __pyx_v_twopii = __pyx_t_double_complex_from_parts(__Pyx_CREAL_CyTypedef(__pyx_t_5), __Pyx_CIMAG_CyTypedef(__pyx_t_5));
53989 :
53990 : /* "scipy/linalg/_decomp_interpolative.pyx":1670
53991 : * cdef cnp.ndarray[cnp.npy_float64, mode='c', ndim=2] giv2x2
53992 : *
53993 : * n2 = 0 # <<<<<<<<<<<<<<
53994 : * L = krank + 8
53995 : * if (L >= n2) or (L > m):
53996 : */
53997 3 : __pyx_v_n2 = 0;
53998 :
53999 : /* "scipy/linalg/_decomp_interpolative.pyx":1671
54000 : *
54001 : * n2 = 0
54002 : * L = krank + 8 # <<<<<<<<<<<<<<
54003 : * if (L >= n2) or (L > m):
54004 : * inds, proj = idzr_id(a, krank)
54005 : */
54006 3 : __pyx_v_L = (__pyx_v_krank + 8);
54007 :
54008 : /* "scipy/linalg/_decomp_interpolative.pyx":1672
54009 : * n2 = 0
54010 : * L = krank + 8
54011 : * if (L >= n2) or (L > m): # <<<<<<<<<<<<<<
54012 : * inds, proj = idzr_id(a, krank)
54013 : * return inds, proj
54014 : */
54015 3 : __pyx_t_7 = (__pyx_v_L >= __pyx_v_n2);
54016 3 : if (!__pyx_t_7) {
54017 0 : } else {
54018 3 : __pyx_t_6 = __pyx_t_7;
54019 3 : goto __pyx_L4_bool_binop_done;
54020 : }
54021 0 : __pyx_t_7 = (__pyx_v_L > __pyx_v_m);
54022 0 : __pyx_t_6 = __pyx_t_7;
54023 3 : __pyx_L4_bool_binop_done:;
54024 3 : if (__pyx_t_6) {
54025 :
54026 : /* "scipy/linalg/_decomp_interpolative.pyx":1673
54027 : * L = krank + 8
54028 : * if (L >= n2) or (L > m):
54029 : * inds, proj = idzr_id(a, krank) # <<<<<<<<<<<<<<
54030 : * return inds, proj
54031 : *
54032 : */
54033 3 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzr_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1673, __pyx_L1_error)
54034 3 : __Pyx_GOTREF(__pyx_t_2);
54035 3 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1673, __pyx_L1_error)
54036 3 : __Pyx_GOTREF(__pyx_t_8);
54037 3 : __pyx_t_9 = NULL;
54038 3 : __pyx_t_10 = 0;
54039 : #if CYTHON_UNPACK_METHODS
54040 3 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
54041 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
54042 0 : if (likely(__pyx_t_9)) {
54043 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
54044 0 : __Pyx_INCREF(__pyx_t_9);
54045 0 : __Pyx_INCREF(function);
54046 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
54047 : __pyx_t_10 = 1;
54048 : }
54049 : }
54050 : #endif
54051 : {
54052 3 : PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_a), __pyx_t_8};
54053 3 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
54054 3 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
54055 3 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54056 3 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1673, __pyx_L1_error)
54057 3 : __Pyx_GOTREF(__pyx_t_1);
54058 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54059 : }
54060 3 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
54061 3 : PyObject* sequence = __pyx_t_1;
54062 3 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
54063 3 : if (unlikely(size != 2)) {
54064 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
54065 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
54066 0 : __PYX_ERR(0, 1673, __pyx_L1_error)
54067 : }
54068 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
54069 3 : if (likely(PyTuple_CheckExact(sequence))) {
54070 3 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
54071 3 : __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
54072 : } else {
54073 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
54074 0 : __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
54075 : }
54076 3 : __Pyx_INCREF(__pyx_t_2);
54077 3 : __Pyx_INCREF(__pyx_t_8);
54078 : #else
54079 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1673, __pyx_L1_error)
54080 : __Pyx_GOTREF(__pyx_t_2);
54081 : __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1673, __pyx_L1_error)
54082 : __Pyx_GOTREF(__pyx_t_8);
54083 : #endif
54084 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54085 : } else {
54086 0 : Py_ssize_t index = -1;
54087 0 : __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1673, __pyx_L1_error)
54088 0 : __Pyx_GOTREF(__pyx_t_9);
54089 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54090 0 : __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
54091 0 : index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
54092 0 : __Pyx_GOTREF(__pyx_t_2);
54093 0 : index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
54094 0 : __Pyx_GOTREF(__pyx_t_8);
54095 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1673, __pyx_L1_error)
54096 0 : __pyx_t_11 = NULL;
54097 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54098 0 : goto __pyx_L7_unpacking_done;
54099 0 : __pyx_L6_unpacking_failed:;
54100 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54101 0 : __pyx_t_11 = NULL;
54102 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
54103 0 : __PYX_ERR(0, 1673, __pyx_L1_error)
54104 0 : __pyx_L7_unpacking_done:;
54105 : }
54106 3 : __pyx_v_inds = __pyx_t_2;
54107 3 : __pyx_t_2 = 0;
54108 3 : __pyx_v_proj = __pyx_t_8;
54109 3 : __pyx_t_8 = 0;
54110 :
54111 : /* "scipy/linalg/_decomp_interpolative.pyx":1674
54112 : * if (L >= n2) or (L > m):
54113 : * inds, proj = idzr_id(a, krank)
54114 : * return inds, proj # <<<<<<<<<<<<<<
54115 : *
54116 : * n2 = idd_poweroftwo(m)
54117 : */
54118 3 : __Pyx_XDECREF(__pyx_r);
54119 3 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error)
54120 3 : __Pyx_GOTREF(__pyx_t_1);
54121 3 : __Pyx_INCREF(__pyx_v_inds);
54122 3 : __Pyx_GIVEREF(__pyx_v_inds);
54123 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_inds)) __PYX_ERR(0, 1674, __pyx_L1_error);
54124 3 : __Pyx_INCREF(__pyx_v_proj);
54125 3 : __Pyx_GIVEREF(__pyx_v_proj);
54126 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_proj)) __PYX_ERR(0, 1674, __pyx_L1_error);
54127 3 : __pyx_r = __pyx_t_1;
54128 3 : __pyx_t_1 = 0;
54129 3 : goto __pyx_L0;
54130 :
54131 : /* "scipy/linalg/_decomp_interpolative.pyx":1672
54132 : * n2 = 0
54133 : * L = krank + 8
54134 : * if (L >= n2) or (L > m): # <<<<<<<<<<<<<<
54135 : * inds, proj = idzr_id(a, krank)
54136 : * return inds, proj
54137 : */
54138 : }
54139 :
54140 : /* "scipy/linalg/_decomp_interpolative.pyx":1676
54141 : * return inds, proj
54142 : *
54143 : * n2 = idd_poweroftwo(m) # <<<<<<<<<<<<<<
54144 : * # This part is the initialization that is done via idz_frmi
54145 : * # for a Subsampled Randomized Fourier Transform (SRFT).
54146 : */
54147 0 : __pyx_v_n2 = __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_poweroftwo(__pyx_v_m);
54148 :
54149 : /* "scipy/linalg/_decomp_interpolative.pyx":1682
54150 : * # Draw (nsteps x m x 4) array from [0, 2)*pi uniformly for
54151 : * # random points on complex unit circle and unitary rotations
54152 : * albetas = np.empty([nsteps, m, 4]) # <<<<<<<<<<<<<<
54153 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
54154 : * albetas[:, :, 2:] *= np.pi
54155 : */
54156 0 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error)
54157 0 : __Pyx_GOTREF(__pyx_t_8);
54158 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
54159 0 : __Pyx_GOTREF(__pyx_t_2);
54160 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54161 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error)
54162 0 : __Pyx_GOTREF(__pyx_t_8);
54163 0 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error)
54164 0 : __Pyx_GOTREF(__pyx_t_9);
54165 0 : __pyx_t_12 = PyList_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1682, __pyx_L1_error)
54166 0 : __Pyx_GOTREF(__pyx_t_12);
54167 0 : __Pyx_GIVEREF(__pyx_t_8);
54168 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error);
54169 0 : __Pyx_GIVEREF(__pyx_t_9);
54170 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error);
54171 0 : __Pyx_INCREF(__pyx_int_4);
54172 0 : __Pyx_GIVEREF(__pyx_int_4);
54173 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 2, __pyx_int_4)) __PYX_ERR(0, 1682, __pyx_L1_error);
54174 0 : __pyx_t_8 = 0;
54175 0 : __pyx_t_9 = 0;
54176 0 : __pyx_t_9 = NULL;
54177 0 : __pyx_t_10 = 0;
54178 : #if CYTHON_UNPACK_METHODS
54179 0 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
54180 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
54181 0 : if (likely(__pyx_t_9)) {
54182 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
54183 0 : __Pyx_INCREF(__pyx_t_9);
54184 0 : __Pyx_INCREF(function);
54185 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
54186 : __pyx_t_10 = 1;
54187 : }
54188 : }
54189 : #endif
54190 : {
54191 0 : PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_12};
54192 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
54193 0 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
54194 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54195 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
54196 0 : __Pyx_GOTREF(__pyx_t_1);
54197 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54198 : }
54199 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1682, __pyx_L1_error)
54200 0 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
54201 : {
54202 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54203 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
54204 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack);
54205 0 : if (unlikely(__pyx_t_14 < 0)) {
54206 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
54207 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer, (PyObject*)__pyx_v_albetas, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {
54208 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
54209 : __Pyx_RaiseBufferFallbackError();
54210 : } else {
54211 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
54212 : }
54213 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
54214 : }
54215 0 : __pyx_pybuffernd_albetas.diminfo[0].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_albetas.diminfo[0].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_albetas.diminfo[1].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_albetas.diminfo[1].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_albetas.diminfo[2].strides = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_albetas.diminfo[2].shape = __pyx_pybuffernd_albetas.rcbuffer->pybuffer.shape[2];
54216 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1682, __pyx_L1_error)
54217 : }
54218 0 : __pyx_t_13 = 0;
54219 0 : __pyx_v_albetas = ((PyArrayObject *)__pyx_t_1);
54220 0 : __pyx_t_1 = 0;
54221 :
54222 : /* "scipy/linalg/_decomp_interpolative.pyx":1683
54223 : * # random points on complex unit circle and unitary rotations
54224 : * albetas = np.empty([nsteps, m, 4])
54225 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2]) # <<<<<<<<<<<<<<
54226 : * albetas[:, :, 2:] *= np.pi
54227 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
54228 : */
54229 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1683, __pyx_L1_error)
54230 0 : __Pyx_GOTREF(__pyx_t_1);
54231 0 : __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error)
54232 0 : __Pyx_GOTREF(__pyx_t_2);
54233 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_low, __pyx_float_0_0) < 0) __PYX_ERR(0, 1683, __pyx_L1_error)
54234 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_high, __pyx_float_2_0) < 0) __PYX_ERR(0, 1683, __pyx_L1_error)
54235 0 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_nsteps); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1683, __pyx_L1_error)
54236 0 : __Pyx_GOTREF(__pyx_t_12);
54237 0 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1683, __pyx_L1_error)
54238 0 : __Pyx_GOTREF(__pyx_t_9);
54239 0 : __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
54240 0 : __Pyx_GOTREF(__pyx_t_8);
54241 0 : __Pyx_GIVEREF(__pyx_t_12);
54242 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_12)) __PYX_ERR(0, 1683, __pyx_L1_error);
54243 0 : __Pyx_GIVEREF(__pyx_t_9);
54244 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1683, __pyx_L1_error);
54245 0 : __Pyx_INCREF(__pyx_int_2);
54246 0 : __Pyx_GIVEREF(__pyx_int_2);
54247 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_int_2)) __PYX_ERR(0, 1683, __pyx_L1_error);
54248 0 : __pyx_t_12 = 0;
54249 0 : __pyx_t_9 = 0;
54250 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_t_8) < 0) __PYX_ERR(0, 1683, __pyx_L1_error)
54251 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54252 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
54253 0 : __Pyx_GOTREF(__pyx_t_8);
54254 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54255 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54256 0 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__17, __pyx_t_8) < 0))) __PYX_ERR(0, 1683, __pyx_L1_error)
54257 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54258 :
54259 : /* "scipy/linalg/_decomp_interpolative.pyx":1684
54260 : * albetas = np.empty([nsteps, m, 4])
54261 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
54262 : * albetas[:, :, 2:] *= np.pi # <<<<<<<<<<<<<<
54263 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
54264 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
54265 : */
54266 0 : __Pyx_INCREF(__pyx_tuple__17);
54267 0 : __pyx_t_18 = __pyx_tuple__17;
54268 0 : __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_18); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1684, __pyx_L1_error)
54269 0 : __Pyx_GOTREF(__pyx_t_8);
54270 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
54271 0 : __Pyx_GOTREF(__pyx_t_2);
54272 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
54273 0 : __Pyx_GOTREF(__pyx_t_1);
54274 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54275 0 : __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
54276 0 : __Pyx_GOTREF(__pyx_t_2);
54277 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54278 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54279 0 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_albetas), __pyx_t_18, __pyx_t_2) < 0))) __PYX_ERR(0, 1684, __pyx_L1_error)
54280 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54281 0 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
54282 :
54283 : /* "scipy/linalg/_decomp_interpolative.pyx":1685
54284 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
54285 : * albetas[:, :, 2:] *= np.pi
54286 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0]) # <<<<<<<<<<<<<<
54287 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
54288 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
54289 : */
54290 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
54291 0 : __Pyx_GOTREF(__pyx_t_2);
54292 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error)
54293 0 : __Pyx_GOTREF(__pyx_t_1);
54294 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54295 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
54296 0 : __Pyx_GOTREF(__pyx_t_2);
54297 0 : __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1685, __pyx_L1_error)
54298 0 : __Pyx_GOTREF(__pyx_t_8);
54299 0 : __Pyx_GIVEREF(__pyx_t_2);
54300 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error);
54301 0 : __pyx_t_2 = 0;
54302 0 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error)
54303 0 : __Pyx_GOTREF(__pyx_t_2);
54304 0 : __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__19); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1685, __pyx_L1_error)
54305 0 : __Pyx_GOTREF(__pyx_t_9);
54306 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, __pyx_t_9) < 0) __PYX_ERR(0, 1685, __pyx_L1_error)
54307 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54308 0 : __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1685, __pyx_L1_error)
54309 0 : __Pyx_GOTREF(__pyx_t_9);
54310 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54311 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54312 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54313 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54314 :
54315 : /* "scipy/linalg/_decomp_interpolative.pyx":1686
54316 : * albetas[:, :, 2:] *= np.pi
54317 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
54318 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1]) # <<<<<<<<<<<<<<
54319 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
54320 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
54321 : */
54322 0 : __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error)
54323 0 : __Pyx_GOTREF(__pyx_t_9);
54324 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error)
54325 0 : __Pyx_GOTREF(__pyx_t_2);
54326 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54327 0 : __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error)
54328 0 : __Pyx_GOTREF(__pyx_t_9);
54329 0 : __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1686, __pyx_L1_error)
54330 0 : __Pyx_GOTREF(__pyx_t_8);
54331 0 : __Pyx_GIVEREF(__pyx_t_9);
54332 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error);
54333 0 : __pyx_t_9 = 0;
54334 0 : __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error)
54335 0 : __Pyx_GOTREF(__pyx_t_9);
54336 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
54337 0 : __Pyx_GOTREF(__pyx_t_1);
54338 0 : if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_out, __pyx_t_1) < 0) __PYX_ERR(0, 1686, __pyx_L1_error)
54339 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54340 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error)
54341 0 : __Pyx_GOTREF(__pyx_t_1);
54342 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54343 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54344 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54345 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54346 :
54347 : /* "scipy/linalg/_decomp_interpolative.pyx":1687
54348 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
54349 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
54350 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2]) # <<<<<<<<<<<<<<
54351 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
54352 : *
54353 : */
54354 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error)
54355 0 : __Pyx_GOTREF(__pyx_t_1);
54356 0 : __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1687, __pyx_L1_error)
54357 0 : __Pyx_GOTREF(__pyx_t_9);
54358 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54359 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error)
54360 0 : __Pyx_GOTREF(__pyx_t_1);
54361 0 : __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1687, __pyx_L1_error)
54362 0 : __Pyx_GOTREF(__pyx_t_8);
54363 0 : __Pyx_GIVEREF(__pyx_t_1);
54364 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error);
54365 0 : __pyx_t_1 = 0;
54366 0 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error)
54367 0 : __Pyx_GOTREF(__pyx_t_1);
54368 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1687, __pyx_L1_error)
54369 0 : __Pyx_GOTREF(__pyx_t_2);
54370 0 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out, __pyx_t_2) < 0) __PYX_ERR(0, 1687, __pyx_L1_error)
54371 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54372 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1687, __pyx_L1_error)
54373 0 : __Pyx_GOTREF(__pyx_t_2);
54374 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54375 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54376 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54377 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54378 :
54379 : /* "scipy/linalg/_decomp_interpolative.pyx":1688
54380 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
54381 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
54382 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3]) # <<<<<<<<<<<<<<
54383 : *
54384 : * # idd_random_transf
54385 : */
54386 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1688, __pyx_L1_error)
54387 0 : __Pyx_GOTREF(__pyx_t_2);
54388 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1688, __pyx_L1_error)
54389 0 : __Pyx_GOTREF(__pyx_t_1);
54390 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54391 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1688, __pyx_L1_error)
54392 0 : __Pyx_GOTREF(__pyx_t_2);
54393 0 : __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L1_error)
54394 0 : __Pyx_GOTREF(__pyx_t_8);
54395 0 : __Pyx_GIVEREF(__pyx_t_2);
54396 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 1688, __pyx_L1_error);
54397 0 : __pyx_t_2 = 0;
54398 0 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1688, __pyx_L1_error)
54399 0 : __Pyx_GOTREF(__pyx_t_2);
54400 0 : __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_tuple__21); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1688, __pyx_L1_error)
54401 0 : __Pyx_GOTREF(__pyx_t_9);
54402 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, __pyx_t_9) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
54403 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54404 0 : __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1688, __pyx_L1_error)
54405 0 : __Pyx_GOTREF(__pyx_t_9);
54406 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54407 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54408 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54409 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54410 :
54411 : /* "scipy/linalg/_decomp_interpolative.pyx":1691
54412 : *
54413 : * # idd_random_transf
54414 : * rta = a.copy() # <<<<<<<<<<<<<<
54415 : *
54416 : * # Rotate and shuffle "a" nsteps-many times
54417 : */
54418 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1691, __pyx_L1_error)
54419 0 : __Pyx_GOTREF(__pyx_t_2);
54420 0 : __pyx_t_8 = NULL;
54421 0 : __pyx_t_10 = 0;
54422 : #if CYTHON_UNPACK_METHODS
54423 0 : if (likely(PyMethod_Check(__pyx_t_2))) {
54424 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
54425 0 : if (likely(__pyx_t_8)) {
54426 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
54427 0 : __Pyx_INCREF(__pyx_t_8);
54428 0 : __Pyx_INCREF(function);
54429 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
54430 : __pyx_t_10 = 1;
54431 : }
54432 : }
54433 : #endif
54434 : {
54435 0 : PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
54436 0 : __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10);
54437 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
54438 0 : if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1691, __pyx_L1_error)
54439 0 : __Pyx_GOTREF(__pyx_t_9);
54440 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54441 : }
54442 0 : if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1691, __pyx_L1_error)
54443 0 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_9);
54444 : {
54445 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54446 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
54447 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
54448 0 : if (unlikely(__pyx_t_14 < 0)) {
54449 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
54450 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
54451 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
54452 : __Pyx_RaiseBufferFallbackError();
54453 : } else {
54454 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
54455 : }
54456 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
54457 : }
54458 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
54459 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1691, __pyx_L1_error)
54460 : }
54461 0 : __pyx_t_19 = 0;
54462 0 : __pyx_v_rta = ((PyArrayObject *)__pyx_t_9);
54463 0 : __pyx_t_9 = 0;
54464 :
54465 : /* "scipy/linalg/_decomp_interpolative.pyx":1694
54466 : *
54467 : * # Rotate and shuffle "a" nsteps-many times
54468 : * giv2x2 = np.array([[0., 0. ], [0., 0.]]) # <<<<<<<<<<<<<<
54469 : * for nstep in range(nsteps):
54470 : * # Multiply with a point on the unit circle
54471 : */
54472 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error)
54473 0 : __Pyx_GOTREF(__pyx_t_2);
54474 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1694, __pyx_L1_error)
54475 0 : __Pyx_GOTREF(__pyx_t_8);
54476 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54477 0 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error)
54478 0 : __Pyx_GOTREF(__pyx_t_2);
54479 0 : __Pyx_INCREF(__pyx_float_0_);
54480 0 : __Pyx_GIVEREF(__pyx_float_0_);
54481 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_float_0_)) __PYX_ERR(0, 1694, __pyx_L1_error);
54482 0 : __Pyx_INCREF(__pyx_float_0_);
54483 0 : __Pyx_GIVEREF(__pyx_float_0_);
54484 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_float_0_)) __PYX_ERR(0, 1694, __pyx_L1_error);
54485 0 : __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1694, __pyx_L1_error)
54486 0 : __Pyx_GOTREF(__pyx_t_1);
54487 0 : __Pyx_INCREF(__pyx_float_0_);
54488 0 : __Pyx_GIVEREF(__pyx_float_0_);
54489 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_float_0_)) __PYX_ERR(0, 1694, __pyx_L1_error);
54490 0 : __Pyx_INCREF(__pyx_float_0_);
54491 0 : __Pyx_GIVEREF(__pyx_float_0_);
54492 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_float_0_)) __PYX_ERR(0, 1694, __pyx_L1_error);
54493 0 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1694, __pyx_L1_error)
54494 0 : __Pyx_GOTREF(__pyx_t_12);
54495 0 : __Pyx_GIVEREF(__pyx_t_2);
54496 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error);
54497 0 : __Pyx_GIVEREF(__pyx_t_1);
54498 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_1)) __PYX_ERR(0, 1694, __pyx_L1_error);
54499 0 : __pyx_t_2 = 0;
54500 0 : __pyx_t_1 = 0;
54501 0 : __pyx_t_1 = NULL;
54502 0 : __pyx_t_10 = 0;
54503 : #if CYTHON_UNPACK_METHODS
54504 0 : if (unlikely(PyMethod_Check(__pyx_t_8))) {
54505 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
54506 0 : if (likely(__pyx_t_1)) {
54507 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
54508 0 : __Pyx_INCREF(__pyx_t_1);
54509 0 : __Pyx_INCREF(function);
54510 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
54511 : __pyx_t_10 = 1;
54512 : }
54513 : }
54514 : #endif
54515 : {
54516 0 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_12};
54517 0 : __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
54518 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
54519 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54520 0 : if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1694, __pyx_L1_error)
54521 0 : __Pyx_GOTREF(__pyx_t_9);
54522 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54523 : }
54524 0 : if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1694, __pyx_L1_error)
54525 0 : __pyx_t_20 = ((PyArrayObject *)__pyx_t_9);
54526 : {
54527 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54528 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
54529 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
54530 0 : if (unlikely(__pyx_t_14 < 0)) {
54531 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
54532 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer, (PyObject*)__pyx_v_giv2x2, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
54533 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
54534 : __Pyx_RaiseBufferFallbackError();
54535 : } else {
54536 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
54537 : }
54538 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
54539 : }
54540 0 : __pyx_pybuffernd_giv2x2.diminfo[0].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_giv2x2.diminfo[0].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_giv2x2.diminfo[1].strides = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_giv2x2.diminfo[1].shape = __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.shape[1];
54541 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1694, __pyx_L1_error)
54542 : }
54543 0 : __pyx_t_20 = 0;
54544 0 : __pyx_v_giv2x2 = ((PyArrayObject *)__pyx_t_9);
54545 0 : __pyx_t_9 = 0;
54546 :
54547 : /* "scipy/linalg/_decomp_interpolative.pyx":1695
54548 : * # Rotate and shuffle "a" nsteps-many times
54549 : * giv2x2 = np.array([[0., 0. ], [0., 0.]])
54550 : * for nstep in range(nsteps): # <<<<<<<<<<<<<<
54551 : * # Multiply with a point on the unit circle
54552 : * rta *= albetas[nstep, :, 2:].view(np.complex128)
54553 : */
54554 0 : __pyx_t_14 = __pyx_v_nsteps;
54555 0 : __pyx_t_21 = __pyx_t_14;
54556 0 : for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
54557 0 : __pyx_v_nstep = __pyx_t_22;
54558 :
54559 : /* "scipy/linalg/_decomp_interpolative.pyx":1697
54560 : * for nstep in range(nsteps):
54561 : * # Multiply with a point on the unit circle
54562 : * rta *= albetas[nstep, :, 2:].view(np.complex128) # <<<<<<<<<<<<<<
54563 : * # Rotate
54564 : * for row in range(m-1):
54565 : */
54566 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nstep); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error)
54567 0 : __Pyx_GOTREF(__pyx_t_8);
54568 0 : __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1697, __pyx_L1_error)
54569 0 : __Pyx_GOTREF(__pyx_t_12);
54570 0 : __Pyx_GIVEREF(__pyx_t_8);
54571 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error);
54572 0 : __Pyx_INCREF(__pyx_slice__5);
54573 0 : __Pyx_GIVEREF(__pyx_slice__5);
54574 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__5)) __PYX_ERR(0, 1697, __pyx_L1_error);
54575 0 : __Pyx_INCREF(__pyx_slice__16);
54576 0 : __Pyx_GIVEREF(__pyx_slice__16);
54577 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice__16)) __PYX_ERR(0, 1697, __pyx_L1_error);
54578 0 : __pyx_t_8 = 0;
54579 0 : __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error)
54580 0 : __Pyx_GOTREF(__pyx_t_8);
54581 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54582 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_view); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1697, __pyx_L1_error)
54583 0 : __Pyx_GOTREF(__pyx_t_12);
54584 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54585 0 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error)
54586 0 : __Pyx_GOTREF(__pyx_t_8);
54587 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_complex128); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
54588 0 : __Pyx_GOTREF(__pyx_t_1);
54589 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54590 0 : __pyx_t_8 = NULL;
54591 0 : __pyx_t_10 = 0;
54592 : #if CYTHON_UNPACK_METHODS
54593 0 : if (likely(PyMethod_Check(__pyx_t_12))) {
54594 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
54595 0 : if (likely(__pyx_t_8)) {
54596 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
54597 0 : __Pyx_INCREF(__pyx_t_8);
54598 0 : __Pyx_INCREF(function);
54599 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
54600 : __pyx_t_10 = 1;
54601 : }
54602 : }
54603 : #endif
54604 : {
54605 0 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
54606 0 : __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
54607 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
54608 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54609 0 : if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1697, __pyx_L1_error)
54610 0 : __Pyx_GOTREF(__pyx_t_9);
54611 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54612 : }
54613 0 : __pyx_t_12 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_rta), __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1697, __pyx_L1_error)
54614 0 : __Pyx_GOTREF(__pyx_t_12);
54615 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54616 0 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1697, __pyx_L1_error)
54617 0 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_12);
54618 : {
54619 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54620 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
54621 0 : __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
54622 0 : if (unlikely(__pyx_t_23 < 0)) {
54623 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
54624 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
54625 0 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
54626 0 : __Pyx_RaiseBufferFallbackError();
54627 : } else {
54628 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
54629 : }
54630 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
54631 : }
54632 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
54633 0 : if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
54634 : }
54635 0 : __pyx_t_19 = 0;
54636 0 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_12));
54637 0 : __pyx_t_12 = 0;
54638 :
54639 : /* "scipy/linalg/_decomp_interpolative.pyx":1699
54640 : * rta *= albetas[nstep, :, 2:].view(np.complex128)
54641 : * # Rotate
54642 : * for row in range(m-1): # <<<<<<<<<<<<<<
54643 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
54644 : * giv2x2[0, 0] = alpha
54645 : */
54646 0 : __pyx_t_12 = __Pyx_PyInt_From_long((__pyx_v_m - 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1699, __pyx_L1_error)
54647 0 : __Pyx_GOTREF(__pyx_t_12);
54648 0 : __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1699, __pyx_L1_error)
54649 0 : __Pyx_GOTREF(__pyx_t_9);
54650 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54651 0 : if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
54652 0 : __pyx_t_12 = __pyx_t_9; __Pyx_INCREF(__pyx_t_12);
54653 : __pyx_t_24 = 0;
54654 : __pyx_t_25 = NULL;
54655 : } else {
54656 0 : __pyx_t_24 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1699, __pyx_L1_error)
54657 0 : __Pyx_GOTREF(__pyx_t_12);
54658 0 : __pyx_t_25 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 1699, __pyx_L1_error)
54659 : }
54660 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54661 0 : for (;;) {
54662 0 : if (likely(!__pyx_t_25)) {
54663 0 : if (likely(PyList_CheckExact(__pyx_t_12))) {
54664 : {
54665 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
54666 : #if !CYTHON_ASSUME_SAFE_MACROS
54667 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1699, __pyx_L1_error)
54668 : #endif
54669 0 : if (__pyx_t_24 >= __pyx_temp) break;
54670 : }
54671 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
54672 0 : __pyx_t_9 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_24); __Pyx_INCREF(__pyx_t_9); __pyx_t_24++; if (unlikely((0 < 0))) __PYX_ERR(0, 1699, __pyx_L1_error)
54673 : #else
54674 : __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1699, __pyx_L1_error)
54675 : __Pyx_GOTREF(__pyx_t_9);
54676 : #endif
54677 : } else {
54678 : {
54679 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
54680 : #if !CYTHON_ASSUME_SAFE_MACROS
54681 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1699, __pyx_L1_error)
54682 : #endif
54683 0 : if (__pyx_t_24 >= __pyx_temp) break;
54684 : }
54685 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
54686 0 : __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_24); __Pyx_INCREF(__pyx_t_9); __pyx_t_24++; if (unlikely((0 < 0))) __PYX_ERR(0, 1699, __pyx_L1_error)
54687 : #else
54688 : __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_24); __pyx_t_24++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1699, __pyx_L1_error)
54689 : __Pyx_GOTREF(__pyx_t_9);
54690 : #endif
54691 : }
54692 : } else {
54693 0 : __pyx_t_9 = __pyx_t_25(__pyx_t_12);
54694 0 : if (unlikely(!__pyx_t_9)) {
54695 0 : PyObject* exc_type = PyErr_Occurred();
54696 0 : if (exc_type) {
54697 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
54698 0 : else __PYX_ERR(0, 1699, __pyx_L1_error)
54699 : }
54700 : break;
54701 : }
54702 0 : __Pyx_GOTREF(__pyx_t_9);
54703 : }
54704 0 : __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_9);
54705 0 : __pyx_t_9 = 0;
54706 :
54707 : /* "scipy/linalg/_decomp_interpolative.pyx":1700
54708 : * # Rotate
54709 : * for row in range(m-1):
54710 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1] # <<<<<<<<<<<<<<
54711 : * giv2x2[0, 0] = alpha
54712 : * giv2x2[0, 1] = beta
54713 : */
54714 0 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nstep); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1700, __pyx_L1_error)
54715 0 : __Pyx_GOTREF(__pyx_t_9);
54716 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
54717 0 : __Pyx_GOTREF(__pyx_t_1);
54718 0 : __Pyx_GIVEREF(__pyx_t_9);
54719 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9)) __PYX_ERR(0, 1700, __pyx_L1_error);
54720 0 : __Pyx_INCREF(__pyx_v_row);
54721 0 : __Pyx_GIVEREF(__pyx_v_row);
54722 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_row)) __PYX_ERR(0, 1700, __pyx_L1_error);
54723 0 : __Pyx_INCREF(__pyx_int_0);
54724 0 : __Pyx_GIVEREF(__pyx_int_0);
54725 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_0)) __PYX_ERR(0, 1700, __pyx_L1_error);
54726 0 : __pyx_t_9 = 0;
54727 0 : __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1700, __pyx_L1_error)
54728 0 : __Pyx_GOTREF(__pyx_t_9);
54729 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54730 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nstep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
54731 0 : __Pyx_GOTREF(__pyx_t_1);
54732 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1700, __pyx_L1_error)
54733 0 : __Pyx_GOTREF(__pyx_t_8);
54734 0 : __Pyx_GIVEREF(__pyx_t_1);
54735 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error);
54736 0 : __Pyx_INCREF(__pyx_v_row);
54737 0 : __Pyx_GIVEREF(__pyx_v_row);
54738 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_row)) __PYX_ERR(0, 1700, __pyx_L1_error);
54739 0 : __Pyx_INCREF(__pyx_int_1);
54740 0 : __Pyx_GIVEREF(__pyx_int_1);
54741 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1)) __PYX_ERR(0, 1700, __pyx_L1_error);
54742 0 : __pyx_t_1 = 0;
54743 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_albetas), __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
54744 0 : __Pyx_GOTREF(__pyx_t_1);
54745 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54746 0 : __Pyx_XDECREF_SET(__pyx_v_alpha, __pyx_t_9);
54747 0 : __pyx_t_9 = 0;
54748 0 : __Pyx_XDECREF_SET(__pyx_v_beta, __pyx_t_1);
54749 0 : __pyx_t_1 = 0;
54750 :
54751 : /* "scipy/linalg/_decomp_interpolative.pyx":1701
54752 : * for row in range(m-1):
54753 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
54754 : * giv2x2[0, 0] = alpha # <<<<<<<<<<<<<<
54755 : * giv2x2[0, 1] = beta
54756 : * giv2x2[1, 0] = -beta
54757 : */
54758 0 : __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_alpha); if (unlikely((__pyx_t_26 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1701, __pyx_L1_error)
54759 0 : __pyx_t_27 = 0;
54760 0 : __pyx_t_28 = 0;
54761 0 : *__Pyx_BufPtrCContig2d(npy_float64 *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_t_26;
54762 :
54763 : /* "scipy/linalg/_decomp_interpolative.pyx":1702
54764 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
54765 : * giv2x2[0, 0] = alpha
54766 : * giv2x2[0, 1] = beta # <<<<<<<<<<<<<<
54767 : * giv2x2[1, 0] = -beta
54768 : * giv2x2[1, 1] = alpha
54769 : */
54770 0 : __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_beta); if (unlikely((__pyx_t_26 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1702, __pyx_L1_error)
54771 0 : __pyx_t_28 = 0;
54772 0 : __pyx_t_27 = 1;
54773 0 : *__Pyx_BufPtrCContig2d(npy_float64 *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_t_26;
54774 :
54775 : /* "scipy/linalg/_decomp_interpolative.pyx":1703
54776 : * giv2x2[0, 0] = alpha
54777 : * giv2x2[0, 1] = beta
54778 : * giv2x2[1, 0] = -beta # <<<<<<<<<<<<<<
54779 : * giv2x2[1, 1] = alpha
54780 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
54781 : */
54782 0 : __pyx_t_1 = PyNumber_Negative(__pyx_v_beta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error)
54783 0 : __Pyx_GOTREF(__pyx_t_1);
54784 0 : __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_26 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1703, __pyx_L1_error)
54785 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54786 0 : __pyx_t_27 = 1;
54787 0 : __pyx_t_28 = 0;
54788 0 : *__Pyx_BufPtrCContig2d(npy_float64 *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_t_26;
54789 :
54790 : /* "scipy/linalg/_decomp_interpolative.pyx":1704
54791 : * giv2x2[0, 1] = beta
54792 : * giv2x2[1, 0] = -beta
54793 : * giv2x2[1, 1] = alpha # <<<<<<<<<<<<<<
54794 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
54795 : *
54796 : */
54797 0 : __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_v_alpha); if (unlikely((__pyx_t_26 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1704, __pyx_L1_error)
54798 0 : __pyx_t_28 = 1;
54799 0 : __pyx_t_27 = 1;
54800 0 : *__Pyx_BufPtrCContig2d(npy_float64 *, __pyx_pybuffernd_giv2x2.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_giv2x2.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_giv2x2.diminfo[1].strides) = __pyx_t_26;
54801 :
54802 : /* "scipy/linalg/_decomp_interpolative.pyx":1705
54803 : * giv2x2[1, 0] = -beta
54804 : * giv2x2[1, 1] = alpha
54805 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :]) # <<<<<<<<<<<<<<
54806 : *
54807 : * rta = rta[rng.permutation(m), :]
54808 : */
54809 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
54810 0 : __Pyx_GOTREF(__pyx_t_1);
54811 0 : __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_matmul); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1705, __pyx_L1_error)
54812 0 : __Pyx_GOTREF(__pyx_t_9);
54813 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54814 0 : __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_row, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
54815 0 : __Pyx_GOTREF(__pyx_t_1);
54816 0 : __pyx_t_8 = PySlice_New(__pyx_v_row, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error)
54817 0 : __Pyx_GOTREF(__pyx_t_8);
54818 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54819 0 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
54820 0 : __Pyx_GOTREF(__pyx_t_1);
54821 0 : __Pyx_GIVEREF(__pyx_t_8);
54822 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error);
54823 0 : __Pyx_INCREF(__pyx_slice__5);
54824 0 : __Pyx_GIVEREF(__pyx_slice__5);
54825 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__5)) __PYX_ERR(0, 1705, __pyx_L1_error);
54826 0 : __pyx_t_8 = 0;
54827 0 : __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error)
54828 0 : __Pyx_GOTREF(__pyx_t_8);
54829 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54830 0 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
54831 0 : __Pyx_GOTREF(__pyx_t_1);
54832 0 : __Pyx_INCREF((PyObject *)__pyx_v_giv2x2);
54833 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_giv2x2);
54834 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_giv2x2))) __PYX_ERR(0, 1705, __pyx_L1_error);
54835 0 : __Pyx_GIVEREF(__pyx_t_8);
54836 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error);
54837 0 : __pyx_t_8 = 0;
54838 0 : __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error)
54839 0 : __Pyx_GOTREF(__pyx_t_8);
54840 0 : __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_row, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
54841 0 : __Pyx_GOTREF(__pyx_t_2);
54842 0 : __pyx_t_29 = PySlice_New(__pyx_v_row, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1705, __pyx_L1_error)
54843 0 : __Pyx_GOTREF(__pyx_t_29);
54844 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54845 0 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
54846 0 : __Pyx_GOTREF(__pyx_t_2);
54847 0 : __Pyx_GIVEREF(__pyx_t_29);
54848 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_29)) __PYX_ERR(0, 1705, __pyx_L1_error);
54849 0 : __Pyx_INCREF(__pyx_slice__5);
54850 0 : __Pyx_GIVEREF(__pyx_slice__5);
54851 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__5)) __PYX_ERR(0, 1705, __pyx_L1_error);
54852 0 : __pyx_t_29 = 0;
54853 0 : __pyx_t_29 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1705, __pyx_L1_error)
54854 0 : __Pyx_GOTREF(__pyx_t_29);
54855 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54856 0 : if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_out, __pyx_t_29) < 0) __PYX_ERR(0, 1705, __pyx_L1_error)
54857 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
54858 0 : __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1705, __pyx_L1_error)
54859 0 : __Pyx_GOTREF(__pyx_t_29);
54860 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54861 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54862 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54863 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
54864 :
54865 : /* "scipy/linalg/_decomp_interpolative.pyx":1699
54866 : * rta *= albetas[nstep, :, 2:].view(np.complex128)
54867 : * # Rotate
54868 : * for row in range(m-1): # <<<<<<<<<<<<<<
54869 : * alpha, beta = albetas[nstep, row, 0], albetas[nstep, row, 1]
54870 : * giv2x2[0, 0] = alpha
54871 : */
54872 : }
54873 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54874 :
54875 : /* "scipy/linalg/_decomp_interpolative.pyx":1707
54876 : * np.matmul(giv2x2, rta[row:row+2, :], out=rta[row:row+2, :])
54877 : *
54878 : * rta = rta[rng.permutation(m), :] # <<<<<<<<<<<<<<
54879 : *
54880 : * # idd_subselect pick randomly n2-many rows
54881 : */
54882 0 : __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_permutation); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1707, __pyx_L1_error)
54883 0 : __Pyx_GOTREF(__pyx_t_29);
54884 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1707, __pyx_L1_error)
54885 0 : __Pyx_GOTREF(__pyx_t_8);
54886 0 : __pyx_t_1 = NULL;
54887 0 : __pyx_t_10 = 0;
54888 : #if CYTHON_UNPACK_METHODS
54889 0 : if (likely(PyMethod_Check(__pyx_t_29))) {
54890 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_29);
54891 0 : if (likely(__pyx_t_1)) {
54892 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_29);
54893 0 : __Pyx_INCREF(__pyx_t_1);
54894 0 : __Pyx_INCREF(function);
54895 0 : __Pyx_DECREF_SET(__pyx_t_29, function);
54896 : __pyx_t_10 = 1;
54897 : }
54898 : }
54899 : #endif
54900 : {
54901 0 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
54902 0 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_29, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
54903 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
54904 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54905 0 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1707, __pyx_L1_error)
54906 0 : __Pyx_GOTREF(__pyx_t_12);
54907 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
54908 : }
54909 0 : __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1707, __pyx_L1_error)
54910 0 : __Pyx_GOTREF(__pyx_t_29);
54911 0 : __Pyx_GIVEREF(__pyx_t_12);
54912 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_12)) __PYX_ERR(0, 1707, __pyx_L1_error);
54913 0 : __Pyx_INCREF(__pyx_slice__5);
54914 0 : __Pyx_GIVEREF(__pyx_slice__5);
54915 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_slice__5)) __PYX_ERR(0, 1707, __pyx_L1_error);
54916 0 : __pyx_t_12 = 0;
54917 0 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_29); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1707, __pyx_L1_error)
54918 0 : __Pyx_GOTREF(__pyx_t_12);
54919 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
54920 0 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1707, __pyx_L1_error)
54921 0 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_12);
54922 : {
54923 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54924 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
54925 0 : __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
54926 0 : if (unlikely(__pyx_t_23 < 0)) {
54927 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
54928 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
54929 0 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
54930 0 : __Pyx_RaiseBufferFallbackError();
54931 : } else {
54932 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
54933 : }
54934 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
54935 : }
54936 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
54937 0 : if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 1707, __pyx_L1_error)
54938 : }
54939 0 : __pyx_t_19 = 0;
54940 0 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_12));
54941 0 : __pyx_t_12 = 0;
54942 : }
54943 :
54944 : /* "scipy/linalg/_decomp_interpolative.pyx":1710
54945 : *
54946 : * # idd_subselect pick randomly n2-many rows
54947 : * subselect = rng.choice(m, n2, replace=False) # <<<<<<<<<<<<<<
54948 : * rta = rta[subselect, :]
54949 : * ind = rng.choice(n2, L, replace=False)
54950 : */
54951 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1710, __pyx_L1_error)
54952 0 : __Pyx_GOTREF(__pyx_t_12);
54953 0 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1710, __pyx_L1_error)
54954 0 : __Pyx_GOTREF(__pyx_t_29);
54955 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1710, __pyx_L1_error)
54956 0 : __Pyx_GOTREF(__pyx_t_8);
54957 0 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
54958 0 : __Pyx_GOTREF(__pyx_t_1);
54959 0 : __Pyx_GIVEREF(__pyx_t_29);
54960 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_29)) __PYX_ERR(0, 1710, __pyx_L1_error);
54961 0 : __Pyx_GIVEREF(__pyx_t_8);
54962 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8)) __PYX_ERR(0, 1710, __pyx_L1_error);
54963 0 : __pyx_t_29 = 0;
54964 0 : __pyx_t_8 = 0;
54965 0 : __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1710, __pyx_L1_error)
54966 0 : __Pyx_GOTREF(__pyx_t_8);
54967 0 : if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 1710, __pyx_L1_error)
54968 0 : __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1710, __pyx_L1_error)
54969 0 : __Pyx_GOTREF(__pyx_t_29);
54970 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
54971 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54972 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54973 0 : if (!(likely(((__pyx_t_29) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_29, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1710, __pyx_L1_error)
54974 0 : __pyx_t_30 = ((PyArrayObject *)__pyx_t_29);
54975 : {
54976 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
54977 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
54978 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
54979 0 : if (unlikely(__pyx_t_14 < 0)) {
54980 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
54981 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer, (PyObject*)__pyx_v_subselect, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
54982 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
54983 : __Pyx_RaiseBufferFallbackError();
54984 : } else {
54985 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
54986 : }
54987 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
54988 : }
54989 0 : __pyx_pybuffernd_subselect.diminfo[0].strides = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_subselect.diminfo[0].shape = __pyx_pybuffernd_subselect.rcbuffer->pybuffer.shape[0];
54990 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1710, __pyx_L1_error)
54991 : }
54992 0 : __pyx_t_30 = 0;
54993 0 : __pyx_v_subselect = ((PyArrayObject *)__pyx_t_29);
54994 0 : __pyx_t_29 = 0;
54995 :
54996 : /* "scipy/linalg/_decomp_interpolative.pyx":1711
54997 : * # idd_subselect pick randomly n2-many rows
54998 : * subselect = rng.choice(m, n2, replace=False)
54999 : * rta = rta[subselect, :] # <<<<<<<<<<<<<<
55000 : * ind = rng.choice(n2, L, replace=False)
55001 : *
55002 : */
55003 0 : __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1711, __pyx_L1_error)
55004 0 : __Pyx_GOTREF(__pyx_t_29);
55005 0 : __Pyx_INCREF((PyObject *)__pyx_v_subselect);
55006 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_subselect);
55007 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 0, ((PyObject *)__pyx_v_subselect))) __PYX_ERR(0, 1711, __pyx_L1_error);
55008 0 : __Pyx_INCREF(__pyx_slice__5);
55009 0 : __Pyx_GIVEREF(__pyx_slice__5);
55010 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_slice__5)) __PYX_ERR(0, 1711, __pyx_L1_error);
55011 0 : __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_rta), __pyx_t_29); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1711, __pyx_L1_error)
55012 0 : __Pyx_GOTREF(__pyx_t_8);
55013 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55014 0 : if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1711, __pyx_L1_error)
55015 0 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_8);
55016 : {
55017 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55018 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
55019 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
55020 0 : if (unlikely(__pyx_t_14 < 0)) {
55021 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
55022 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rta.rcbuffer->pybuffer, (PyObject*)__pyx_v_rta, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
55023 0 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
55024 0 : __Pyx_RaiseBufferFallbackError();
55025 : } else {
55026 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
55027 : }
55028 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
55029 : }
55030 0 : __pyx_pybuffernd_rta.diminfo[0].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rta.diminfo[0].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_rta.diminfo[1].strides = __pyx_pybuffernd_rta.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_rta.diminfo[1].shape = __pyx_pybuffernd_rta.rcbuffer->pybuffer.shape[1];
55031 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1711, __pyx_L1_error)
55032 : }
55033 0 : __pyx_t_19 = 0;
55034 0 : __Pyx_DECREF_SET(__pyx_v_rta, ((PyArrayObject *)__pyx_t_8));
55035 0 : __pyx_t_8 = 0;
55036 :
55037 : /* "scipy/linalg/_decomp_interpolative.pyx":1712
55038 : * subselect = rng.choice(m, n2, replace=False)
55039 : * rta = rta[subselect, :]
55040 : * ind = rng.choice(n2, L, replace=False) # <<<<<<<<<<<<<<
55041 : *
55042 : * nblock = idd_ldiv(L, n2)
55043 : */
55044 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_choice); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error)
55045 0 : __Pyx_GOTREF(__pyx_t_8);
55046 0 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1712, __pyx_L1_error)
55047 0 : __Pyx_GOTREF(__pyx_t_29);
55048 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
55049 0 : __Pyx_GOTREF(__pyx_t_1);
55050 0 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1712, __pyx_L1_error)
55051 0 : __Pyx_GOTREF(__pyx_t_12);
55052 0 : __Pyx_GIVEREF(__pyx_t_29);
55053 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_29)) __PYX_ERR(0, 1712, __pyx_L1_error);
55054 0 : __Pyx_GIVEREF(__pyx_t_1);
55055 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error);
55056 0 : __pyx_t_29 = 0;
55057 0 : __pyx_t_1 = 0;
55058 0 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
55059 0 : __Pyx_GOTREF(__pyx_t_1);
55060 0 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 1712, __pyx_L1_error)
55061 0 : __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1712, __pyx_L1_error)
55062 0 : __Pyx_GOTREF(__pyx_t_29);
55063 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55064 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55065 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55066 0 : if (!(likely(((__pyx_t_29) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_29, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1712, __pyx_L1_error)
55067 0 : __pyx_t_31 = ((PyArrayObject *)__pyx_t_29);
55068 : {
55069 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55070 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
55071 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
55072 0 : if (unlikely(__pyx_t_14 < 0)) {
55073 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
55074 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
55075 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
55076 : __Pyx_RaiseBufferFallbackError();
55077 : } else {
55078 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
55079 : }
55080 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
55081 : }
55082 0 : __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
55083 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1712, __pyx_L1_error)
55084 : }
55085 0 : __pyx_t_31 = 0;
55086 0 : __pyx_v_ind = ((PyArrayObject *)__pyx_t_29);
55087 0 : __pyx_t_29 = 0;
55088 :
55089 : /* "scipy/linalg/_decomp_interpolative.pyx":1714
55090 : * ind = rng.choice(n2, L, replace=False)
55091 : *
55092 : * nblock = idd_ldiv(L, n2) # <<<<<<<<<<<<<<
55093 : * mb = n2 // nblock
55094 : * fact = 1.0 / np.sqrt(n2)
55095 : */
55096 0 : __pyx_v_nblock = __pyx_f_5scipy_6linalg_21_decomp_interpolative_idd_ldiv(__pyx_v_L, __pyx_v_n2);
55097 :
55098 : /* "scipy/linalg/_decomp_interpolative.pyx":1715
55099 : *
55100 : * nblock = idd_ldiv(L, n2)
55101 : * mb = n2 // nblock # <<<<<<<<<<<<<<
55102 : * fact = 1.0 / np.sqrt(n2)
55103 : *
55104 : */
55105 0 : __pyx_v_mb = (__pyx_v_n2 / __pyx_v_nblock);
55106 :
55107 : /* "scipy/linalg/_decomp_interpolative.pyx":1716
55108 : * nblock = idd_ldiv(L, n2)
55109 : * mb = n2 // nblock
55110 : * fact = 1.0 / np.sqrt(n2) # <<<<<<<<<<<<<<
55111 : *
55112 : * # Create (L x mb) DFT matrix
55113 : */
55114 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
55115 0 : __Pyx_GOTREF(__pyx_t_1);
55116 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error)
55117 0 : __Pyx_GOTREF(__pyx_t_12);
55118 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55119 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error)
55120 0 : __Pyx_GOTREF(__pyx_t_1);
55121 0 : __pyx_t_8 = NULL;
55122 0 : __pyx_t_10 = 0;
55123 : #if CYTHON_UNPACK_METHODS
55124 0 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
55125 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
55126 0 : if (likely(__pyx_t_8)) {
55127 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
55128 0 : __Pyx_INCREF(__pyx_t_8);
55129 0 : __Pyx_INCREF(function);
55130 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
55131 : __pyx_t_10 = 1;
55132 : }
55133 : }
55134 : #endif
55135 : {
55136 0 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
55137 0 : __pyx_t_29 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
55138 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
55139 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55140 0 : if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1716, __pyx_L1_error)
55141 0 : __Pyx_GOTREF(__pyx_t_29);
55142 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55143 : }
55144 0 : __pyx_t_12 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_1_0, __pyx_t_29, 1.0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error)
55145 0 : __Pyx_GOTREF(__pyx_t_12);
55146 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55147 0 : __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1716, __pyx_L1_error)
55148 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55149 0 : __pyx_v_fact = __pyx_t_3;
55150 :
55151 : /* "scipy/linalg/_decomp_interpolative.pyx":1720
55152 : * # Create (L x mb) DFT matrix
55153 : * # wsave = np.empty([L, mb], dtype=np.complex128)
55154 : * dm1, dm2 = np.divmod(ind, mb, dtype=np.float64) # <<<<<<<<<<<<<<
55155 : * dm1 /= n2
55156 : * dm1 += dm2 / mb
55157 : */
55158 0 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error)
55159 0 : __Pyx_GOTREF(__pyx_t_12);
55160 0 : __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_divmod); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1720, __pyx_L1_error)
55161 0 : __Pyx_GOTREF(__pyx_t_29);
55162 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55163 0 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_mb); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error)
55164 0 : __Pyx_GOTREF(__pyx_t_12);
55165 0 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error)
55166 0 : __Pyx_GOTREF(__pyx_t_1);
55167 0 : __Pyx_INCREF((PyObject *)__pyx_v_ind);
55168 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_ind);
55169 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ind))) __PYX_ERR(0, 1720, __pyx_L1_error);
55170 0 : __Pyx_GIVEREF(__pyx_t_12);
55171 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error);
55172 0 : __pyx_t_12 = 0;
55173 0 : __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error)
55174 0 : __Pyx_GOTREF(__pyx_t_12);
55175 0 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1720, __pyx_L1_error)
55176 0 : __Pyx_GOTREF(__pyx_t_8);
55177 0 : __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1720, __pyx_L1_error)
55178 0 : __Pyx_GOTREF(__pyx_t_9);
55179 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55180 0 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 1720, __pyx_L1_error)
55181 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55182 0 : __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_29, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1720, __pyx_L1_error)
55183 0 : __Pyx_GOTREF(__pyx_t_9);
55184 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55185 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55186 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55187 0 : if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
55188 0 : PyObject* sequence = __pyx_t_9;
55189 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
55190 0 : if (unlikely(size != 2)) {
55191 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
55192 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
55193 0 : __PYX_ERR(0, 1720, __pyx_L1_error)
55194 : }
55195 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
55196 0 : if (likely(PyTuple_CheckExact(sequence))) {
55197 0 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
55198 0 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
55199 : } else {
55200 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 0);
55201 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
55202 : }
55203 0 : __Pyx_INCREF(__pyx_t_12);
55204 0 : __Pyx_INCREF(__pyx_t_1);
55205 : #else
55206 : __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error)
55207 : __Pyx_GOTREF(__pyx_t_12);
55208 : __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error)
55209 : __Pyx_GOTREF(__pyx_t_1);
55210 : #endif
55211 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55212 : } else {
55213 0 : Py_ssize_t index = -1;
55214 0 : __pyx_t_29 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1720, __pyx_L1_error)
55215 0 : __Pyx_GOTREF(__pyx_t_29);
55216 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55217 0 : __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_29);
55218 0 : index = 0; __pyx_t_12 = __pyx_t_11(__pyx_t_29); if (unlikely(!__pyx_t_12)) goto __pyx_L13_unpacking_failed;
55219 0 : __Pyx_GOTREF(__pyx_t_12);
55220 0 : index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_29); if (unlikely(!__pyx_t_1)) goto __pyx_L13_unpacking_failed;
55221 0 : __Pyx_GOTREF(__pyx_t_1);
55222 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_29), 2) < 0) __PYX_ERR(0, 1720, __pyx_L1_error)
55223 0 : __pyx_t_11 = NULL;
55224 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55225 0 : goto __pyx_L14_unpacking_done;
55226 0 : __pyx_L13_unpacking_failed:;
55227 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55228 0 : __pyx_t_11 = NULL;
55229 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
55230 0 : __PYX_ERR(0, 1720, __pyx_L1_error)
55231 0 : __pyx_L14_unpacking_done:;
55232 : }
55233 0 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1720, __pyx_L1_error)
55234 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1720, __pyx_L1_error)
55235 0 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_12);
55236 : {
55237 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55238 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer);
55239 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
55240 0 : if (unlikely(__pyx_t_14 < 0)) {
55241 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
55242 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm1, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
55243 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
55244 : __Pyx_RaiseBufferFallbackError();
55245 : } else {
55246 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
55247 : }
55248 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
55249 : }
55250 0 : __pyx_pybuffernd_dm1.diminfo[0].strides = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm1.diminfo[0].shape = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.shape[0];
55251 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1720, __pyx_L1_error)
55252 : }
55253 0 : __pyx_t_32 = 0;
55254 0 : __pyx_v_dm1 = ((PyArrayObject *)__pyx_t_12);
55255 0 : __pyx_t_12 = 0;
55256 0 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_1);
55257 : {
55258 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55259 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm2.rcbuffer->pybuffer);
55260 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm2.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
55261 0 : if (unlikely(__pyx_t_14 < 0)) {
55262 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
55263 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm2.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm2, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
55264 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
55265 : __Pyx_RaiseBufferFallbackError();
55266 : } else {
55267 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
55268 : }
55269 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
55270 : }
55271 0 : __pyx_pybuffernd_dm2.diminfo[0].strides = __pyx_pybuffernd_dm2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm2.diminfo[0].shape = __pyx_pybuffernd_dm2.rcbuffer->pybuffer.shape[0];
55272 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1720, __pyx_L1_error)
55273 : }
55274 0 : __pyx_t_33 = 0;
55275 0 : __pyx_v_dm2 = ((PyArrayObject *)__pyx_t_1);
55276 0 : __pyx_t_1 = 0;
55277 :
55278 : /* "scipy/linalg/_decomp_interpolative.pyx":1721
55279 : * # wsave = np.empty([L, mb], dtype=np.complex128)
55280 : * dm1, dm2 = np.divmod(ind, mb, dtype=np.float64)
55281 : * dm1 /= n2 # <<<<<<<<<<<<<<
55282 : * dm1 += dm2 / mb
55283 : * wsave = np.outer(dm1, -twopii*np.arange(mb))
55284 : */
55285 0 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_n2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1721, __pyx_L1_error)
55286 0 : __Pyx_GOTREF(__pyx_t_9);
55287 0 : __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_dm1), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
55288 0 : __Pyx_GOTREF(__pyx_t_1);
55289 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55290 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1721, __pyx_L1_error)
55291 0 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_1);
55292 : {
55293 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55294 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer);
55295 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
55296 0 : if (unlikely(__pyx_t_14 < 0)) {
55297 0 : PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
55298 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm1, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
55299 0 : Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
55300 0 : __Pyx_RaiseBufferFallbackError();
55301 : } else {
55302 0 : PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
55303 : }
55304 0 : __pyx_t_15 = __pyx_t_16 = __pyx_t_17 = 0;
55305 : }
55306 0 : __pyx_pybuffernd_dm1.diminfo[0].strides = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm1.diminfo[0].shape = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.shape[0];
55307 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1721, __pyx_L1_error)
55308 : }
55309 0 : __pyx_t_32 = 0;
55310 0 : __Pyx_DECREF_SET(__pyx_v_dm1, ((PyArrayObject *)__pyx_t_1));
55311 0 : __pyx_t_1 = 0;
55312 :
55313 : /* "scipy/linalg/_decomp_interpolative.pyx":1722
55314 : * dm1, dm2 = np.divmod(ind, mb, dtype=np.float64)
55315 : * dm1 /= n2
55316 : * dm1 += dm2 / mb # <<<<<<<<<<<<<<
55317 : * wsave = np.outer(dm1, -twopii*np.arange(mb))
55318 : * np.exp(wsave, out=wsave)
55319 : */
55320 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
55321 0 : __Pyx_GOTREF(__pyx_t_1);
55322 0 : __pyx_t_9 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_dm2), __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1722, __pyx_L1_error)
55323 0 : __Pyx_GOTREF(__pyx_t_9);
55324 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55325 0 : __pyx_t_1 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_dm1), __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
55326 0 : __Pyx_GOTREF(__pyx_t_1);
55327 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55328 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1722, __pyx_L1_error)
55329 0 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_1);
55330 : {
55331 0 : __Pyx_BufFmt_StackElem __pyx_stack[1];
55332 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer);
55333 0 : __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
55334 0 : if (unlikely(__pyx_t_14 < 0)) {
55335 0 : PyErr_Fetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
55336 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm1, &__Pyx_TypeInfo_nn_npy_float64, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
55337 0 : Py_XDECREF(__pyx_t_17); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15);
55338 0 : __Pyx_RaiseBufferFallbackError();
55339 : } else {
55340 0 : PyErr_Restore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
55341 : }
55342 0 : __pyx_t_17 = __pyx_t_16 = __pyx_t_15 = 0;
55343 : }
55344 0 : __pyx_pybuffernd_dm1.diminfo[0].strides = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm1.diminfo[0].shape = __pyx_pybuffernd_dm1.rcbuffer->pybuffer.shape[0];
55345 0 : if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 1722, __pyx_L1_error)
55346 : }
55347 0 : __pyx_t_32 = 0;
55348 0 : __Pyx_DECREF_SET(__pyx_v_dm1, ((PyArrayObject *)__pyx_t_1));
55349 0 : __pyx_t_1 = 0;
55350 :
55351 : /* "scipy/linalg/_decomp_interpolative.pyx":1723
55352 : * dm1 /= n2
55353 : * dm1 += dm2 / mb
55354 : * wsave = np.outer(dm1, -twopii*np.arange(mb)) # <<<<<<<<<<<<<<
55355 : * np.exp(wsave, out=wsave)
55356 : * wsave *= fact
55357 : */
55358 0 : __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1723, __pyx_L1_error)
55359 0 : __Pyx_GOTREF(__pyx_t_9);
55360 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_outer); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1723, __pyx_L1_error)
55361 0 : __Pyx_GOTREF(__pyx_t_12);
55362 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55363 0 : __pyx_t_4 = __Pyx_c_neg_double(__pyx_v_twopii);
55364 0 : __pyx_t_9 = __pyx_PyComplex_FromComplex(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1723, __pyx_L1_error)
55365 0 : __Pyx_GOTREF(__pyx_t_9);
55366 0 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1723, __pyx_L1_error)
55367 0 : __Pyx_GOTREF(__pyx_t_8);
55368 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1723, __pyx_L1_error)
55369 0 : __Pyx_GOTREF(__pyx_t_2);
55370 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55371 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_mb); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1723, __pyx_L1_error)
55372 0 : __Pyx_GOTREF(__pyx_t_8);
55373 0 : __pyx_t_34 = NULL;
55374 0 : __pyx_t_10 = 0;
55375 : #if CYTHON_UNPACK_METHODS
55376 0 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
55377 0 : __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_2);
55378 0 : if (likely(__pyx_t_34)) {
55379 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
55380 0 : __Pyx_INCREF(__pyx_t_34);
55381 0 : __Pyx_INCREF(function);
55382 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
55383 : __pyx_t_10 = 1;
55384 : }
55385 : }
55386 : #endif
55387 : {
55388 0 : PyObject *__pyx_callargs[2] = {__pyx_t_34, __pyx_t_8};
55389 0 : __pyx_t_29 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
55390 0 : __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
55391 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55392 0 : if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1723, __pyx_L1_error)
55393 0 : __Pyx_GOTREF(__pyx_t_29);
55394 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55395 : }
55396 0 : __pyx_t_2 = PyNumber_Multiply(__pyx_t_9, __pyx_t_29); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1723, __pyx_L1_error)
55397 0 : __Pyx_GOTREF(__pyx_t_2);
55398 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55399 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55400 0 : __pyx_t_29 = NULL;
55401 0 : __pyx_t_10 = 0;
55402 : #if CYTHON_UNPACK_METHODS
55403 0 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
55404 0 : __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_12);
55405 0 : if (likely(__pyx_t_29)) {
55406 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
55407 0 : __Pyx_INCREF(__pyx_t_29);
55408 0 : __Pyx_INCREF(function);
55409 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
55410 : __pyx_t_10 = 1;
55411 : }
55412 : }
55413 : #endif
55414 : {
55415 0 : PyObject *__pyx_callargs[3] = {__pyx_t_29, ((PyObject *)__pyx_v_dm1), __pyx_t_2};
55416 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
55417 0 : __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
55418 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55419 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error)
55420 0 : __Pyx_GOTREF(__pyx_t_1);
55421 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55422 : }
55423 0 : __pyx_v_wsave = __pyx_t_1;
55424 0 : __pyx_t_1 = 0;
55425 :
55426 : /* "scipy/linalg/_decomp_interpolative.pyx":1724
55427 : * dm1 += dm2 / mb
55428 : * wsave = np.outer(dm1, -twopii*np.arange(mb))
55429 : * np.exp(wsave, out=wsave) # <<<<<<<<<<<<<<
55430 : * wsave *= fact
55431 : *
55432 : */
55433 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
55434 0 : __Pyx_GOTREF(__pyx_t_1);
55435 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1724, __pyx_L1_error)
55436 0 : __Pyx_GOTREF(__pyx_t_12);
55437 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55438 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
55439 0 : __Pyx_GOTREF(__pyx_t_1);
55440 0 : __Pyx_INCREF(__pyx_v_wsave);
55441 0 : __Pyx_GIVEREF(__pyx_v_wsave);
55442 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wsave)) __PYX_ERR(0, 1724, __pyx_L1_error);
55443 0 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
55444 0 : __Pyx_GOTREF(__pyx_t_2);
55445 0 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, __pyx_v_wsave) < 0) __PYX_ERR(0, 1724, __pyx_L1_error)
55446 0 : __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1724, __pyx_L1_error)
55447 0 : __Pyx_GOTREF(__pyx_t_29);
55448 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55449 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55450 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55451 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55452 :
55453 : /* "scipy/linalg/_decomp_interpolative.pyx":1725
55454 : * wsave = np.outer(dm1, -twopii*np.arange(mb))
55455 : * np.exp(wsave, out=wsave)
55456 : * wsave *= fact # <<<<<<<<<<<<<<
55457 : *
55458 : * # Perform partial FFT to each nblock then swap first two axes for transposition
55459 : */
55460 0 : __pyx_t_29 = PyFloat_FromDouble(__pyx_v_fact); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1725, __pyx_L1_error)
55461 0 : __Pyx_GOTREF(__pyx_t_29);
55462 0 : __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_wsave, __pyx_t_29); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error)
55463 0 : __Pyx_GOTREF(__pyx_t_2);
55464 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55465 0 : __Pyx_DECREF_SET(__pyx_v_wsave, __pyx_t_2);
55466 0 : __pyx_t_2 = 0;
55467 :
55468 : /* "scipy/linalg/_decomp_interpolative.pyx":1735
55469 : * # Original fortran code does this single column at a time. We do a bit of array
55470 : * # manipulation to do it in one go for all columns at once.
55471 : * F = np.swapaxes( # <<<<<<<<<<<<<<
55472 : * fft(rta.reshape(nblock, mb, -1, order='F'), axis=0), 0, 1
55473 : * )[:, ind // mb, :]
55474 : */
55475 0 : __Pyx_GetModuleGlobalName(__pyx_t_29, __pyx_n_s_np); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1735, __pyx_L1_error)
55476 0 : __Pyx_GOTREF(__pyx_t_29);
55477 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_29, __pyx_n_s_swapaxes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
55478 0 : __Pyx_GOTREF(__pyx_t_1);
55479 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55480 :
55481 : /* "scipy/linalg/_decomp_interpolative.pyx":1736
55482 : * # manipulation to do it in one go for all columns at once.
55483 : * F = np.swapaxes(
55484 : * fft(rta.reshape(nblock, mb, -1, order='F'), axis=0), 0, 1 # <<<<<<<<<<<<<<
55485 : * )[:, ind // mb, :]
55486 : * # Perform direct calculation with DFT matrix
55487 : */
55488 0 : __Pyx_GetModuleGlobalName(__pyx_t_29, __pyx_n_s_fft); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1736, __pyx_L1_error)
55489 0 : __Pyx_GOTREF(__pyx_t_29);
55490 0 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rta), __pyx_n_s_reshape); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1736, __pyx_L1_error)
55491 0 : __Pyx_GOTREF(__pyx_t_12);
55492 0 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_nblock); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1736, __pyx_L1_error)
55493 0 : __Pyx_GOTREF(__pyx_t_9);
55494 0 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_mb); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error)
55495 0 : __Pyx_GOTREF(__pyx_t_8);
55496 0 : __pyx_t_34 = PyTuple_New(3); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1736, __pyx_L1_error)
55497 0 : __Pyx_GOTREF(__pyx_t_34);
55498 0 : __Pyx_GIVEREF(__pyx_t_9);
55499 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_9)) __PYX_ERR(0, 1736, __pyx_L1_error);
55500 0 : __Pyx_GIVEREF(__pyx_t_8);
55501 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 1, __pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error);
55502 0 : __Pyx_INCREF(__pyx_int_neg_1);
55503 0 : __Pyx_GIVEREF(__pyx_int_neg_1);
55504 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_34, 2, __pyx_int_neg_1)) __PYX_ERR(0, 1736, __pyx_L1_error);
55505 0 : __pyx_t_9 = 0;
55506 0 : __pyx_t_8 = 0;
55507 0 : __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error)
55508 0 : __Pyx_GOTREF(__pyx_t_8);
55509 0 : if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1736, __pyx_L1_error)
55510 0 : __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_34, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1736, __pyx_L1_error)
55511 0 : __Pyx_GOTREF(__pyx_t_9);
55512 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
55513 0 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
55514 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55515 0 : __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1736, __pyx_L1_error)
55516 0 : __Pyx_GOTREF(__pyx_t_8);
55517 0 : __Pyx_GIVEREF(__pyx_t_9);
55518 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 1736, __pyx_L1_error);
55519 0 : __pyx_t_9 = 0;
55520 0 : __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1736, __pyx_L1_error)
55521 0 : __Pyx_GOTREF(__pyx_t_9);
55522 0 : if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 1736, __pyx_L1_error)
55523 0 : __pyx_t_34 = __Pyx_PyObject_Call(__pyx_t_29, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1736, __pyx_L1_error)
55524 0 : __Pyx_GOTREF(__pyx_t_34);
55525 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
55526 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55527 0 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55528 0 : __pyx_t_9 = NULL;
55529 0 : __pyx_t_10 = 0;
55530 : #if CYTHON_UNPACK_METHODS
55531 0 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
55532 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
55533 0 : if (likely(__pyx_t_9)) {
55534 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
55535 0 : __Pyx_INCREF(__pyx_t_9);
55536 0 : __Pyx_INCREF(function);
55537 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
55538 : __pyx_t_10 = 1;
55539 : }
55540 : }
55541 : #endif
55542 : {
55543 0 : PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_34, __pyx_int_0, __pyx_int_1};
55544 0 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10);
55545 0 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
55546 0 : __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
55547 0 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1735, __pyx_L1_error)
55548 0 : __Pyx_GOTREF(__pyx_t_2);
55549 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55550 : }
55551 :
55552 : /* "scipy/linalg/_decomp_interpolative.pyx":1737
55553 : * F = np.swapaxes(
55554 : * fft(rta.reshape(nblock, mb, -1, order='F'), axis=0), 0, 1
55555 : * )[:, ind // mb, :] # <<<<<<<<<<<<<<
55556 : * # Perform direct calculation with DFT matrix
55557 : * V = np.einsum('ij,jim->im', wsave, F)
55558 : */
55559 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __pyx_L1_error)
55560 0 : __Pyx_GOTREF(__pyx_t_1);
55561 0 : __pyx_t_34 = PyNumber_FloorDivide(((PyObject *)__pyx_v_ind), __pyx_t_1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1737, __pyx_L1_error)
55562 0 : __Pyx_GOTREF(__pyx_t_34);
55563 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55564 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __pyx_L1_error)
55565 0 : __Pyx_GOTREF(__pyx_t_1);
55566 0 : __Pyx_INCREF(__pyx_slice__5);
55567 0 : __Pyx_GIVEREF(__pyx_slice__5);
55568 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1737, __pyx_L1_error);
55569 0 : __Pyx_GIVEREF(__pyx_t_34);
55570 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_34)) __PYX_ERR(0, 1737, __pyx_L1_error);
55571 0 : __Pyx_INCREF(__pyx_slice__5);
55572 0 : __Pyx_GIVEREF(__pyx_slice__5);
55573 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_slice__5)) __PYX_ERR(0, 1737, __pyx_L1_error);
55574 0 : __pyx_t_34 = 0;
55575 0 : __pyx_t_34 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1737, __pyx_L1_error)
55576 0 : __Pyx_GOTREF(__pyx_t_34);
55577 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55578 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55579 0 : __pyx_v_F = __pyx_t_34;
55580 0 : __pyx_t_34 = 0;
55581 :
55582 : /* "scipy/linalg/_decomp_interpolative.pyx":1739
55583 : * )[:, ind // mb, :]
55584 : * # Perform direct calculation with DFT matrix
55585 : * V = np.einsum('ij,jim->im', wsave, F) # <<<<<<<<<<<<<<
55586 : *
55587 : * return idzr_id(V, krank)
55588 : */
55589 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1739, __pyx_L1_error)
55590 0 : __Pyx_GOTREF(__pyx_t_1);
55591 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_einsum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1739, __pyx_L1_error)
55592 0 : __Pyx_GOTREF(__pyx_t_2);
55593 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55594 0 : __pyx_t_1 = NULL;
55595 0 : __pyx_t_10 = 0;
55596 : #if CYTHON_UNPACK_METHODS
55597 0 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
55598 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
55599 0 : if (likely(__pyx_t_1)) {
55600 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
55601 0 : __Pyx_INCREF(__pyx_t_1);
55602 0 : __Pyx_INCREF(function);
55603 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
55604 : __pyx_t_10 = 1;
55605 : }
55606 : }
55607 : #endif
55608 : {
55609 0 : PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_kp_u_ij_jim_im, __pyx_v_wsave, __pyx_v_F};
55610 0 : __pyx_t_34 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 3+__pyx_t_10);
55611 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
55612 0 : if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1739, __pyx_L1_error)
55613 0 : __Pyx_GOTREF(__pyx_t_34);
55614 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55615 : }
55616 0 : __pyx_v_V = __pyx_t_34;
55617 0 : __pyx_t_34 = 0;
55618 :
55619 : /* "scipy/linalg/_decomp_interpolative.pyx":1741
55620 : * V = np.einsum('ij,jim->im', wsave, F)
55621 : *
55622 : * return idzr_id(V, krank) # <<<<<<<<<<<<<<
55623 : *
55624 : *
55625 : */
55626 0 : __Pyx_XDECREF(__pyx_r);
55627 0 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzr_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error)
55628 0 : __Pyx_GOTREF(__pyx_t_2);
55629 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1741, __pyx_L1_error)
55630 0 : __Pyx_GOTREF(__pyx_t_1);
55631 0 : __pyx_t_9 = NULL;
55632 0 : __pyx_t_10 = 0;
55633 : #if CYTHON_UNPACK_METHODS
55634 0 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
55635 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
55636 0 : if (likely(__pyx_t_9)) {
55637 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
55638 0 : __Pyx_INCREF(__pyx_t_9);
55639 0 : __Pyx_INCREF(function);
55640 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
55641 : __pyx_t_10 = 1;
55642 : }
55643 : }
55644 : #endif
55645 : {
55646 0 : PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_V, __pyx_t_1};
55647 0 : __pyx_t_34 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
55648 0 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
55649 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55650 0 : if (unlikely(!__pyx_t_34)) __PYX_ERR(0, 1741, __pyx_L1_error)
55651 0 : __Pyx_GOTREF(__pyx_t_34);
55652 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55653 : }
55654 0 : __pyx_r = __pyx_t_34;
55655 0 : __pyx_t_34 = 0;
55656 0 : goto __pyx_L0;
55657 :
55658 : /* "scipy/linalg/_decomp_interpolative.pyx":1657
55659 : *
55660 : *
55661 : * def idzr_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
55662 : * rng):
55663 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
55664 : */
55665 :
55666 : /* function exit code */
55667 0 : __pyx_L1_error:;
55668 0 : __Pyx_XDECREF(__pyx_t_1);
55669 0 : __Pyx_XDECREF(__pyx_t_2);
55670 0 : __Pyx_XDECREF(__pyx_t_8);
55671 0 : __Pyx_XDECREF(__pyx_t_9);
55672 0 : __Pyx_XDECREF(__pyx_t_12);
55673 0 : __Pyx_XDECREF(__pyx_t_18);
55674 0 : __Pyx_XDECREF(__pyx_t_29);
55675 0 : __Pyx_XDECREF(__pyx_t_34);
55676 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
55677 0 : __Pyx_PyThreadState_declare
55678 0 : __Pyx_PyThreadState_assign
55679 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
55680 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
55681 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
55682 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer);
55683 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm2.rcbuffer->pybuffer);
55684 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
55685 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
55686 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
55687 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
55688 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
55689 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_aid", __pyx_clineno, __pyx_lineno, __pyx_filename);
55690 0 : __pyx_r = NULL;
55691 0 : goto __pyx_L2;
55692 3 : __pyx_L0:;
55693 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
55694 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_albetas.rcbuffer->pybuffer);
55695 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm1.rcbuffer->pybuffer);
55696 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm2.rcbuffer->pybuffer);
55697 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_giv2x2.rcbuffer->pybuffer);
55698 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
55699 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rta.rcbuffer->pybuffer);
55700 3 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_subselect.rcbuffer->pybuffer);
55701 3 : __pyx_L2:;
55702 3 : __Pyx_XDECREF((PyObject *)__pyx_v_ind);
55703 3 : __Pyx_XDECREF((PyObject *)__pyx_v_subselect);
55704 3 : __Pyx_XDECREF((PyObject *)__pyx_v_dm1);
55705 3 : __Pyx_XDECREF((PyObject *)__pyx_v_dm2);
55706 3 : __Pyx_XDECREF((PyObject *)__pyx_v_albetas);
55707 3 : __Pyx_XDECREF((PyObject *)__pyx_v_rta);
55708 3 : __Pyx_XDECREF((PyObject *)__pyx_v_giv2x2);
55709 3 : __Pyx_XDECREF(__pyx_v_inds);
55710 3 : __Pyx_XDECREF(__pyx_v_proj);
55711 3 : __Pyx_XDECREF(__pyx_v_row);
55712 3 : __Pyx_XDECREF(__pyx_v_alpha);
55713 3 : __Pyx_XDECREF(__pyx_v_beta);
55714 3 : __Pyx_XDECREF(__pyx_v_wsave);
55715 3 : __Pyx_XDECREF(__pyx_v_F);
55716 3 : __Pyx_XDECREF(__pyx_v_V);
55717 3 : __Pyx_XGIVEREF(__pyx_r);
55718 3 : __Pyx_RefNannyFinishContext();
55719 3 : return __pyx_r;
55720 : }
55721 :
55722 : /* "scipy/linalg/_decomp_interpolative.pyx":1744
55723 : *
55724 : *
55725 : * def idzr_asvd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank, *, rng): # <<<<<<<<<<<<<<
55726 : * cdef int m = a.shape[0], n = a.shape[1]
55727 : * cdef int info, ci
55728 : */
55729 :
55730 : /* Python wrapper */
55731 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_69idzr_asvd(PyObject *__pyx_self,
55732 : #if CYTHON_METH_FASTCALL
55733 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
55734 : #else
55735 : PyObject *__pyx_args, PyObject *__pyx_kwds
55736 : #endif
55737 : ); /*proto*/
55738 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_69idzr_asvd = {"idzr_asvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_69idzr_asvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
55739 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_69idzr_asvd(PyObject *__pyx_self,
55740 : #if CYTHON_METH_FASTCALL
55741 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
55742 : #else
55743 : PyObject *__pyx_args, PyObject *__pyx_kwds
55744 : #endif
55745 : ) {
55746 1 : PyArrayObject *__pyx_v_a = 0;
55747 1 : int __pyx_v_krank;
55748 1 : PyObject *__pyx_v_rng = 0;
55749 : #if !CYTHON_METH_FASTCALL
55750 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
55751 : #endif
55752 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
55753 1 : PyObject* values[3] = {0,0,0};
55754 1 : int __pyx_lineno = 0;
55755 1 : const char *__pyx_filename = NULL;
55756 1 : int __pyx_clineno = 0;
55757 1 : PyObject *__pyx_r = 0;
55758 : __Pyx_RefNannyDeclarations
55759 1 : __Pyx_RefNannySetupContext("idzr_asvd (wrapper)", 0);
55760 : #if !CYTHON_METH_FASTCALL
55761 : #if CYTHON_ASSUME_SAFE_MACROS
55762 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
55763 : #else
55764 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
55765 : #endif
55766 : #endif
55767 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
55768 : {
55769 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
55770 1 : if (likely(__pyx_kwds)) {
55771 1 : Py_ssize_t kw_args;
55772 1 : switch (__pyx_nargs) {
55773 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
55774 1 : CYTHON_FALLTHROUGH;
55775 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
55776 1 : CYTHON_FALLTHROUGH;
55777 1 : case 0: break;
55778 0 : default: goto __pyx_L5_argtuple_error;
55779 : }
55780 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
55781 1 : switch (__pyx_nargs) {
55782 : case 0:
55783 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
55784 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
55785 0 : kw_args--;
55786 : }
55787 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1744, __pyx_L3_error)
55788 0 : else goto __pyx_L5_argtuple_error;
55789 0 : CYTHON_FALLTHROUGH;
55790 : case 1:
55791 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
55792 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
55793 0 : kw_args--;
55794 : }
55795 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1744, __pyx_L3_error)
55796 : else {
55797 0 : __Pyx_RaiseArgtupleInvalid("idzr_asvd", 1, 2, 2, 1); __PYX_ERR(0, 1744, __pyx_L3_error)
55798 : }
55799 1 : CYTHON_FALLTHROUGH;
55800 : case 2:
55801 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
55802 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
55803 1 : kw_args--;
55804 : }
55805 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1744, __pyx_L3_error)
55806 : else {
55807 0 : __Pyx_RaiseKeywordRequired("idzr_asvd", __pyx_n_s_rng); __PYX_ERR(0, 1744, __pyx_L3_error)
55808 : }
55809 : }
55810 1 : if (unlikely(kw_args > 0)) {
55811 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
55812 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_asvd") < 0)) __PYX_ERR(0, 1744, __pyx_L3_error)
55813 : }
55814 0 : } else if (unlikely(__pyx_nargs != 2)) {
55815 0 : goto __pyx_L5_argtuple_error;
55816 : } else {
55817 0 : __Pyx_RaiseKeywordRequired("idzr_asvd", __pyx_n_s_rng); __PYX_ERR(0, 1744, __pyx_L3_error)
55818 : }
55819 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
55820 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1744, __pyx_L3_error)
55821 1 : __pyx_v_rng = values[2];
55822 : }
55823 1 : goto __pyx_L6_skip;
55824 0 : __pyx_L5_argtuple_error:;
55825 0 : __Pyx_RaiseArgtupleInvalid("idzr_asvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1744, __pyx_L3_error)
55826 1 : __pyx_L6_skip:;
55827 1 : goto __pyx_L4_argument_unpacking_done;
55828 0 : __pyx_L3_error:;
55829 : {
55830 0 : Py_ssize_t __pyx_temp;
55831 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
55832 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
55833 : }
55834 : }
55835 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
55836 0 : __Pyx_RefNannyFinishContext();
55837 0 : return NULL;
55838 1 : __pyx_L4_argument_unpacking_done:;
55839 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1744, __pyx_L1_error)
55840 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_68idzr_asvd(__pyx_self, __pyx_v_a, __pyx_v_krank, __pyx_v_rng);
55841 :
55842 : /* function exit code */
55843 1 : goto __pyx_L0;
55844 0 : __pyx_L1_error:;
55845 0 : __pyx_r = NULL;
55846 1 : __pyx_L0:;
55847 : {
55848 1 : Py_ssize_t __pyx_temp;
55849 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
55850 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
55851 : }
55852 : }
55853 : __Pyx_RefNannyFinishContext();
55854 : return __pyx_r;
55855 : }
55856 :
55857 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_68idzr_asvd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank, PyObject *__pyx_v_rng) {
55858 1 : int __pyx_v_m;
55859 1 : int __pyx_v_n;
55860 1 : int __pyx_v_info;
55861 1 : int __pyx_v_ci;
55862 1 : PyArrayObject *__pyx_v_C = 0;
55863 1 : PyArrayObject *__pyx_v_tau1 = 0;
55864 1 : PyArrayObject *__pyx_v_tau2 = 0;
55865 1 : PyArrayObject *__pyx_v_UU = 0;
55866 1 : PyArrayObject *__pyx_v_S = 0;
55867 1 : PyArrayObject *__pyx_v_V = 0;
55868 1 : PyArrayObject *__pyx_v_VV = 0;
55869 1 : PyArrayObject *__pyx_v_proj = 0;
55870 1 : PyArrayObject *__pyx_v_perms = 0;
55871 1 : PyArrayObject *__pyx_v_inds1 = 0;
55872 1 : PyArrayObject *__pyx_v_inds2 = 0;
55873 1 : PyArrayObject *__pyx_v_p = 0;
55874 1 : PyArrayObject *__pyx_v_col = 0;
55875 1 : PyObject *__pyx_v_r = NULL;
55876 1 : PyObject *__pyx_v_t = NULL;
55877 1 : PyObject *__pyx_v_r2 = NULL;
55878 1 : PyObject *__pyx_v_r3 = NULL;
55879 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
55880 1 : __Pyx_Buffer __pyx_pybuffer_C;
55881 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
55882 1 : __Pyx_Buffer __pyx_pybuffer_S;
55883 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
55884 1 : __Pyx_Buffer __pyx_pybuffer_UU;
55885 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_V;
55886 1 : __Pyx_Buffer __pyx_pybuffer_V;
55887 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_VV;
55888 1 : __Pyx_Buffer __pyx_pybuffer_VV;
55889 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
55890 1 : __Pyx_Buffer __pyx_pybuffer_a;
55891 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
55892 1 : __Pyx_Buffer __pyx_pybuffer_col;
55893 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds1;
55894 1 : __Pyx_Buffer __pyx_pybuffer_inds1;
55895 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds2;
55896 1 : __Pyx_Buffer __pyx_pybuffer_inds2;
55897 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_p;
55898 1 : __Pyx_Buffer __pyx_pybuffer_p;
55899 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
55900 1 : __Pyx_Buffer __pyx_pybuffer_perms;
55901 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
55902 1 : __Pyx_Buffer __pyx_pybuffer_proj;
55903 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau1;
55904 1 : __Pyx_Buffer __pyx_pybuffer_tau1;
55905 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_tau2;
55906 1 : __Pyx_Buffer __pyx_pybuffer_tau2;
55907 1 : PyObject *__pyx_r = NULL;
55908 : __Pyx_RefNannyDeclarations
55909 1 : npy_intp __pyx_t_1[2];
55910 1 : PyObject *__pyx_t_2 = NULL;
55911 1 : PyArrayObject *__pyx_t_3 = NULL;
55912 1 : int __pyx_t_4;
55913 1 : PyObject *__pyx_t_5 = NULL;
55914 1 : PyObject *__pyx_t_6 = NULL;
55915 1 : PyObject *__pyx_t_7 = NULL;
55916 1 : npy_intp __pyx_t_8[2];
55917 1 : PyArrayObject *__pyx_t_9 = NULL;
55918 1 : npy_intp __pyx_t_10[2];
55919 1 : PyArrayObject *__pyx_t_11 = NULL;
55920 1 : PyObject *__pyx_t_12 = NULL;
55921 1 : PyObject *__pyx_t_13 = NULL;
55922 1 : PyObject *__pyx_t_14 = NULL;
55923 1 : unsigned int __pyx_t_15;
55924 1 : PyObject *(*__pyx_t_16)(PyObject *);
55925 1 : PyArrayObject *__pyx_t_17 = NULL;
55926 1 : PyArrayObject *__pyx_t_18 = NULL;
55927 1 : PyArrayObject *__pyx_t_19 = NULL;
55928 1 : int __pyx_t_20;
55929 1 : int __pyx_t_21;
55930 1 : Py_ssize_t __pyx_t_22;
55931 1 : Py_ssize_t __pyx_t_23;
55932 1 : npy_int64 __pyx_t_24;
55933 1 : PyArrayObject *__pyx_t_25 = NULL;
55934 1 : PyArrayObject *__pyx_t_26 = NULL;
55935 1 : PyArrayObject *__pyx_t_27 = NULL;
55936 1 : PyArrayObject *__pyx_t_28 = NULL;
55937 1 : PyObject *__pyx_t_29 = NULL;
55938 1 : PyObject *__pyx_t_30 = NULL;
55939 1 : PyObject *__pyx_t_31 = NULL;
55940 1 : PyArrayObject *__pyx_t_32 = NULL;
55941 1 : PyArrayObject *__pyx_t_33 = NULL;
55942 1 : PyArrayObject *__pyx_t_34 = NULL;
55943 1 : Py_ssize_t __pyx_t_35;
55944 1 : Py_ssize_t __pyx_t_36;
55945 1 : Py_ssize_t __pyx_t_37;
55946 1 : Py_ssize_t __pyx_t_38;
55947 1 : Py_ssize_t __pyx_t_39;
55948 1 : int __pyx_lineno = 0;
55949 1 : const char *__pyx_filename = NULL;
55950 1 : int __pyx_clineno = 0;
55951 1 : __Pyx_RefNannySetupContext("idzr_asvd", 1);
55952 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
55953 1 : __pyx_pybuffer_C.refcount = 0;
55954 1 : __pyx_pybuffernd_C.data = NULL;
55955 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
55956 1 : __pyx_pybuffer_tau1.pybuffer.buf = NULL;
55957 1 : __pyx_pybuffer_tau1.refcount = 0;
55958 1 : __pyx_pybuffernd_tau1.data = NULL;
55959 1 : __pyx_pybuffernd_tau1.rcbuffer = &__pyx_pybuffer_tau1;
55960 1 : __pyx_pybuffer_tau2.pybuffer.buf = NULL;
55961 1 : __pyx_pybuffer_tau2.refcount = 0;
55962 1 : __pyx_pybuffernd_tau2.data = NULL;
55963 1 : __pyx_pybuffernd_tau2.rcbuffer = &__pyx_pybuffer_tau2;
55964 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
55965 1 : __pyx_pybuffer_UU.refcount = 0;
55966 1 : __pyx_pybuffernd_UU.data = NULL;
55967 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
55968 1 : __pyx_pybuffer_S.pybuffer.buf = NULL;
55969 1 : __pyx_pybuffer_S.refcount = 0;
55970 1 : __pyx_pybuffernd_S.data = NULL;
55971 1 : __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
55972 1 : __pyx_pybuffer_V.pybuffer.buf = NULL;
55973 1 : __pyx_pybuffer_V.refcount = 0;
55974 1 : __pyx_pybuffernd_V.data = NULL;
55975 1 : __pyx_pybuffernd_V.rcbuffer = &__pyx_pybuffer_V;
55976 1 : __pyx_pybuffer_VV.pybuffer.buf = NULL;
55977 1 : __pyx_pybuffer_VV.refcount = 0;
55978 1 : __pyx_pybuffernd_VV.data = NULL;
55979 1 : __pyx_pybuffernd_VV.rcbuffer = &__pyx_pybuffer_VV;
55980 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
55981 1 : __pyx_pybuffer_proj.refcount = 0;
55982 1 : __pyx_pybuffernd_proj.data = NULL;
55983 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
55984 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
55985 1 : __pyx_pybuffer_perms.refcount = 0;
55986 1 : __pyx_pybuffernd_perms.data = NULL;
55987 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
55988 1 : __pyx_pybuffer_inds1.pybuffer.buf = NULL;
55989 1 : __pyx_pybuffer_inds1.refcount = 0;
55990 1 : __pyx_pybuffernd_inds1.data = NULL;
55991 1 : __pyx_pybuffernd_inds1.rcbuffer = &__pyx_pybuffer_inds1;
55992 1 : __pyx_pybuffer_inds2.pybuffer.buf = NULL;
55993 1 : __pyx_pybuffer_inds2.refcount = 0;
55994 1 : __pyx_pybuffernd_inds2.data = NULL;
55995 1 : __pyx_pybuffernd_inds2.rcbuffer = &__pyx_pybuffer_inds2;
55996 1 : __pyx_pybuffer_p.pybuffer.buf = NULL;
55997 1 : __pyx_pybuffer_p.refcount = 0;
55998 1 : __pyx_pybuffernd_p.data = NULL;
55999 1 : __pyx_pybuffernd_p.rcbuffer = &__pyx_pybuffer_p;
56000 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
56001 1 : __pyx_pybuffer_col.refcount = 0;
56002 1 : __pyx_pybuffernd_col.data = NULL;
56003 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
56004 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
56005 1 : __pyx_pybuffer_a.refcount = 0;
56006 1 : __pyx_pybuffernd_a.data = NULL;
56007 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
56008 : {
56009 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56010 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1744, __pyx_L1_error)
56011 : }
56012 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
56013 :
56014 : /* "scipy/linalg/_decomp_interpolative.pyx":1745
56015 : *
56016 : * def idzr_asvd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank, *, rng):
56017 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
56018 : * cdef int info, ci
56019 : * cdef cnp.ndarray[cnp.complex128_t, mode='fortran', ndim=2] C
56020 : */
56021 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
56022 1 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
56023 :
56024 : /* "scipy/linalg/_decomp_interpolative.pyx":1760
56025 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] p
56026 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] col
56027 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
56028 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
56029 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
56030 : */
56031 1 : __pyx_t_1[0] = __pyx_v_m;
56032 1 : __pyx_t_1[1] = __pyx_v_krank;
56033 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_1, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1760, __pyx_L1_error)
56034 1 : __Pyx_GOTREF(__pyx_t_2);
56035 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1760, __pyx_L1_error)
56036 1 : __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
56037 : {
56038 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56039 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
56040 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
56041 1 : if (unlikely(__pyx_t_4 < 0)) {
56042 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
56043 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
56044 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
56045 : __Pyx_RaiseBufferFallbackError();
56046 : } else {
56047 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
56048 : }
56049 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
56050 : }
56051 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
56052 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1760, __pyx_L1_error)
56053 : }
56054 1 : __pyx_t_3 = 0;
56055 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
56056 1 : __pyx_t_2 = 0;
56057 :
56058 : /* "scipy/linalg/_decomp_interpolative.pyx":1761
56059 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] col
56060 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
56061 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
56062 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
56063 : *
56064 : */
56065 1 : __pyx_t_8[0] = __pyx_v_n;
56066 1 : __pyx_t_8[1] = __pyx_v_krank;
56067 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_8, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
56068 1 : __Pyx_GOTREF(__pyx_t_2);
56069 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1761, __pyx_L1_error)
56070 1 : __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
56071 : {
56072 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56073 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
56074 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
56075 1 : if (unlikely(__pyx_t_4 < 0)) {
56076 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
56077 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_VV.rcbuffer->pybuffer, (PyObject*)__pyx_v_VV, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
56078 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
56079 : __Pyx_RaiseBufferFallbackError();
56080 : } else {
56081 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
56082 : }
56083 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
56084 : }
56085 1 : __pyx_pybuffernd_VV.diminfo[0].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_VV.diminfo[0].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_VV.diminfo[1].strides = __pyx_pybuffernd_VV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_VV.diminfo[1].shape = __pyx_pybuffernd_VV.rcbuffer->pybuffer.shape[1];
56086 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
56087 : }
56088 1 : __pyx_t_9 = 0;
56089 1 : __pyx_v_VV = ((PyArrayObject *)__pyx_t_2);
56090 1 : __pyx_t_2 = 0;
56091 :
56092 : /* "scipy/linalg/_decomp_interpolative.pyx":1762
56093 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
56094 : * VV = cnp.PyArray_ZEROS(2, [n, krank], cnp.NPY_COMPLEX128, 0)
56095 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
56096 : *
56097 : * perms, proj = idzr_aid(a.copy(), krank=krank, rng=rng)
56098 : */
56099 1 : __pyx_t_10[0] = __pyx_v_krank;
56100 1 : __pyx_t_10[1] = __pyx_v_n;
56101 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_10, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1762, __pyx_L1_error)
56102 1 : __Pyx_GOTREF(__pyx_t_2);
56103 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1762, __pyx_L1_error)
56104 1 : __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
56105 : {
56106 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56107 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
56108 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack);
56109 1 : if (unlikely(__pyx_t_4 < 0)) {
56110 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
56111 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p.rcbuffer->pybuffer, (PyObject*)__pyx_v_p, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
56112 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
56113 : __Pyx_RaiseBufferFallbackError();
56114 : } else {
56115 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
56116 : }
56117 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
56118 : }
56119 1 : __pyx_pybuffernd_p.diminfo[0].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p.diminfo[0].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p.diminfo[1].strides = __pyx_pybuffernd_p.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p.diminfo[1].shape = __pyx_pybuffernd_p.rcbuffer->pybuffer.shape[1];
56120 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1762, __pyx_L1_error)
56121 : }
56122 1 : __pyx_t_11 = 0;
56123 1 : __pyx_v_p = ((PyArrayObject *)__pyx_t_2);
56124 1 : __pyx_t_2 = 0;
56125 :
56126 : /* "scipy/linalg/_decomp_interpolative.pyx":1764
56127 : * p = cnp.PyArray_ZEROS(2, [krank, n], cnp.NPY_COMPLEX128, 0)
56128 : *
56129 : * perms, proj = idzr_aid(a.copy(), krank=krank, rng=rng) # <<<<<<<<<<<<<<
56130 : * col = a[:, perms[:krank]].copy()
56131 : *
56132 : */
56133 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzr_aid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error)
56134 1 : __Pyx_GOTREF(__pyx_t_2);
56135 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1764, __pyx_L1_error)
56136 1 : __Pyx_GOTREF(__pyx_t_13);
56137 1 : __pyx_t_14 = NULL;
56138 1 : __pyx_t_15 = 0;
56139 : #if CYTHON_UNPACK_METHODS
56140 1 : if (likely(PyMethod_Check(__pyx_t_13))) {
56141 0 : __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
56142 0 : if (likely(__pyx_t_14)) {
56143 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56144 0 : __Pyx_INCREF(__pyx_t_14);
56145 0 : __Pyx_INCREF(function);
56146 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56147 : __pyx_t_15 = 1;
56148 : }
56149 : }
56150 : #endif
56151 : {
56152 1 : PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
56153 1 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
56154 1 : __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
56155 1 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1764, __pyx_L1_error)
56156 1 : __Pyx_GOTREF(__pyx_t_12);
56157 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56158 : }
56159 1 : __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1764, __pyx_L1_error)
56160 1 : __Pyx_GOTREF(__pyx_t_13);
56161 1 : __Pyx_GIVEREF(__pyx_t_12);
56162 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12)) __PYX_ERR(0, 1764, __pyx_L1_error);
56163 1 : __pyx_t_12 = 0;
56164 1 : __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1764, __pyx_L1_error)
56165 1 : __Pyx_GOTREF(__pyx_t_12);
56166 1 : __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1764, __pyx_L1_error)
56167 1 : __Pyx_GOTREF(__pyx_t_14);
56168 1 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_krank, __pyx_t_14) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
56169 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56170 1 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
56171 1 : __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1764, __pyx_L1_error)
56172 1 : __Pyx_GOTREF(__pyx_t_14);
56173 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56174 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56175 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56176 1 : if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
56177 1 : PyObject* sequence = __pyx_t_14;
56178 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
56179 1 : if (unlikely(size != 2)) {
56180 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
56181 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
56182 0 : __PYX_ERR(0, 1764, __pyx_L1_error)
56183 : }
56184 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56185 1 : if (likely(PyTuple_CheckExact(sequence))) {
56186 1 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
56187 1 : __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
56188 : } else {
56189 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 0);
56190 0 : __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
56191 : }
56192 1 : __Pyx_INCREF(__pyx_t_12);
56193 1 : __Pyx_INCREF(__pyx_t_13);
56194 : #else
56195 : __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1764, __pyx_L1_error)
56196 : __Pyx_GOTREF(__pyx_t_12);
56197 : __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1764, __pyx_L1_error)
56198 : __Pyx_GOTREF(__pyx_t_13);
56199 : #endif
56200 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56201 : } else {
56202 0 : Py_ssize_t index = -1;
56203 0 : __pyx_t_2 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1764, __pyx_L1_error)
56204 0 : __Pyx_GOTREF(__pyx_t_2);
56205 0 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56206 0 : __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
56207 0 : index = 0; __pyx_t_12 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_12)) goto __pyx_L3_unpacking_failed;
56208 0 : __Pyx_GOTREF(__pyx_t_12);
56209 0 : index = 1; __pyx_t_13 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_13)) goto __pyx_L3_unpacking_failed;
56210 0 : __Pyx_GOTREF(__pyx_t_13);
56211 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1764, __pyx_L1_error)
56212 0 : __pyx_t_16 = NULL;
56213 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56214 0 : goto __pyx_L4_unpacking_done;
56215 0 : __pyx_L3_unpacking_failed:;
56216 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56217 0 : __pyx_t_16 = NULL;
56218 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
56219 0 : __PYX_ERR(0, 1764, __pyx_L1_error)
56220 0 : __pyx_L4_unpacking_done:;
56221 : }
56222 1 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1764, __pyx_L1_error)
56223 1 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1764, __pyx_L1_error)
56224 1 : __pyx_t_17 = ((PyArrayObject *)__pyx_t_12);
56225 : {
56226 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56227 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
56228 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
56229 1 : if (unlikely(__pyx_t_4 < 0)) {
56230 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
56231 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
56232 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
56233 : __Pyx_RaiseBufferFallbackError();
56234 : } else {
56235 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
56236 : }
56237 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
56238 : }
56239 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
56240 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1764, __pyx_L1_error)
56241 : }
56242 1 : __pyx_t_17 = 0;
56243 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_12);
56244 1 : __pyx_t_12 = 0;
56245 1 : __pyx_t_18 = ((PyArrayObject *)__pyx_t_13);
56246 : {
56247 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56248 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
56249 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
56250 1 : if (unlikely(__pyx_t_4 < 0)) {
56251 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
56252 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
56253 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
56254 : __Pyx_RaiseBufferFallbackError();
56255 : } else {
56256 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
56257 : }
56258 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
56259 : }
56260 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
56261 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1764, __pyx_L1_error)
56262 : }
56263 1 : __pyx_t_18 = 0;
56264 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_13);
56265 1 : __pyx_t_13 = 0;
56266 :
56267 : /* "scipy/linalg/_decomp_interpolative.pyx":1765
56268 : *
56269 : * perms, proj = idzr_aid(a.copy(), krank=krank, rng=rng)
56270 : * col = a[:, perms[:krank]].copy() # <<<<<<<<<<<<<<
56271 : *
56272 : * # idd_reconint
56273 : */
56274 1 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1765, __pyx_L1_error)
56275 1 : __Pyx_GOTREF(__pyx_t_13);
56276 1 : __pyx_t_12 = PySlice_New(Py_None, __pyx_t_13, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1765, __pyx_L1_error)
56277 1 : __Pyx_GOTREF(__pyx_t_12);
56278 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56279 1 : __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1765, __pyx_L1_error)
56280 1 : __Pyx_GOTREF(__pyx_t_13);
56281 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56282 1 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1765, __pyx_L1_error)
56283 1 : __Pyx_GOTREF(__pyx_t_12);
56284 1 : __Pyx_INCREF(__pyx_slice__5);
56285 1 : __Pyx_GIVEREF(__pyx_slice__5);
56286 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__5)) __PYX_ERR(0, 1765, __pyx_L1_error);
56287 1 : __Pyx_GIVEREF(__pyx_t_13);
56288 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1765, __pyx_L1_error);
56289 1 : __pyx_t_13 = 0;
56290 1 : __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1765, __pyx_L1_error)
56291 1 : __Pyx_GOTREF(__pyx_t_13);
56292 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56293 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_copy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1765, __pyx_L1_error)
56294 1 : __Pyx_GOTREF(__pyx_t_12);
56295 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56296 1 : __pyx_t_13 = NULL;
56297 1 : __pyx_t_15 = 0;
56298 : #if CYTHON_UNPACK_METHODS
56299 1 : if (likely(PyMethod_Check(__pyx_t_12))) {
56300 0 : __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
56301 0 : if (likely(__pyx_t_13)) {
56302 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
56303 0 : __Pyx_INCREF(__pyx_t_13);
56304 0 : __Pyx_INCREF(function);
56305 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
56306 : __pyx_t_15 = 1;
56307 : }
56308 : }
56309 : #endif
56310 : {
56311 1 : PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
56312 1 : __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
56313 1 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
56314 1 : if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1765, __pyx_L1_error)
56315 1 : __Pyx_GOTREF(__pyx_t_14);
56316 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56317 : }
56318 1 : if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1765, __pyx_L1_error)
56319 1 : __pyx_t_19 = ((PyArrayObject *)__pyx_t_14);
56320 : {
56321 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56322 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
56323 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
56324 1 : if (unlikely(__pyx_t_4 < 0)) {
56325 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
56326 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
56327 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
56328 : __Pyx_RaiseBufferFallbackError();
56329 : } else {
56330 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
56331 : }
56332 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
56333 : }
56334 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
56335 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1765, __pyx_L1_error)
56336 : }
56337 1 : __pyx_t_19 = 0;
56338 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_14);
56339 1 : __pyx_t_14 = 0;
56340 :
56341 : /* "scipy/linalg/_decomp_interpolative.pyx":1768
56342 : *
56343 : * # idd_reconint
56344 : * for ci in range(krank): # <<<<<<<<<<<<<<
56345 : * p[ci, perms[ci]] = 1.0
56346 : *
56347 : */
56348 1 : __pyx_t_4 = __pyx_v_krank;
56349 1 : __pyx_t_20 = __pyx_t_4;
56350 21 : for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
56351 20 : __pyx_v_ci = __pyx_t_21;
56352 :
56353 : /* "scipy/linalg/_decomp_interpolative.pyx":1769
56354 : * # idd_reconint
56355 : * for ci in range(krank):
56356 : * p[ci, perms[ci]] = 1.0 # <<<<<<<<<<<<<<
56357 : *
56358 : * p[:, perms[krank:]] = proj[:, :]
56359 : */
56360 20 : __pyx_t_22 = __pyx_v_ci;
56361 20 : __pyx_t_23 = __pyx_v_ci;
56362 20 : __pyx_t_24 = (*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_perms.diminfo[0].strides));
56363 20 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_p.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_p.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_p.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1.0, 0);
56364 : }
56365 :
56366 : /* "scipy/linalg/_decomp_interpolative.pyx":1771
56367 : * p[ci, perms[ci]] = 1.0
56368 : *
56369 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
56370 : * inds1, tau1 = idzr_qrpiv(col, krank)
56371 : * # idz_rinqr and idz_rearr
56372 : */
56373 1 : __pyx_t_14 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_proj), __pyx_tuple__14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1771, __pyx_L1_error)
56374 1 : __Pyx_GOTREF(__pyx_t_14);
56375 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1771, __pyx_L1_error)
56376 1 : __Pyx_GOTREF(__pyx_t_12);
56377 1 : __pyx_t_13 = PySlice_New(__pyx_t_12, Py_None, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1771, __pyx_L1_error)
56378 1 : __Pyx_GOTREF(__pyx_t_13);
56379 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56380 1 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_perms), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1771, __pyx_L1_error)
56381 1 : __Pyx_GOTREF(__pyx_t_12);
56382 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56383 1 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1771, __pyx_L1_error)
56384 1 : __Pyx_GOTREF(__pyx_t_13);
56385 1 : __Pyx_INCREF(__pyx_slice__5);
56386 1 : __Pyx_GIVEREF(__pyx_slice__5);
56387 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice__5)) __PYX_ERR(0, 1771, __pyx_L1_error);
56388 1 : __Pyx_GIVEREF(__pyx_t_12);
56389 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1771, __pyx_L1_error);
56390 1 : __pyx_t_12 = 0;
56391 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_p), __pyx_t_13, __pyx_t_14) < 0))) __PYX_ERR(0, 1771, __pyx_L1_error)
56392 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56393 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56394 :
56395 : /* "scipy/linalg/_decomp_interpolative.pyx":1772
56396 : *
56397 : * p[:, perms[krank:]] = proj[:, :]
56398 : * inds1, tau1 = idzr_qrpiv(col, krank) # <<<<<<<<<<<<<<
56399 : * # idz_rinqr and idz_rearr
56400 : * r = np.triu(col[:krank, :])
56401 : */
56402 1 : __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1772, __pyx_L1_error)
56403 1 : __Pyx_GOTREF(__pyx_t_13);
56404 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1772, __pyx_L1_error)
56405 1 : __Pyx_GOTREF(__pyx_t_12);
56406 1 : __pyx_t_2 = NULL;
56407 1 : __pyx_t_15 = 0;
56408 : #if CYTHON_UNPACK_METHODS
56409 1 : if (unlikely(PyMethod_Check(__pyx_t_13))) {
56410 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
56411 0 : if (likely(__pyx_t_2)) {
56412 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56413 0 : __Pyx_INCREF(__pyx_t_2);
56414 0 : __Pyx_INCREF(function);
56415 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56416 : __pyx_t_15 = 1;
56417 : }
56418 : }
56419 : #endif
56420 : {
56421 1 : PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_col), __pyx_t_12};
56422 1 : __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 2+__pyx_t_15);
56423 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
56424 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56425 1 : if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1772, __pyx_L1_error)
56426 1 : __Pyx_GOTREF(__pyx_t_14);
56427 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56428 : }
56429 1 : if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
56430 1 : PyObject* sequence = __pyx_t_14;
56431 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
56432 1 : if (unlikely(size != 2)) {
56433 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
56434 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
56435 0 : __PYX_ERR(0, 1772, __pyx_L1_error)
56436 : }
56437 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56438 1 : if (likely(PyTuple_CheckExact(sequence))) {
56439 1 : __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
56440 1 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
56441 : } else {
56442 0 : __pyx_t_13 = PyList_GET_ITEM(sequence, 0);
56443 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 1);
56444 : }
56445 1 : __Pyx_INCREF(__pyx_t_13);
56446 1 : __Pyx_INCREF(__pyx_t_12);
56447 : #else
56448 : __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1772, __pyx_L1_error)
56449 : __Pyx_GOTREF(__pyx_t_13);
56450 : __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1772, __pyx_L1_error)
56451 : __Pyx_GOTREF(__pyx_t_12);
56452 : #endif
56453 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56454 : } else {
56455 0 : Py_ssize_t index = -1;
56456 0 : __pyx_t_2 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1772, __pyx_L1_error)
56457 0 : __Pyx_GOTREF(__pyx_t_2);
56458 0 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56459 0 : __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
56460 0 : index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_13)) goto __pyx_L7_unpacking_failed;
56461 0 : __Pyx_GOTREF(__pyx_t_13);
56462 0 : index = 1; __pyx_t_12 = __pyx_t_16(__pyx_t_2); if (unlikely(!__pyx_t_12)) goto __pyx_L7_unpacking_failed;
56463 0 : __Pyx_GOTREF(__pyx_t_12);
56464 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1772, __pyx_L1_error)
56465 0 : __pyx_t_16 = NULL;
56466 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56467 0 : goto __pyx_L8_unpacking_done;
56468 0 : __pyx_L7_unpacking_failed:;
56469 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56470 0 : __pyx_t_16 = NULL;
56471 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
56472 0 : __PYX_ERR(0, 1772, __pyx_L1_error)
56473 0 : __pyx_L8_unpacking_done:;
56474 : }
56475 1 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1772, __pyx_L1_error)
56476 1 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1772, __pyx_L1_error)
56477 1 : __pyx_t_25 = ((PyArrayObject *)__pyx_t_13);
56478 : {
56479 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56480 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
56481 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
56482 1 : if (unlikely(__pyx_t_4 < 0)) {
56483 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
56484 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds1, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
56485 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
56486 : __Pyx_RaiseBufferFallbackError();
56487 : } else {
56488 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
56489 : }
56490 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
56491 : }
56492 1 : __pyx_pybuffernd_inds1.diminfo[0].strides = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds1.diminfo[0].shape = __pyx_pybuffernd_inds1.rcbuffer->pybuffer.shape[0];
56493 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1772, __pyx_L1_error)
56494 : }
56495 1 : __pyx_t_25 = 0;
56496 1 : __pyx_v_inds1 = ((PyArrayObject *)__pyx_t_13);
56497 1 : __pyx_t_13 = 0;
56498 1 : __pyx_t_26 = ((PyArrayObject *)__pyx_t_12);
56499 : {
56500 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56501 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
56502 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
56503 1 : if (unlikely(__pyx_t_4 < 0)) {
56504 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
56505 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau1, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
56506 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
56507 : __Pyx_RaiseBufferFallbackError();
56508 : } else {
56509 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
56510 : }
56511 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
56512 : }
56513 1 : __pyx_pybuffernd_tau1.diminfo[0].strides = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau1.diminfo[0].shape = __pyx_pybuffernd_tau1.rcbuffer->pybuffer.shape[0];
56514 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1772, __pyx_L1_error)
56515 : }
56516 1 : __pyx_t_26 = 0;
56517 1 : __pyx_v_tau1 = ((PyArrayObject *)__pyx_t_12);
56518 1 : __pyx_t_12 = 0;
56519 :
56520 : /* "scipy/linalg/_decomp_interpolative.pyx":1774
56521 : * inds1, tau1 = idzr_qrpiv(col, krank)
56522 : * # idz_rinqr and idz_rearr
56523 : * r = np.triu(col[:krank, :]) # <<<<<<<<<<<<<<
56524 : * for ci in range(krank-1, -1, -1):
56525 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
56526 : */
56527 1 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1774, __pyx_L1_error)
56528 1 : __Pyx_GOTREF(__pyx_t_12);
56529 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_triu); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1774, __pyx_L1_error)
56530 1 : __Pyx_GOTREF(__pyx_t_13);
56531 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56532 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1774, __pyx_L1_error)
56533 1 : __Pyx_GOTREF(__pyx_t_12);
56534 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error)
56535 1 : __Pyx_GOTREF(__pyx_t_2);
56536 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56537 1 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1774, __pyx_L1_error)
56538 1 : __Pyx_GOTREF(__pyx_t_12);
56539 1 : __Pyx_GIVEREF(__pyx_t_2);
56540 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error);
56541 1 : __Pyx_INCREF(__pyx_slice__5);
56542 1 : __Pyx_GIVEREF(__pyx_slice__5);
56543 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__5)) __PYX_ERR(0, 1774, __pyx_L1_error);
56544 1 : __pyx_t_2 = 0;
56545 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error)
56546 1 : __Pyx_GOTREF(__pyx_t_2);
56547 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56548 1 : __pyx_t_12 = NULL;
56549 1 : __pyx_t_15 = 0;
56550 : #if CYTHON_UNPACK_METHODS
56551 1 : if (unlikely(PyMethod_Check(__pyx_t_13))) {
56552 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
56553 0 : if (likely(__pyx_t_12)) {
56554 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56555 0 : __Pyx_INCREF(__pyx_t_12);
56556 0 : __Pyx_INCREF(function);
56557 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56558 : __pyx_t_15 = 1;
56559 : }
56560 : }
56561 : #endif
56562 : {
56563 1 : PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_2};
56564 1 : __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
56565 1 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
56566 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56567 1 : if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1774, __pyx_L1_error)
56568 1 : __Pyx_GOTREF(__pyx_t_14);
56569 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56570 : }
56571 1 : __pyx_v_r = __pyx_t_14;
56572 1 : __pyx_t_14 = 0;
56573 :
56574 : /* "scipy/linalg/_decomp_interpolative.pyx":1775
56575 : * # idz_rinqr and idz_rearr
56576 : * r = np.triu(col[:krank, :])
56577 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
56578 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
56579 : *
56580 : */
56581 21 : for (__pyx_t_4 = (__pyx_v_krank - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
56582 20 : __pyx_v_ci = __pyx_t_4;
56583 :
56584 : /* "scipy/linalg/_decomp_interpolative.pyx":1776
56585 : * r = np.triu(col[:krank, :])
56586 : * for ci in range(krank-1, -1, -1):
56587 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]] # <<<<<<<<<<<<<<
56588 : *
56589 : * t = p.T.conj().copy()
56590 : */
56591 20 : __pyx_t_22 = __pyx_v_ci;
56592 20 : __pyx_t_14 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1776, __pyx_L1_error)
56593 20 : __Pyx_GOTREF(__pyx_t_14);
56594 20 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1776, __pyx_L1_error)
56595 20 : __Pyx_GOTREF(__pyx_t_13);
56596 20 : __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
56597 20 : __Pyx_GOTREF(__pyx_t_2);
56598 20 : __Pyx_GIVEREF(__pyx_t_14);
56599 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_14)) __PYX_ERR(0, 1776, __pyx_L1_error);
56600 20 : __Pyx_GIVEREF(__pyx_t_13);
56601 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_13)) __PYX_ERR(0, 1776, __pyx_L1_error);
56602 20 : __pyx_t_14 = 0;
56603 20 : __pyx_t_13 = 0;
56604 20 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1776, __pyx_L1_error)
56605 20 : __Pyx_GOTREF(__pyx_t_13);
56606 20 : __Pyx_INCREF(__pyx_slice__5);
56607 20 : __Pyx_GIVEREF(__pyx_slice__5);
56608 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice__5)) __PYX_ERR(0, 1776, __pyx_L1_error);
56609 20 : __Pyx_GIVEREF(__pyx_t_2);
56610 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error);
56611 20 : __pyx_t_2 = 0;
56612 20 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
56613 20 : __Pyx_GOTREF(__pyx_t_2);
56614 20 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56615 20 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1776, __pyx_L1_error)
56616 20 : __Pyx_GOTREF(__pyx_t_13);
56617 20 : __pyx_t_22 = __pyx_v_ci;
56618 20 : __pyx_t_14 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds1.diminfo[0].strides))); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1776, __pyx_L1_error)
56619 20 : __Pyx_GOTREF(__pyx_t_14);
56620 20 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1776, __pyx_L1_error)
56621 20 : __Pyx_GOTREF(__pyx_t_12);
56622 20 : __Pyx_GIVEREF(__pyx_t_13);
56623 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_13)) __PYX_ERR(0, 1776, __pyx_L1_error);
56624 20 : __Pyx_GIVEREF(__pyx_t_14);
56625 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_14)) __PYX_ERR(0, 1776, __pyx_L1_error);
56626 20 : __pyx_t_13 = 0;
56627 20 : __pyx_t_14 = 0;
56628 20 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1776, __pyx_L1_error)
56629 20 : __Pyx_GOTREF(__pyx_t_14);
56630 20 : __Pyx_INCREF(__pyx_slice__5);
56631 20 : __Pyx_GIVEREF(__pyx_slice__5);
56632 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_slice__5)) __PYX_ERR(0, 1776, __pyx_L1_error);
56633 20 : __Pyx_GIVEREF(__pyx_t_12);
56634 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12)) __PYX_ERR(0, 1776, __pyx_L1_error);
56635 20 : __pyx_t_12 = 0;
56636 20 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_14, __pyx_t_2) < 0))) __PYX_ERR(0, 1776, __pyx_L1_error)
56637 20 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56638 40 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56639 : }
56640 :
56641 : /* "scipy/linalg/_decomp_interpolative.pyx":1778
56642 : * r[:, [ci, inds1[ci]]] = r[:, [inds1[ci], ci]]
56643 : *
56644 : * t = p.T.conj().copy() # <<<<<<<<<<<<<<
56645 : * inds2, tau2 = idzr_qrpiv(t, krank)
56646 : * r2 = np.triu(t[:krank, :])
56647 : */
56648 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p), __pyx_n_s_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1778, __pyx_L1_error)
56649 1 : __Pyx_GOTREF(__pyx_t_12);
56650 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_conj); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1778, __pyx_L1_error)
56651 1 : __Pyx_GOTREF(__pyx_t_13);
56652 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56653 1 : __pyx_t_12 = NULL;
56654 1 : __pyx_t_15 = 0;
56655 : #if CYTHON_UNPACK_METHODS
56656 1 : if (likely(PyMethod_Check(__pyx_t_13))) {
56657 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
56658 0 : if (likely(__pyx_t_12)) {
56659 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56660 0 : __Pyx_INCREF(__pyx_t_12);
56661 0 : __Pyx_INCREF(function);
56662 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56663 : __pyx_t_15 = 1;
56664 : }
56665 : }
56666 : #endif
56667 : {
56668 1 : PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
56669 1 : __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
56670 1 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
56671 1 : if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1778, __pyx_L1_error)
56672 1 : __Pyx_GOTREF(__pyx_t_14);
56673 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56674 : }
56675 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1778, __pyx_L1_error)
56676 1 : __Pyx_GOTREF(__pyx_t_13);
56677 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56678 1 : __pyx_t_14 = NULL;
56679 1 : __pyx_t_15 = 0;
56680 : #if CYTHON_UNPACK_METHODS
56681 1 : if (likely(PyMethod_Check(__pyx_t_13))) {
56682 0 : __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
56683 0 : if (likely(__pyx_t_14)) {
56684 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56685 0 : __Pyx_INCREF(__pyx_t_14);
56686 0 : __Pyx_INCREF(function);
56687 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56688 : __pyx_t_15 = 1;
56689 : }
56690 : }
56691 : #endif
56692 : {
56693 1 : PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
56694 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
56695 1 : __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
56696 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
56697 1 : __Pyx_GOTREF(__pyx_t_2);
56698 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56699 : }
56700 1 : __pyx_v_t = __pyx_t_2;
56701 1 : __pyx_t_2 = 0;
56702 :
56703 : /* "scipy/linalg/_decomp_interpolative.pyx":1779
56704 : *
56705 : * t = p.T.conj().copy()
56706 : * inds2, tau2 = idzr_qrpiv(t, krank) # <<<<<<<<<<<<<<
56707 : * r2 = np.triu(t[:krank, :])
56708 : * for ci in range(krank-1, -1, -1):
56709 : */
56710 1 : __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1779, __pyx_L1_error)
56711 1 : __Pyx_GOTREF(__pyx_t_13);
56712 1 : __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1779, __pyx_L1_error)
56713 1 : __Pyx_GOTREF(__pyx_t_14);
56714 1 : __pyx_t_12 = NULL;
56715 1 : __pyx_t_15 = 0;
56716 : #if CYTHON_UNPACK_METHODS
56717 1 : if (unlikely(PyMethod_Check(__pyx_t_13))) {
56718 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
56719 0 : if (likely(__pyx_t_12)) {
56720 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56721 0 : __Pyx_INCREF(__pyx_t_12);
56722 0 : __Pyx_INCREF(function);
56723 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56724 : __pyx_t_15 = 1;
56725 : }
56726 : }
56727 : #endif
56728 : {
56729 1 : PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_t, __pyx_t_14};
56730 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 2+__pyx_t_15);
56731 1 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
56732 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56733 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error)
56734 1 : __Pyx_GOTREF(__pyx_t_2);
56735 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56736 : }
56737 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
56738 1 : PyObject* sequence = __pyx_t_2;
56739 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
56740 1 : if (unlikely(size != 2)) {
56741 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
56742 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
56743 0 : __PYX_ERR(0, 1779, __pyx_L1_error)
56744 : }
56745 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56746 1 : if (likely(PyTuple_CheckExact(sequence))) {
56747 1 : __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
56748 1 : __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1);
56749 : } else {
56750 0 : __pyx_t_13 = PyList_GET_ITEM(sequence, 0);
56751 0 : __pyx_t_14 = PyList_GET_ITEM(sequence, 1);
56752 : }
56753 1 : __Pyx_INCREF(__pyx_t_13);
56754 1 : __Pyx_INCREF(__pyx_t_14);
56755 : #else
56756 : __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1779, __pyx_L1_error)
56757 : __Pyx_GOTREF(__pyx_t_13);
56758 : __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1779, __pyx_L1_error)
56759 : __Pyx_GOTREF(__pyx_t_14);
56760 : #endif
56761 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56762 : } else {
56763 0 : Py_ssize_t index = -1;
56764 0 : __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1779, __pyx_L1_error)
56765 0 : __Pyx_GOTREF(__pyx_t_12);
56766 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56767 0 : __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
56768 0 : index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_13)) goto __pyx_L11_unpacking_failed;
56769 0 : __Pyx_GOTREF(__pyx_t_13);
56770 0 : index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_14)) goto __pyx_L11_unpacking_failed;
56771 0 : __Pyx_GOTREF(__pyx_t_14);
56772 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1779, __pyx_L1_error)
56773 0 : __pyx_t_16 = NULL;
56774 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56775 0 : goto __pyx_L12_unpacking_done;
56776 0 : __pyx_L11_unpacking_failed:;
56777 0 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56778 0 : __pyx_t_16 = NULL;
56779 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
56780 0 : __PYX_ERR(0, 1779, __pyx_L1_error)
56781 0 : __pyx_L12_unpacking_done:;
56782 : }
56783 1 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1779, __pyx_L1_error)
56784 1 : if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1779, __pyx_L1_error)
56785 1 : __pyx_t_27 = ((PyArrayObject *)__pyx_t_13);
56786 : {
56787 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56788 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
56789 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
56790 1 : if (unlikely(__pyx_t_4 < 0)) {
56791 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
56792 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds2, &__Pyx_TypeInfo_nn_npy_int64, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
56793 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
56794 : __Pyx_RaiseBufferFallbackError();
56795 : } else {
56796 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
56797 : }
56798 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
56799 : }
56800 1 : __pyx_pybuffernd_inds2.diminfo[0].strides = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds2.diminfo[0].shape = __pyx_pybuffernd_inds2.rcbuffer->pybuffer.shape[0];
56801 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1779, __pyx_L1_error)
56802 : }
56803 1 : __pyx_t_27 = 0;
56804 1 : __pyx_v_inds2 = ((PyArrayObject *)__pyx_t_13);
56805 1 : __pyx_t_13 = 0;
56806 1 : __pyx_t_28 = ((PyArrayObject *)__pyx_t_14);
56807 : {
56808 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
56809 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
56810 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
56811 1 : if (unlikely(__pyx_t_4 < 0)) {
56812 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
56813 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tau2, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
56814 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
56815 : __Pyx_RaiseBufferFallbackError();
56816 : } else {
56817 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
56818 : }
56819 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
56820 : }
56821 1 : __pyx_pybuffernd_tau2.diminfo[0].strides = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tau2.diminfo[0].shape = __pyx_pybuffernd_tau2.rcbuffer->pybuffer.shape[0];
56822 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1779, __pyx_L1_error)
56823 : }
56824 1 : __pyx_t_28 = 0;
56825 1 : __pyx_v_tau2 = ((PyArrayObject *)__pyx_t_14);
56826 1 : __pyx_t_14 = 0;
56827 :
56828 : /* "scipy/linalg/_decomp_interpolative.pyx":1780
56829 : * t = p.T.conj().copy()
56830 : * inds2, tau2 = idzr_qrpiv(t, krank)
56831 : * r2 = np.triu(t[:krank, :]) # <<<<<<<<<<<<<<
56832 : * for ci in range(krank-1, -1, -1):
56833 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
56834 : */
56835 1 : __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1780, __pyx_L1_error)
56836 1 : __Pyx_GOTREF(__pyx_t_14);
56837 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_triu); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1780, __pyx_L1_error)
56838 1 : __Pyx_GOTREF(__pyx_t_13);
56839 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56840 1 : __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1780, __pyx_L1_error)
56841 1 : __Pyx_GOTREF(__pyx_t_14);
56842 1 : __pyx_t_12 = PySlice_New(Py_None, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1780, __pyx_L1_error)
56843 1 : __Pyx_GOTREF(__pyx_t_12);
56844 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56845 1 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1780, __pyx_L1_error)
56846 1 : __Pyx_GOTREF(__pyx_t_14);
56847 1 : __Pyx_GIVEREF(__pyx_t_12);
56848 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12)) __PYX_ERR(0, 1780, __pyx_L1_error);
56849 1 : __Pyx_INCREF(__pyx_slice__5);
56850 1 : __Pyx_GIVEREF(__pyx_slice__5);
56851 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_slice__5)) __PYX_ERR(0, 1780, __pyx_L1_error);
56852 1 : __pyx_t_12 = 0;
56853 1 : __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1780, __pyx_L1_error)
56854 1 : __Pyx_GOTREF(__pyx_t_12);
56855 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56856 1 : __pyx_t_14 = NULL;
56857 1 : __pyx_t_15 = 0;
56858 : #if CYTHON_UNPACK_METHODS
56859 1 : if (unlikely(PyMethod_Check(__pyx_t_13))) {
56860 0 : __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
56861 0 : if (likely(__pyx_t_14)) {
56862 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
56863 0 : __Pyx_INCREF(__pyx_t_14);
56864 0 : __Pyx_INCREF(function);
56865 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
56866 : __pyx_t_15 = 1;
56867 : }
56868 : }
56869 : #endif
56870 : {
56871 1 : PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_12};
56872 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_15, 1+__pyx_t_15);
56873 1 : __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
56874 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56875 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
56876 1 : __Pyx_GOTREF(__pyx_t_2);
56877 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56878 : }
56879 1 : __pyx_v_r2 = __pyx_t_2;
56880 1 : __pyx_t_2 = 0;
56881 :
56882 : /* "scipy/linalg/_decomp_interpolative.pyx":1781
56883 : * inds2, tau2 = idzr_qrpiv(t, krank)
56884 : * r2 = np.triu(t[:krank, :])
56885 : * for ci in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
56886 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
56887 : *
56888 : */
56889 21 : for (__pyx_t_4 = (__pyx_v_krank - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
56890 20 : __pyx_v_ci = __pyx_t_4;
56891 :
56892 : /* "scipy/linalg/_decomp_interpolative.pyx":1782
56893 : * r2 = np.triu(t[:krank, :])
56894 : * for ci in range(krank-1, -1, -1):
56895 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]] # <<<<<<<<<<<<<<
56896 : *
56897 : * r3 = r @ r2.T.conj()
56898 : */
56899 20 : __pyx_t_22 = __pyx_v_ci;
56900 20 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error)
56901 20 : __Pyx_GOTREF(__pyx_t_2);
56902 20 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1782, __pyx_L1_error)
56903 20 : __Pyx_GOTREF(__pyx_t_13);
56904 20 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1782, __pyx_L1_error)
56905 20 : __Pyx_GOTREF(__pyx_t_12);
56906 20 : __Pyx_GIVEREF(__pyx_t_2);
56907 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error);
56908 20 : __Pyx_GIVEREF(__pyx_t_13);
56909 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1782, __pyx_L1_error);
56910 20 : __pyx_t_2 = 0;
56911 20 : __pyx_t_13 = 0;
56912 20 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1782, __pyx_L1_error)
56913 20 : __Pyx_GOTREF(__pyx_t_13);
56914 20 : __Pyx_INCREF(__pyx_slice__5);
56915 20 : __Pyx_GIVEREF(__pyx_slice__5);
56916 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice__5)) __PYX_ERR(0, 1782, __pyx_L1_error);
56917 20 : __Pyx_GIVEREF(__pyx_t_12);
56918 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1782, __pyx_L1_error);
56919 20 : __pyx_t_12 = 0;
56920 20 : __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_r2, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1782, __pyx_L1_error)
56921 20 : __Pyx_GOTREF(__pyx_t_12);
56922 20 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
56923 20 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ci); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1782, __pyx_L1_error)
56924 20 : __Pyx_GOTREF(__pyx_t_13);
56925 20 : __pyx_t_22 = __pyx_v_ci;
56926 20 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrStrided1d(npy_int64 *, __pyx_pybuffernd_inds2.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_inds2.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error)
56927 20 : __Pyx_GOTREF(__pyx_t_2);
56928 20 : __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1782, __pyx_L1_error)
56929 20 : __Pyx_GOTREF(__pyx_t_14);
56930 20 : __Pyx_GIVEREF(__pyx_t_13);
56931 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_13)) __PYX_ERR(0, 1782, __pyx_L1_error);
56932 20 : __Pyx_GIVEREF(__pyx_t_2);
56933 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error);
56934 20 : __pyx_t_13 = 0;
56935 20 : __pyx_t_2 = 0;
56936 20 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error)
56937 20 : __Pyx_GOTREF(__pyx_t_2);
56938 20 : __Pyx_INCREF(__pyx_slice__5);
56939 20 : __Pyx_GIVEREF(__pyx_slice__5);
56940 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1782, __pyx_L1_error);
56941 20 : __Pyx_GIVEREF(__pyx_t_14);
56942 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_14)) __PYX_ERR(0, 1782, __pyx_L1_error);
56943 20 : __pyx_t_14 = 0;
56944 20 : if (unlikely((PyObject_SetItem(__pyx_v_r2, __pyx_t_2, __pyx_t_12) < 0))) __PYX_ERR(0, 1782, __pyx_L1_error)
56945 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56946 40 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56947 : }
56948 :
56949 : /* "scipy/linalg/_decomp_interpolative.pyx":1784
56950 : * r2[:, [ci, inds2[ci]]] = r2[:, [inds2[ci], ci]]
56951 : *
56952 : * r3 = r @ r2.T.conj() # <<<<<<<<<<<<<<
56953 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False)
56954 : *
56955 : */
56956 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r2, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error)
56957 1 : __Pyx_GOTREF(__pyx_t_2);
56958 1 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1784, __pyx_L1_error)
56959 1 : __Pyx_GOTREF(__pyx_t_14);
56960 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56961 1 : __pyx_t_2 = NULL;
56962 1 : __pyx_t_15 = 0;
56963 : #if CYTHON_UNPACK_METHODS
56964 1 : if (likely(PyMethod_Check(__pyx_t_14))) {
56965 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
56966 0 : if (likely(__pyx_t_2)) {
56967 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
56968 0 : __Pyx_INCREF(__pyx_t_2);
56969 0 : __Pyx_INCREF(function);
56970 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
56971 : __pyx_t_15 = 1;
56972 : }
56973 : }
56974 : #endif
56975 : {
56976 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
56977 1 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
56978 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
56979 1 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1784, __pyx_L1_error)
56980 1 : __Pyx_GOTREF(__pyx_t_12);
56981 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
56982 : }
56983 1 : __pyx_t_14 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_r, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1784, __pyx_L1_error)
56984 1 : __Pyx_GOTREF(__pyx_t_14);
56985 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
56986 1 : __pyx_v_r3 = __pyx_t_14;
56987 1 : __pyx_t_14 = 0;
56988 :
56989 : /* "scipy/linalg/_decomp_interpolative.pyx":1785
56990 : *
56991 : * r3 = r @ r2.T.conj()
56992 : * UU[:krank, :krank], S, V = la.svd(r3, full_matrices=False) # <<<<<<<<<<<<<<
56993 : *
56994 : * # Apply Q of col to U from the left
56995 : */
56996 1 : __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_la); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1785, __pyx_L1_error)
56997 1 : __Pyx_GOTREF(__pyx_t_14);
56998 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_svd); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1785, __pyx_L1_error)
56999 1 : __Pyx_GOTREF(__pyx_t_12);
57000 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57001 1 : __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1785, __pyx_L1_error)
57002 1 : __Pyx_GOTREF(__pyx_t_14);
57003 1 : __Pyx_INCREF(__pyx_v_r3);
57004 1 : __Pyx_GIVEREF(__pyx_v_r3);
57005 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_r3)) __PYX_ERR(0, 1785, __pyx_L1_error);
57006 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1785, __pyx_L1_error)
57007 1 : __Pyx_GOTREF(__pyx_t_2);
57008 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1785, __pyx_L1_error)
57009 1 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1785, __pyx_L1_error)
57010 1 : __Pyx_GOTREF(__pyx_t_13);
57011 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57012 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57013 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57014 1 : if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
57015 1 : PyObject* sequence = __pyx_t_13;
57016 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
57017 1 : if (unlikely(size != 3)) {
57018 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
57019 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
57020 0 : __PYX_ERR(0, 1785, __pyx_L1_error)
57021 : }
57022 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
57023 1 : if (likely(PyTuple_CheckExact(sequence))) {
57024 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
57025 1 : __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1);
57026 1 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
57027 : } else {
57028 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
57029 0 : __pyx_t_14 = PyList_GET_ITEM(sequence, 1);
57030 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 2);
57031 : }
57032 1 : __Pyx_INCREF(__pyx_t_2);
57033 1 : __Pyx_INCREF(__pyx_t_14);
57034 1 : __Pyx_INCREF(__pyx_t_12);
57035 : #else
57036 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1785, __pyx_L1_error)
57037 : __Pyx_GOTREF(__pyx_t_2);
57038 : __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1785, __pyx_L1_error)
57039 : __Pyx_GOTREF(__pyx_t_14);
57040 : __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1785, __pyx_L1_error)
57041 : __Pyx_GOTREF(__pyx_t_12);
57042 : #endif
57043 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57044 : } else {
57045 0 : Py_ssize_t index = -1;
57046 0 : __pyx_t_29 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1785, __pyx_L1_error)
57047 0 : __Pyx_GOTREF(__pyx_t_29);
57048 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57049 0 : __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_29);
57050 0 : index = 0; __pyx_t_2 = __pyx_t_16(__pyx_t_29); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
57051 0 : __Pyx_GOTREF(__pyx_t_2);
57052 0 : index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_29); if (unlikely(!__pyx_t_14)) goto __pyx_L15_unpacking_failed;
57053 0 : __Pyx_GOTREF(__pyx_t_14);
57054 0 : index = 2; __pyx_t_12 = __pyx_t_16(__pyx_t_29); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed;
57055 0 : __Pyx_GOTREF(__pyx_t_12);
57056 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_29), 3) < 0) __PYX_ERR(0, 1785, __pyx_L1_error)
57057 0 : __pyx_t_16 = NULL;
57058 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
57059 0 : goto __pyx_L16_unpacking_done;
57060 0 : __pyx_L15_unpacking_failed:;
57061 0 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
57062 0 : __pyx_t_16 = NULL;
57063 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
57064 0 : __PYX_ERR(0, 1785, __pyx_L1_error)
57065 0 : __pyx_L16_unpacking_done:;
57066 : }
57067 1 : if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1785, __pyx_L1_error)
57068 1 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1785, __pyx_L1_error)
57069 1 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1785, __pyx_L1_error)
57070 1 : __Pyx_GOTREF(__pyx_t_29);
57071 1 : __pyx_t_30 = PySlice_New(Py_None, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 1785, __pyx_L1_error)
57072 1 : __Pyx_GOTREF(__pyx_t_30);
57073 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
57074 1 : __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1785, __pyx_L1_error)
57075 1 : __Pyx_GOTREF(__pyx_t_29);
57076 1 : __pyx_t_31 = PySlice_New(Py_None, __pyx_t_29, Py_None); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 1785, __pyx_L1_error)
57077 1 : __Pyx_GOTREF(__pyx_t_31);
57078 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
57079 1 : __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 1785, __pyx_L1_error)
57080 1 : __Pyx_GOTREF(__pyx_t_29);
57081 1 : __Pyx_GIVEREF(__pyx_t_30);
57082 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_30)) __PYX_ERR(0, 1785, __pyx_L1_error);
57083 1 : __Pyx_GIVEREF(__pyx_t_31);
57084 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_31)) __PYX_ERR(0, 1785, __pyx_L1_error);
57085 1 : __pyx_t_30 = 0;
57086 1 : __pyx_t_31 = 0;
57087 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_29, __pyx_t_2) < 0))) __PYX_ERR(0, 1785, __pyx_L1_error)
57088 1 : __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
57089 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57090 1 : __pyx_t_32 = ((PyArrayObject *)__pyx_t_14);
57091 : {
57092 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57093 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
57094 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
57095 1 : if (unlikely(__pyx_t_4 < 0)) {
57096 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
57097 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
57098 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
57099 : __Pyx_RaiseBufferFallbackError();
57100 : } else {
57101 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
57102 : }
57103 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
57104 : }
57105 1 : __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
57106 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1785, __pyx_L1_error)
57107 : }
57108 1 : __pyx_t_32 = 0;
57109 1 : __pyx_v_S = ((PyArrayObject *)__pyx_t_14);
57110 1 : __pyx_t_14 = 0;
57111 1 : __pyx_t_33 = ((PyArrayObject *)__pyx_t_12);
57112 : {
57113 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57114 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
57115 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
57116 1 : if (unlikely(__pyx_t_4 < 0)) {
57117 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
57118 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V.rcbuffer->pybuffer, (PyObject*)__pyx_v_V, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
57119 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
57120 : __Pyx_RaiseBufferFallbackError();
57121 : } else {
57122 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
57123 : }
57124 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
57125 : }
57126 1 : __pyx_pybuffernd_V.diminfo[0].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V.diminfo[0].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V.diminfo[1].strides = __pyx_pybuffernd_V.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V.diminfo[1].shape = __pyx_pybuffernd_V.rcbuffer->pybuffer.shape[1];
57127 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1785, __pyx_L1_error)
57128 : }
57129 1 : __pyx_t_33 = 0;
57130 1 : __pyx_v_V = ((PyArrayObject *)__pyx_t_12);
57131 1 : __pyx_t_12 = 0;
57132 :
57133 : /* "scipy/linalg/_decomp_interpolative.pyx":1789
57134 : * # Apply Q of col to U from the left
57135 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
57136 : * np.conjugate(tau1, out=tau1) # <<<<<<<<<<<<<<
57137 : * C = col[:, :krank].conj().copy(order='F')
57138 : * zunm2r(<char*>'R', <char*>'C',
57139 : */
57140 1 : __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1789, __pyx_L1_error)
57141 1 : __Pyx_GOTREF(__pyx_t_13);
57142 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1789, __pyx_L1_error)
57143 1 : __Pyx_GOTREF(__pyx_t_12);
57144 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57145 1 : __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1789, __pyx_L1_error)
57146 1 : __Pyx_GOTREF(__pyx_t_13);
57147 1 : __Pyx_INCREF((PyObject *)__pyx_v_tau1);
57148 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau1);
57149 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_tau1))) __PYX_ERR(0, 1789, __pyx_L1_error);
57150 1 : __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1789, __pyx_L1_error)
57151 1 : __Pyx_GOTREF(__pyx_t_14);
57152 1 : if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_out, ((PyObject *)__pyx_v_tau1)) < 0) __PYX_ERR(0, 1789, __pyx_L1_error)
57153 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error)
57154 1 : __Pyx_GOTREF(__pyx_t_2);
57155 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57156 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57157 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57158 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57159 :
57160 : /* "scipy/linalg/_decomp_interpolative.pyx":1790
57161 : * # But do the adjoint dance for LAPACK via U.H @ Q.H
57162 : * np.conjugate(tau1, out=tau1)
57163 : * C = col[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
57164 : * zunm2r(<char*>'R', <char*>'C',
57165 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
57166 : */
57167 1 : __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1790, __pyx_L1_error)
57168 1 : __Pyx_GOTREF(__pyx_t_14);
57169 1 : __pyx_t_13 = PySlice_New(Py_None, __pyx_t_14, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1790, __pyx_L1_error)
57170 1 : __Pyx_GOTREF(__pyx_t_13);
57171 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57172 1 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1790, __pyx_L1_error)
57173 1 : __Pyx_GOTREF(__pyx_t_14);
57174 1 : __Pyx_INCREF(__pyx_slice__5);
57175 1 : __Pyx_GIVEREF(__pyx_slice__5);
57176 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_slice__5)) __PYX_ERR(0, 1790, __pyx_L1_error);
57177 1 : __Pyx_GIVEREF(__pyx_t_13);
57178 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13)) __PYX_ERR(0, 1790, __pyx_L1_error);
57179 1 : __pyx_t_13 = 0;
57180 1 : __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col), __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1790, __pyx_L1_error)
57181 1 : __Pyx_GOTREF(__pyx_t_13);
57182 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57183 1 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_conj); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1790, __pyx_L1_error)
57184 1 : __Pyx_GOTREF(__pyx_t_14);
57185 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57186 1 : __pyx_t_13 = NULL;
57187 1 : __pyx_t_15 = 0;
57188 : #if CYTHON_UNPACK_METHODS
57189 1 : if (likely(PyMethod_Check(__pyx_t_14))) {
57190 0 : __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
57191 0 : if (likely(__pyx_t_13)) {
57192 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
57193 0 : __Pyx_INCREF(__pyx_t_13);
57194 0 : __Pyx_INCREF(function);
57195 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
57196 : __pyx_t_15 = 1;
57197 : }
57198 : }
57199 : #endif
57200 : {
57201 1 : PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
57202 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
57203 1 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
57204 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __pyx_L1_error)
57205 1 : __Pyx_GOTREF(__pyx_t_2);
57206 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57207 : }
57208 1 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1790, __pyx_L1_error)
57209 1 : __Pyx_GOTREF(__pyx_t_14);
57210 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57211 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __pyx_L1_error)
57212 1 : __Pyx_GOTREF(__pyx_t_2);
57213 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1790, __pyx_L1_error)
57214 1 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1790, __pyx_L1_error)
57215 1 : __Pyx_GOTREF(__pyx_t_13);
57216 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57217 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57218 1 : if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1790, __pyx_L1_error)
57219 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_13);
57220 : {
57221 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57222 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
57223 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
57224 1 : if (unlikely(__pyx_t_4 < 0)) {
57225 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
57226 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
57227 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
57228 : __Pyx_RaiseBufferFallbackError();
57229 : } else {
57230 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
57231 : }
57232 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
57233 : }
57234 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
57235 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1790, __pyx_L1_error)
57236 : }
57237 1 : __pyx_t_34 = 0;
57238 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_13);
57239 1 : __pyx_t_13 = 0;
57240 :
57241 : /* "scipy/linalg/_decomp_interpolative.pyx":1792
57242 : * C = col[:, :krank].conj().copy(order='F')
57243 : * zunm2r(<char*>'R', <char*>'C',
57244 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0], # <<<<<<<<<<<<<<
57245 : * &UU[0,0], &krank, &a[0, 0], &info)
57246 : *
57247 : */
57248 1 : __pyx_t_22 = 0;
57249 1 : __pyx_t_23 = 0;
57250 1 : __pyx_t_35 = 0;
57251 :
57252 : /* "scipy/linalg/_decomp_interpolative.pyx":1793
57253 : * zunm2r(<char*>'R', <char*>'C',
57254 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
57255 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
57256 : *
57257 : * VV[:krank, :krank] = V[:, :].conj().T
57258 : */
57259 1 : __pyx_t_36 = 0;
57260 1 : __pyx_t_37 = 0;
57261 1 : __pyx_t_38 = 0;
57262 1 : __pyx_t_39 = 0;
57263 :
57264 : /* "scipy/linalg/_decomp_interpolative.pyx":1791
57265 : * np.conjugate(tau1, out=tau1)
57266 : * C = col[:, :krank].conj().copy(order='F')
57267 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
57268 : * &krank, &m, &krank, &C[0, 0], &m, &tau1[0],
57269 : * &UU[0,0], &krank, &a[0, 0], &info)
57270 : */
57271 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau1.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_tau1.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
57272 :
57273 : /* "scipy/linalg/_decomp_interpolative.pyx":1795
57274 : * &UU[0,0], &krank, &a[0, 0], &info)
57275 : *
57276 : * VV[:krank, :krank] = V[:, :].conj().T # <<<<<<<<<<<<<<
57277 : *
57278 : * # Apply Q of t to V from the left
57279 : */
57280 1 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_V), __pyx_tuple__14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error)
57281 1 : __Pyx_GOTREF(__pyx_t_2);
57282 1 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_conj); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1795, __pyx_L1_error)
57283 1 : __Pyx_GOTREF(__pyx_t_14);
57284 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57285 1 : __pyx_t_2 = NULL;
57286 1 : __pyx_t_15 = 0;
57287 : #if CYTHON_UNPACK_METHODS
57288 1 : if (likely(PyMethod_Check(__pyx_t_14))) {
57289 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
57290 0 : if (likely(__pyx_t_2)) {
57291 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
57292 0 : __Pyx_INCREF(__pyx_t_2);
57293 0 : __Pyx_INCREF(function);
57294 0 : __Pyx_DECREF_SET(__pyx_t_14, function);
57295 : __pyx_t_15 = 1;
57296 : }
57297 : }
57298 : #endif
57299 : {
57300 1 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
57301 1 : __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
57302 1 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
57303 1 : if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1795, __pyx_L1_error)
57304 1 : __Pyx_GOTREF(__pyx_t_13);
57305 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57306 : }
57307 1 : __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1795, __pyx_L1_error)
57308 1 : __Pyx_GOTREF(__pyx_t_14);
57309 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57310 1 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1795, __pyx_L1_error)
57311 1 : __Pyx_GOTREF(__pyx_t_13);
57312 1 : __pyx_t_2 = PySlice_New(Py_None, __pyx_t_13, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error)
57313 1 : __Pyx_GOTREF(__pyx_t_2);
57314 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57315 1 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1795, __pyx_L1_error)
57316 1 : __Pyx_GOTREF(__pyx_t_13);
57317 1 : __pyx_t_12 = PySlice_New(Py_None, __pyx_t_13, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1795, __pyx_L1_error)
57318 1 : __Pyx_GOTREF(__pyx_t_12);
57319 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57320 1 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1795, __pyx_L1_error)
57321 1 : __Pyx_GOTREF(__pyx_t_13);
57322 1 : __Pyx_GIVEREF(__pyx_t_2);
57323 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error);
57324 1 : __Pyx_GIVEREF(__pyx_t_12);
57325 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1795, __pyx_L1_error);
57326 1 : __pyx_t_2 = 0;
57327 1 : __pyx_t_12 = 0;
57328 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_VV), __pyx_t_13, __pyx_t_14) < 0))) __PYX_ERR(0, 1795, __pyx_L1_error)
57329 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57330 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57331 :
57332 : /* "scipy/linalg/_decomp_interpolative.pyx":1799
57333 : * # Apply Q of t to V from the left
57334 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
57335 : * np.conjugate(tau2, out=tau2) # <<<<<<<<<<<<<<
57336 : * C = t[:, :krank].conj().copy(order='F')
57337 : * zunm2r(<char*>'R', <char*>'C',
57338 : */
57339 1 : __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1799, __pyx_L1_error)
57340 1 : __Pyx_GOTREF(__pyx_t_14);
57341 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1799, __pyx_L1_error)
57342 1 : __Pyx_GOTREF(__pyx_t_13);
57343 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57344 1 : __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1799, __pyx_L1_error)
57345 1 : __Pyx_GOTREF(__pyx_t_14);
57346 1 : __Pyx_INCREF((PyObject *)__pyx_v_tau2);
57347 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_tau2);
57348 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_tau2))) __PYX_ERR(0, 1799, __pyx_L1_error);
57349 1 : __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1799, __pyx_L1_error)
57350 1 : __Pyx_GOTREF(__pyx_t_12);
57351 1 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_out, ((PyObject *)__pyx_v_tau2)) < 0) __PYX_ERR(0, 1799, __pyx_L1_error)
57352 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
57353 1 : __Pyx_GOTREF(__pyx_t_2);
57354 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
57355 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57356 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57357 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57358 :
57359 : /* "scipy/linalg/_decomp_interpolative.pyx":1800
57360 : * # But do the adjoint dance for LAPACK via V.H @ Q.H
57361 : * np.conjugate(tau2, out=tau2)
57362 : * C = t[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
57363 : * zunm2r(<char*>'R', <char*>'C',
57364 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
57365 : */
57366 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L1_error)
57367 1 : __Pyx_GOTREF(__pyx_t_12);
57368 1 : __pyx_t_14 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1800, __pyx_L1_error)
57369 1 : __Pyx_GOTREF(__pyx_t_14);
57370 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57371 1 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L1_error)
57372 1 : __Pyx_GOTREF(__pyx_t_12);
57373 1 : __Pyx_INCREF(__pyx_slice__5);
57374 1 : __Pyx_GIVEREF(__pyx_slice__5);
57375 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__5)) __PYX_ERR(0, 1800, __pyx_L1_error);
57376 1 : __Pyx_GIVEREF(__pyx_t_14);
57377 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14)) __PYX_ERR(0, 1800, __pyx_L1_error);
57378 1 : __pyx_t_14 = 0;
57379 1 : __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_v_t, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1800, __pyx_L1_error)
57380 1 : __Pyx_GOTREF(__pyx_t_14);
57381 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57382 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_conj); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L1_error)
57383 1 : __Pyx_GOTREF(__pyx_t_12);
57384 1 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
57385 1 : __pyx_t_14 = NULL;
57386 1 : __pyx_t_15 = 0;
57387 : #if CYTHON_UNPACK_METHODS
57388 1 : if (likely(PyMethod_Check(__pyx_t_12))) {
57389 0 : __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
57390 0 : if (likely(__pyx_t_14)) {
57391 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
57392 0 : __Pyx_INCREF(__pyx_t_14);
57393 0 : __Pyx_INCREF(function);
57394 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
57395 : __pyx_t_15 = 1;
57396 : }
57397 : }
57398 : #endif
57399 : {
57400 1 : PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
57401 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
57402 1 : __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
57403 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
57404 1 : __Pyx_GOTREF(__pyx_t_2);
57405 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57406 : }
57407 1 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1800, __pyx_L1_error)
57408 1 : __Pyx_GOTREF(__pyx_t_12);
57409 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57410 1 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error)
57411 1 : __Pyx_GOTREF(__pyx_t_2);
57412 1 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1800, __pyx_L1_error)
57413 1 : __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1800, __pyx_L1_error)
57414 1 : __Pyx_GOTREF(__pyx_t_14);
57415 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
57416 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57417 1 : if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1800, __pyx_L1_error)
57418 1 : __pyx_t_34 = ((PyArrayObject *)__pyx_t_14);
57419 : {
57420 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57421 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
57422 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
57423 1 : if (unlikely(__pyx_t_4 < 0)) {
57424 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
57425 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
57426 0 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
57427 0 : __Pyx_RaiseBufferFallbackError();
57428 : } else {
57429 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
57430 : }
57431 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
57432 : }
57433 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
57434 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1800, __pyx_L1_error)
57435 : }
57436 1 : __pyx_t_34 = 0;
57437 1 : __Pyx_DECREF_SET(__pyx_v_C, ((PyArrayObject *)__pyx_t_14));
57438 1 : __pyx_t_14 = 0;
57439 :
57440 : /* "scipy/linalg/_decomp_interpolative.pyx":1802
57441 : * C = t[:, :krank].conj().copy(order='F')
57442 : * zunm2r(<char*>'R', <char*>'C',
57443 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0], # <<<<<<<<<<<<<<
57444 : * &VV[0, 0], &krank, &a[0, 0], &info)
57445 : *
57446 : */
57447 1 : __pyx_t_39 = 0;
57448 1 : __pyx_t_38 = 0;
57449 1 : __pyx_t_37 = 0;
57450 :
57451 : /* "scipy/linalg/_decomp_interpolative.pyx":1803
57452 : * zunm2r(<char*>'R', <char*>'C',
57453 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
57454 : * &VV[0, 0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
57455 : *
57456 : * return UU, S, VV
57457 : */
57458 1 : __pyx_t_36 = 0;
57459 1 : __pyx_t_35 = 0;
57460 1 : __pyx_t_23 = 0;
57461 1 : __pyx_t_22 = 0;
57462 :
57463 : /* "scipy/linalg/_decomp_interpolative.pyx":1801
57464 : * np.conjugate(tau2, out=tau2)
57465 : * C = t[:, :krank].conj().copy(order='F')
57466 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
57467 : * &krank, &n, &krank, &C[0, 0], &n, &tau2[0],
57468 : * &VV[0, 0], &krank, &a[0, 0], &info)
57469 : */
57470 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_n), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_tau2.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_tau2.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_VV.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_VV.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_VV.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
57471 :
57472 : /* "scipy/linalg/_decomp_interpolative.pyx":1805
57473 : * &VV[0, 0], &krank, &a[0, 0], &info)
57474 : *
57475 : * return UU, S, VV # <<<<<<<<<<<<<<
57476 : *
57477 : *
57478 : */
57479 1 : __Pyx_XDECREF(__pyx_r);
57480 1 : __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1805, __pyx_L1_error)
57481 1 : __Pyx_GOTREF(__pyx_t_14);
57482 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
57483 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
57484 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1805, __pyx_L1_error);
57485 1 : __Pyx_INCREF((PyObject *)__pyx_v_S);
57486 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_S);
57487 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_v_S))) __PYX_ERR(0, 1805, __pyx_L1_error);
57488 1 : __Pyx_INCREF((PyObject *)__pyx_v_VV);
57489 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_VV);
57490 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, ((PyObject *)__pyx_v_VV))) __PYX_ERR(0, 1805, __pyx_L1_error);
57491 1 : __pyx_r = __pyx_t_14;
57492 1 : __pyx_t_14 = 0;
57493 1 : goto __pyx_L0;
57494 :
57495 : /* "scipy/linalg/_decomp_interpolative.pyx":1744
57496 : *
57497 : *
57498 : * def idzr_asvd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank, *, rng): # <<<<<<<<<<<<<<
57499 : * cdef int m = a.shape[0], n = a.shape[1]
57500 : * cdef int info, ci
57501 : */
57502 :
57503 : /* function exit code */
57504 0 : __pyx_L1_error:;
57505 0 : __Pyx_XDECREF(__pyx_t_2);
57506 0 : __Pyx_XDECREF(__pyx_t_12);
57507 0 : __Pyx_XDECREF(__pyx_t_13);
57508 0 : __Pyx_XDECREF(__pyx_t_14);
57509 0 : __Pyx_XDECREF(__pyx_t_29);
57510 0 : __Pyx_XDECREF(__pyx_t_30);
57511 0 : __Pyx_XDECREF(__pyx_t_31);
57512 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
57513 0 : __Pyx_PyThreadState_declare
57514 0 : __Pyx_PyThreadState_assign
57515 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
57516 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
57517 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
57518 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
57519 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
57520 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
57521 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
57522 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
57523 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
57524 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
57525 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
57526 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
57527 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
57528 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
57529 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
57530 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
57531 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_asvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
57532 0 : __pyx_r = NULL;
57533 0 : goto __pyx_L2;
57534 1 : __pyx_L0:;
57535 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
57536 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
57537 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
57538 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V.rcbuffer->pybuffer);
57539 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_VV.rcbuffer->pybuffer);
57540 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
57541 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
57542 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds1.rcbuffer->pybuffer);
57543 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds2.rcbuffer->pybuffer);
57544 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p.rcbuffer->pybuffer);
57545 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
57546 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
57547 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau1.rcbuffer->pybuffer);
57548 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tau2.rcbuffer->pybuffer);
57549 1 : __pyx_L2:;
57550 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
57551 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau1);
57552 1 : __Pyx_XDECREF((PyObject *)__pyx_v_tau2);
57553 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
57554 1 : __Pyx_XDECREF((PyObject *)__pyx_v_S);
57555 1 : __Pyx_XDECREF((PyObject *)__pyx_v_V);
57556 1 : __Pyx_XDECREF((PyObject *)__pyx_v_VV);
57557 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
57558 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
57559 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds1);
57560 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds2);
57561 1 : __Pyx_XDECREF((PyObject *)__pyx_v_p);
57562 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
57563 1 : __Pyx_XDECREF(__pyx_v_r);
57564 1 : __Pyx_XDECREF(__pyx_v_t);
57565 1 : __Pyx_XDECREF(__pyx_v_r2);
57566 1 : __Pyx_XDECREF(__pyx_v_r3);
57567 1 : __Pyx_XGIVEREF(__pyx_r);
57568 1 : __Pyx_RefNannyFinishContext();
57569 1 : return __pyx_r;
57570 : }
57571 :
57572 : /* "scipy/linalg/_decomp_interpolative.pyx":1808
57573 : *
57574 : *
57575 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
57576 : * cdef int n = a.shape[1], tmp_int, p
57577 : * cdef double complex one = 1.0
57578 : */
57579 :
57580 : /* Python wrapper */
57581 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_71idzr_id(PyObject *__pyx_self,
57582 : #if CYTHON_METH_FASTCALL
57583 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
57584 : #else
57585 : PyObject *__pyx_args, PyObject *__pyx_kwds
57586 : #endif
57587 : ); /*proto*/
57588 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_71idzr_id = {"idzr_id", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_71idzr_id, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
57589 9 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_71idzr_id(PyObject *__pyx_self,
57590 : #if CYTHON_METH_FASTCALL
57591 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
57592 : #else
57593 : PyObject *__pyx_args, PyObject *__pyx_kwds
57594 : #endif
57595 : ) {
57596 9 : PyArrayObject *__pyx_v_a = 0;
57597 9 : int __pyx_v_krank;
57598 : #if !CYTHON_METH_FASTCALL
57599 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
57600 : #endif
57601 9 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
57602 9 : PyObject* values[2] = {0,0};
57603 9 : int __pyx_lineno = 0;
57604 9 : const char *__pyx_filename = NULL;
57605 9 : int __pyx_clineno = 0;
57606 9 : PyObject *__pyx_r = 0;
57607 : __Pyx_RefNannyDeclarations
57608 9 : __Pyx_RefNannySetupContext("idzr_id (wrapper)", 0);
57609 : #if !CYTHON_METH_FASTCALL
57610 : #if CYTHON_ASSUME_SAFE_MACROS
57611 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
57612 : #else
57613 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
57614 : #endif
57615 : #endif
57616 9 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
57617 : {
57618 9 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
57619 9 : if (__pyx_kwds) {
57620 2 : Py_ssize_t kw_args;
57621 2 : switch (__pyx_nargs) {
57622 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
57623 0 : CYTHON_FALLTHROUGH;
57624 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
57625 2 : CYTHON_FALLTHROUGH;
57626 2 : case 0: break;
57627 0 : default: goto __pyx_L5_argtuple_error;
57628 : }
57629 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
57630 0 : switch (__pyx_nargs) {
57631 : case 0:
57632 2 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
57633 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
57634 2 : kw_args--;
57635 : }
57636 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
57637 0 : else goto __pyx_L5_argtuple_error;
57638 2 : CYTHON_FALLTHROUGH;
57639 : case 1:
57640 2 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
57641 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
57642 2 : kw_args--;
57643 : }
57644 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
57645 : else {
57646 0 : __Pyx_RaiseArgtupleInvalid("idzr_id", 1, 2, 2, 1); __PYX_ERR(0, 1808, __pyx_L3_error)
57647 : }
57648 : }
57649 2 : if (unlikely(kw_args > 0)) {
57650 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
57651 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_id") < 0)) __PYX_ERR(0, 1808, __pyx_L3_error)
57652 : }
57653 7 : } else if (unlikely(__pyx_nargs != 2)) {
57654 0 : goto __pyx_L5_argtuple_error;
57655 : } else {
57656 7 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
57657 7 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
57658 : }
57659 9 : __pyx_v_a = ((PyArrayObject *)values[0]);
57660 9 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L3_error)
57661 : }
57662 9 : goto __pyx_L6_skip;
57663 0 : __pyx_L5_argtuple_error:;
57664 0 : __Pyx_RaiseArgtupleInvalid("idzr_id", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1808, __pyx_L3_error)
57665 9 : __pyx_L6_skip:;
57666 9 : goto __pyx_L4_argument_unpacking_done;
57667 0 : __pyx_L3_error:;
57668 : {
57669 0 : Py_ssize_t __pyx_temp;
57670 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
57671 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
57672 : }
57673 : }
57674 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
57675 0 : __Pyx_RefNannyFinishContext();
57676 0 : return NULL;
57677 9 : __pyx_L4_argument_unpacking_done:;
57678 9 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1808, __pyx_L1_error)
57679 9 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_70idzr_id(__pyx_self, __pyx_v_a, __pyx_v_krank);
57680 :
57681 : /* function exit code */
57682 9 : goto __pyx_L0;
57683 0 : __pyx_L1_error:;
57684 0 : __pyx_r = NULL;
57685 9 : __pyx_L0:;
57686 : {
57687 9 : Py_ssize_t __pyx_temp;
57688 9 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
57689 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
57690 : }
57691 : }
57692 : __Pyx_RefNannyFinishContext();
57693 : return __pyx_r;
57694 : }
57695 :
57696 9 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_70idzr_id(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank) {
57697 9 : int __pyx_v_n;
57698 9 : int __pyx_v_tmp_int;
57699 9 : int __pyx_v_p;
57700 9 : __pyx_t_double_complex __pyx_v_one;
57701 9 : PyArrayObject *__pyx_v_inds = 0;
57702 9 : PyArrayObject *__pyx_v_perms = 0;
57703 9 : CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
57704 9 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
57705 9 : __Pyx_Buffer __pyx_pybuffer_a;
57706 9 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
57707 9 : __Pyx_Buffer __pyx_pybuffer_inds;
57708 9 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
57709 9 : __Pyx_Buffer __pyx_pybuffer_perms;
57710 9 : PyObject *__pyx_r = NULL;
57711 : __Pyx_RefNannyDeclarations
57712 9 : PyObject *__pyx_t_1 = NULL;
57713 9 : PyObject *__pyx_t_2 = NULL;
57714 9 : PyObject *__pyx_t_3 = NULL;
57715 9 : PyObject *__pyx_t_4 = NULL;
57716 9 : unsigned int __pyx_t_5;
57717 9 : PyObject *(*__pyx_t_6)(PyObject *);
57718 9 : PyArrayObject *__pyx_t_7 = NULL;
57719 9 : int __pyx_t_8;
57720 9 : PyObject *__pyx_t_9 = NULL;
57721 9 : PyObject *__pyx_t_10 = NULL;
57722 9 : PyObject *__pyx_t_11 = NULL;
57723 9 : PyArrayObject *__pyx_t_12 = NULL;
57724 9 : int __pyx_t_13;
57725 9 : int __pyx_t_14;
57726 9 : int __pyx_t_15;
57727 9 : Py_ssize_t __pyx_t_16;
57728 9 : __pyx_t_5numpy_int64_t __pyx_t_17;
57729 9 : Py_ssize_t __pyx_t_18;
57730 9 : Py_ssize_t __pyx_t_19;
57731 9 : Py_ssize_t __pyx_t_20;
57732 9 : int __pyx_lineno = 0;
57733 9 : const char *__pyx_filename = NULL;
57734 9 : int __pyx_clineno = 0;
57735 9 : __Pyx_RefNannySetupContext("idzr_id", 1);
57736 9 : __pyx_pybuffer_inds.pybuffer.buf = NULL;
57737 9 : __pyx_pybuffer_inds.refcount = 0;
57738 9 : __pyx_pybuffernd_inds.data = NULL;
57739 9 : __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
57740 9 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
57741 9 : __pyx_pybuffer_perms.refcount = 0;
57742 9 : __pyx_pybuffernd_perms.data = NULL;
57743 9 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
57744 9 : __pyx_pybuffer_a.pybuffer.buf = NULL;
57745 9 : __pyx_pybuffer_a.refcount = 0;
57746 9 : __pyx_pybuffernd_a.data = NULL;
57747 9 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
57748 : {
57749 9 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57750 9 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1808, __pyx_L1_error)
57751 : }
57752 9 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
57753 :
57754 : /* "scipy/linalg/_decomp_interpolative.pyx":1809
57755 : *
57756 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank):
57757 : * cdef int n = a.shape[1], tmp_int, p # <<<<<<<<<<<<<<
57758 : * cdef double complex one = 1.0
57759 : * cdef cnp.ndarray[cnp.int64_t, ndim=1] inds
57760 : */
57761 9 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
57762 :
57763 : /* "scipy/linalg/_decomp_interpolative.pyx":1810
57764 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank):
57765 : * cdef int n = a.shape[1], tmp_int, p
57766 : * cdef double complex one = 1.0 # <<<<<<<<<<<<<<
57767 : * cdef cnp.ndarray[cnp.int64_t, ndim=1] inds
57768 : * cdef cnp.ndarray[cnp.int64_t, ndim=1] perms
57769 : */
57770 9 : __pyx_v_one = __pyx_t_double_complex_from_parts(1.0, 0);
57771 :
57772 : /* "scipy/linalg/_decomp_interpolative.pyx":1814
57773 : * cdef cnp.ndarray[cnp.int64_t, ndim=1] perms
57774 : *
57775 : * inds, _ = idzr_qrpiv(a, krank) # <<<<<<<<<<<<<<
57776 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
57777 : *
57778 : */
57779 9 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
57780 9 : __Pyx_GOTREF(__pyx_t_2);
57781 9 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L1_error)
57782 9 : __Pyx_GOTREF(__pyx_t_3);
57783 9 : __pyx_t_4 = NULL;
57784 9 : __pyx_t_5 = 0;
57785 : #if CYTHON_UNPACK_METHODS
57786 9 : if (unlikely(PyMethod_Check(__pyx_t_2))) {
57787 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
57788 0 : if (likely(__pyx_t_4)) {
57789 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
57790 0 : __Pyx_INCREF(__pyx_t_4);
57791 0 : __Pyx_INCREF(function);
57792 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
57793 : __pyx_t_5 = 1;
57794 : }
57795 : }
57796 : #endif
57797 : {
57798 9 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_a), __pyx_t_3};
57799 9 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
57800 9 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
57801 9 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57802 9 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
57803 9 : __Pyx_GOTREF(__pyx_t_1);
57804 9 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57805 : }
57806 9 : if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
57807 9 : PyObject* sequence = __pyx_t_1;
57808 9 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
57809 9 : if (unlikely(size != 2)) {
57810 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
57811 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
57812 0 : __PYX_ERR(0, 1814, __pyx_L1_error)
57813 : }
57814 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
57815 9 : if (likely(PyTuple_CheckExact(sequence))) {
57816 9 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
57817 9 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
57818 : } else {
57819 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
57820 0 : __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
57821 : }
57822 9 : __Pyx_INCREF(__pyx_t_2);
57823 9 : __Pyx_INCREF(__pyx_t_3);
57824 : #else
57825 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
57826 : __Pyx_GOTREF(__pyx_t_2);
57827 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L1_error)
57828 : __Pyx_GOTREF(__pyx_t_3);
57829 : #endif
57830 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57831 : } else {
57832 0 : Py_ssize_t index = -1;
57833 0 : __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L1_error)
57834 0 : __Pyx_GOTREF(__pyx_t_4);
57835 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57836 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4);
57837 0 : index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
57838 0 : __Pyx_GOTREF(__pyx_t_2);
57839 0 : index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
57840 0 : __Pyx_GOTREF(__pyx_t_3);
57841 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1814, __pyx_L1_error)
57842 0 : __pyx_t_6 = NULL;
57843 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57844 0 : goto __pyx_L4_unpacking_done;
57845 0 : __pyx_L3_unpacking_failed:;
57846 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57847 0 : __pyx_t_6 = NULL;
57848 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
57849 0 : __PYX_ERR(0, 1814, __pyx_L1_error)
57850 0 : __pyx_L4_unpacking_done:;
57851 : }
57852 9 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1814, __pyx_L1_error)
57853 9 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
57854 : {
57855 9 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57856 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
57857 9 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
57858 9 : if (unlikely(__pyx_t_8 < 0)) {
57859 0 : PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
57860 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
57861 : Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
57862 : __Pyx_RaiseBufferFallbackError();
57863 : } else {
57864 0 : PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
57865 : }
57866 0 : __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
57867 : }
57868 9 : __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
57869 9 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1814, __pyx_L1_error)
57870 : }
57871 9 : __pyx_t_7 = 0;
57872 9 : __pyx_v_inds = ((PyArrayObject *)__pyx_t_2);
57873 9 : __pyx_t_2 = 0;
57874 9 : __pyx_v__ = __pyx_t_3;
57875 9 : __pyx_t_3 = 0;
57876 :
57877 : /* "scipy/linalg/_decomp_interpolative.pyx":1815
57878 : *
57879 : * inds, _ = idzr_qrpiv(a, krank)
57880 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64) # <<<<<<<<<<<<<<
57881 : *
57882 : * if krank > 0:
57883 : */
57884 9 : __pyx_t_1 = PyArray_Arange(0.0, __pyx_v_n, 1.0, NPY_INT64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1815, __pyx_L1_error)
57885 9 : __Pyx_GOTREF(__pyx_t_1);
57886 9 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1815, __pyx_L1_error)
57887 9 : __pyx_t_12 = ((PyArrayObject *)__pyx_t_1);
57888 : {
57889 9 : __Pyx_BufFmt_StackElem __pyx_stack[1];
57890 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
57891 9 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
57892 9 : if (unlikely(__pyx_t_8 < 0)) {
57893 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
57894 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
57895 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
57896 : __Pyx_RaiseBufferFallbackError();
57897 : } else {
57898 0 : PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
57899 : }
57900 0 : __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
57901 : }
57902 9 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
57903 9 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1815, __pyx_L1_error)
57904 : }
57905 9 : __pyx_t_12 = 0;
57906 9 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_1);
57907 9 : __pyx_t_1 = 0;
57908 :
57909 : /* "scipy/linalg/_decomp_interpolative.pyx":1817
57910 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
57911 : *
57912 : * if krank > 0: # <<<<<<<<<<<<<<
57913 : * for p in range(krank):
57914 : * # Apply pivots
57915 : */
57916 9 : __pyx_t_13 = (__pyx_v_krank > 0);
57917 9 : if (__pyx_t_13) {
57918 :
57919 : /* "scipy/linalg/_decomp_interpolative.pyx":1818
57920 : *
57921 : * if krank > 0:
57922 : * for p in range(krank): # <<<<<<<<<<<<<<
57923 : * # Apply pivots
57924 : * tmp_int = perms[p]
57925 : */
57926 151 : __pyx_t_8 = __pyx_v_krank;
57927 : __pyx_t_14 = __pyx_t_8;
57928 151 : for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
57929 142 : __pyx_v_p = __pyx_t_15;
57930 :
57931 : /* "scipy/linalg/_decomp_interpolative.pyx":1820
57932 : * for p in range(krank):
57933 : * # Apply pivots
57934 : * tmp_int = perms[p] # <<<<<<<<<<<<<<
57935 : * perms[p] = perms[inds[p]]
57936 : * perms[inds[p]] = tmp_int
57937 : */
57938 142 : __pyx_t_16 = __pyx_v_p;
57939 142 : __pyx_v_tmp_int = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_perms.diminfo[0].strides));
57940 :
57941 : /* "scipy/linalg/_decomp_interpolative.pyx":1821
57942 : * # Apply pivots
57943 : * tmp_int = perms[p]
57944 : * perms[p] = perms[inds[p]] # <<<<<<<<<<<<<<
57945 : * perms[inds[p]] = tmp_int
57946 : * tmp_int = n - krank
57947 : */
57948 142 : __pyx_t_16 = __pyx_v_p;
57949 142 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_inds.diminfo[0].strides));
57950 142 : __pyx_t_18 = __pyx_v_p;
57951 142 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_perms.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
57952 :
57953 : /* "scipy/linalg/_decomp_interpolative.pyx":1822
57954 : * tmp_int = perms[p]
57955 : * perms[p] = perms[inds[p]]
57956 : * perms[inds[p]] = tmp_int # <<<<<<<<<<<<<<
57957 : * tmp_int = n - krank
57958 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
57959 : */
57960 142 : __pyx_t_16 = __pyx_v_p;
57961 142 : __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_inds.diminfo[0].strides));
57962 142 : *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides) = __pyx_v_tmp_int;
57963 : }
57964 :
57965 : /* "scipy/linalg/_decomp_interpolative.pyx":1817
57966 : * perms = cnp.PyArray_Arange(0, n, 1, cnp.NPY_INT64)
57967 : *
57968 : * if krank > 0: # <<<<<<<<<<<<<<
57969 : * for p in range(krank):
57970 : * # Apply pivots
57971 : */
57972 : }
57973 :
57974 : /* "scipy/linalg/_decomp_interpolative.pyx":1823
57975 : * perms[p] = perms[inds[p]]
57976 : * perms[inds[p]] = tmp_int
57977 : * tmp_int = n - krank # <<<<<<<<<<<<<<
57978 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
57979 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
57980 : */
57981 9 : __pyx_v_tmp_int = (__pyx_v_n - __pyx_v_krank);
57982 :
57983 : /* "scipy/linalg/_decomp_interpolative.pyx":1826
57984 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
57985 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N',
57986 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n) # <<<<<<<<<<<<<<
57987 : *
57988 : * return perms, a[:krank, krank:]
57989 : */
57990 9 : __pyx_t_16 = 0;
57991 9 : __pyx_t_18 = 0;
57992 9 : __pyx_t_19 = 0;
57993 9 : __pyx_t_20 = __pyx_v_krank;
57994 :
57995 : /* "scipy/linalg/_decomp_interpolative.pyx":1825
57996 : * tmp_int = n - krank
57997 : * # SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB
57998 : * ztrsm(<char*>'R', <char*>'L', <char*>'N', <char*>'N', # <<<<<<<<<<<<<<
57999 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
58000 : *
58001 : */
58002 9 : __pyx_f_5scipy_6linalg_11cython_blas_ztrsm(((char *)((char *)"R")), ((char *)((char *)"L")), ((char *)((char *)"N")), ((char *)((char *)"N")), (&__pyx_v_tmp_int), (&__pyx_v_krank), (&__pyx_v_one), (&(*__Pyx_BufPtrStrided2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n), (&(*__Pyx_BufPtrStrided2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n));
58003 :
58004 : /* "scipy/linalg/_decomp_interpolative.pyx":1828
58005 : * &tmp_int, &krank, &one, &a[0, 0], &n, &a[0, krank], &n)
58006 : *
58007 : * return perms, a[:krank, krank:] # <<<<<<<<<<<<<<
58008 : *
58009 : *
58010 : */
58011 9 : __Pyx_XDECREF(__pyx_r);
58012 9 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error)
58013 9 : __Pyx_GOTREF(__pyx_t_1);
58014 9 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error)
58015 9 : __Pyx_GOTREF(__pyx_t_3);
58016 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58017 9 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error)
58018 9 : __Pyx_GOTREF(__pyx_t_1);
58019 9 : __pyx_t_2 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error)
58020 9 : __Pyx_GOTREF(__pyx_t_2);
58021 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58022 9 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error)
58023 9 : __Pyx_GOTREF(__pyx_t_1);
58024 9 : __Pyx_GIVEREF(__pyx_t_3);
58025 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error);
58026 9 : __Pyx_GIVEREF(__pyx_t_2);
58027 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error);
58028 9 : __pyx_t_3 = 0;
58029 9 : __pyx_t_2 = 0;
58030 9 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error)
58031 9 : __Pyx_GOTREF(__pyx_t_2);
58032 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58033 9 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error)
58034 9 : __Pyx_GOTREF(__pyx_t_1);
58035 9 : __Pyx_INCREF((PyObject *)__pyx_v_perms);
58036 9 : __Pyx_GIVEREF((PyObject *)__pyx_v_perms);
58037 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_perms))) __PYX_ERR(0, 1828, __pyx_L1_error);
58038 9 : __Pyx_GIVEREF(__pyx_t_2);
58039 9 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error);
58040 9 : __pyx_t_2 = 0;
58041 9 : __pyx_r = __pyx_t_1;
58042 9 : __pyx_t_1 = 0;
58043 9 : goto __pyx_L0;
58044 :
58045 : /* "scipy/linalg/_decomp_interpolative.pyx":1808
58046 : *
58047 : *
58048 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
58049 : * cdef int n = a.shape[1], tmp_int, p
58050 : * cdef double complex one = 1.0
58051 : */
58052 :
58053 : /* function exit code */
58054 0 : __pyx_L1_error:;
58055 0 : __Pyx_XDECREF(__pyx_t_1);
58056 0 : __Pyx_XDECREF(__pyx_t_2);
58057 0 : __Pyx_XDECREF(__pyx_t_3);
58058 0 : __Pyx_XDECREF(__pyx_t_4);
58059 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
58060 0 : __Pyx_PyThreadState_declare
58061 0 : __Pyx_PyThreadState_assign
58062 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
58063 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
58064 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
58065 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
58066 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
58067 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
58068 0 : __pyx_r = NULL;
58069 0 : goto __pyx_L2;
58070 9 : __pyx_L0:;
58071 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
58072 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
58073 9 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
58074 9 : __pyx_L2:;
58075 9 : __Pyx_XDECREF((PyObject *)__pyx_v_inds);
58076 9 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
58077 9 : __Pyx_XDECREF(__pyx_v__);
58078 9 : __Pyx_XGIVEREF(__pyx_r);
58079 9 : __Pyx_RefNannyFinishContext();
58080 9 : return __pyx_r;
58081 : }
58082 :
58083 : /* "scipy/linalg/_decomp_interpolative.pyx":1831
58084 : *
58085 : *
58086 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
58087 : * cdef int m = a.shape[0], n = a.shape[1]
58088 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
58089 : */
58090 :
58091 : /* Python wrapper */
58092 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_73idzr_qrpiv(PyObject *__pyx_self,
58093 : #if CYTHON_METH_FASTCALL
58094 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
58095 : #else
58096 : PyObject *__pyx_args, PyObject *__pyx_kwds
58097 : #endif
58098 : ); /*proto*/
58099 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_73idzr_qrpiv = {"idzr_qrpiv", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_73idzr_qrpiv, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
58100 20 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_73idzr_qrpiv(PyObject *__pyx_self,
58101 : #if CYTHON_METH_FASTCALL
58102 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
58103 : #else
58104 : PyObject *__pyx_args, PyObject *__pyx_kwds
58105 : #endif
58106 : ) {
58107 20 : PyArrayObject *__pyx_v_a = 0;
58108 20 : int __pyx_v_krank;
58109 : #if !CYTHON_METH_FASTCALL
58110 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
58111 : #endif
58112 20 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
58113 20 : PyObject* values[2] = {0,0};
58114 20 : int __pyx_lineno = 0;
58115 20 : const char *__pyx_filename = NULL;
58116 20 : int __pyx_clineno = 0;
58117 20 : PyObject *__pyx_r = 0;
58118 : __Pyx_RefNannyDeclarations
58119 20 : __Pyx_RefNannySetupContext("idzr_qrpiv (wrapper)", 0);
58120 : #if !CYTHON_METH_FASTCALL
58121 : #if CYTHON_ASSUME_SAFE_MACROS
58122 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
58123 : #else
58124 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
58125 : #endif
58126 : #endif
58127 20 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
58128 : {
58129 20 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
58130 20 : if (__pyx_kwds) {
58131 0 : Py_ssize_t kw_args;
58132 0 : switch (__pyx_nargs) {
58133 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
58134 0 : CYTHON_FALLTHROUGH;
58135 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
58136 0 : CYTHON_FALLTHROUGH;
58137 0 : case 0: break;
58138 0 : default: goto __pyx_L5_argtuple_error;
58139 : }
58140 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
58141 0 : switch (__pyx_nargs) {
58142 : case 0:
58143 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
58144 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
58145 0 : kw_args--;
58146 : }
58147 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L3_error)
58148 0 : else goto __pyx_L5_argtuple_error;
58149 0 : CYTHON_FALLTHROUGH;
58150 : case 1:
58151 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
58152 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
58153 0 : kw_args--;
58154 : }
58155 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L3_error)
58156 : else {
58157 0 : __Pyx_RaiseArgtupleInvalid("idzr_qrpiv", 1, 2, 2, 1); __PYX_ERR(0, 1831, __pyx_L3_error)
58158 : }
58159 : }
58160 0 : if (unlikely(kw_args > 0)) {
58161 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
58162 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_qrpiv") < 0)) __PYX_ERR(0, 1831, __pyx_L3_error)
58163 : }
58164 20 : } else if (unlikely(__pyx_nargs != 2)) {
58165 0 : goto __pyx_L5_argtuple_error;
58166 : } else {
58167 20 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
58168 20 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
58169 : }
58170 20 : __pyx_v_a = ((PyArrayObject *)values[0]);
58171 20 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L3_error)
58172 : }
58173 20 : goto __pyx_L6_skip;
58174 0 : __pyx_L5_argtuple_error:;
58175 0 : __Pyx_RaiseArgtupleInvalid("idzr_qrpiv", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1831, __pyx_L3_error)
58176 20 : __pyx_L6_skip:;
58177 20 : goto __pyx_L4_argument_unpacking_done;
58178 0 : __pyx_L3_error:;
58179 : {
58180 0 : Py_ssize_t __pyx_temp;
58181 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
58182 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
58183 : }
58184 : }
58185 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
58186 0 : __Pyx_RefNannyFinishContext();
58187 0 : return NULL;
58188 20 : __pyx_L4_argument_unpacking_done:;
58189 20 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1831, __pyx_L1_error)
58190 20 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_72idzr_qrpiv(__pyx_self, __pyx_v_a, __pyx_v_krank);
58191 :
58192 : /* function exit code */
58193 20 : goto __pyx_L0;
58194 0 : __pyx_L1_error:;
58195 0 : __pyx_r = NULL;
58196 20 : __pyx_L0:;
58197 : {
58198 20 : Py_ssize_t __pyx_temp;
58199 20 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
58200 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
58201 : }
58202 : }
58203 : __Pyx_RefNannyFinishContext();
58204 : return __pyx_r;
58205 : }
58206 :
58207 20 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_72idzr_qrpiv(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank) {
58208 20 : int __pyx_v_m;
58209 20 : int __pyx_v_n;
58210 20 : int __pyx_v_loop;
58211 20 : int __pyx_v_loops;
58212 20 : int __pyx_v_kpiv;
58213 20 : int __pyx_v_i;
58214 20 : int __pyx_v_tmp_int;
58215 20 : PyArrayObject *__pyx_v_col_norms = 0;
58216 20 : __pyx_t_double_complex __pyx_v_tmp_sca;
58217 20 : PyArrayObject *__pyx_v_taus = 0;
58218 20 : PyArrayObject *__pyx_v_ind = 0;
58219 20 : __Pyx_memviewslice __pyx_v_taus_v = { 0, 0, { 0 }, { 0 }, { 0 } };
58220 20 : __pyx_t_5numpy_float64_t __pyx_v_feps;
58221 20 : __pyx_t_5numpy_float64_t __pyx_v_ssmax;
58222 20 : __pyx_t_5numpy_float64_t __pyx_v_ssmaxin;
58223 20 : int __pyx_v_nupdate;
58224 20 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
58225 20 : __Pyx_Buffer __pyx_pybuffer_a;
58226 20 : PyObject *__pyx_r = NULL;
58227 : __Pyx_RefNannyDeclarations
58228 20 : npy_intp __pyx_t_1[1];
58229 20 : PyObject *__pyx_t_2 = NULL;
58230 20 : npy_intp __pyx_t_3[1];
58231 20 : npy_intp __pyx_t_4[1];
58232 20 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
58233 20 : int __pyx_t_6;
58234 20 : int __pyx_t_7;
58235 20 : int __pyx_t_8;
58236 20 : int __pyx_t_9;
58237 20 : Py_ssize_t __pyx_t_10;
58238 20 : Py_ssize_t __pyx_t_11;
58239 20 : PyObject *__pyx_t_12 = NULL;
58240 20 : PyObject *__pyx_t_13 = NULL;
58241 20 : unsigned int __pyx_t_14;
58242 20 : __pyx_t_5numpy_float64_t __pyx_t_15;
58243 20 : PyObject *__pyx_t_16 = NULL;
58244 20 : Py_ssize_t __pyx_t_17;
58245 20 : PyObject *__pyx_t_18 = NULL;
58246 20 : PyObject *__pyx_t_19 = NULL;
58247 20 : PyObject *__pyx_t_20 = NULL;
58248 20 : PyObject *__pyx_t_21 = NULL;
58249 20 : PyObject *__pyx_t_22 = NULL;
58250 20 : int __pyx_t_23;
58251 20 : int __pyx_t_24;
58252 20 : int __pyx_t_25;
58253 20 : int __pyx_t_26;
58254 20 : int __pyx_lineno = 0;
58255 20 : const char *__pyx_filename = NULL;
58256 20 : int __pyx_clineno = 0;
58257 20 : __Pyx_RefNannySetupContext("idzr_qrpiv", 1);
58258 20 : __pyx_pybuffer_a.pybuffer.buf = NULL;
58259 20 : __pyx_pybuffer_a.refcount = 0;
58260 20 : __pyx_pybuffernd_a.data = NULL;
58261 20 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
58262 : {
58263 20 : __Pyx_BufFmt_StackElem __pyx_stack[1];
58264 20 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1831, __pyx_L1_error)
58265 : }
58266 20 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
58267 :
58268 : /* "scipy/linalg/_decomp_interpolative.pyx":1832
58269 : *
58270 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank):
58271 : * cdef int m = a.shape[0], n = a.shape[1] # <<<<<<<<<<<<<<
58272 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
58273 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
58274 : */
58275 20 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
58276 20 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
58277 :
58278 : /* "scipy/linalg/_decomp_interpolative.pyx":1833
58279 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank):
58280 : * cdef int m = a.shape[0], n = a.shape[1]
58281 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0 # <<<<<<<<<<<<<<
58282 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
58283 : * cdef double complex tmp_sca = 0.
58284 : */
58285 20 : __pyx_v_loop = 0;
58286 20 : __pyx_v_kpiv = 0;
58287 20 : __pyx_v_i = 0;
58288 20 : __pyx_v_tmp_int = 0;
58289 :
58290 : /* "scipy/linalg/_decomp_interpolative.pyx":1834
58291 : * cdef int m = a.shape[0], n = a.shape[1]
58292 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
58293 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0) # <<<<<<<<<<<<<<
58294 : * cdef double complex tmp_sca = 0.
58295 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
58296 : */
58297 20 : __pyx_t_1[0] = __pyx_v_n;
58298 20 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_1, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L1_error)
58299 20 : __Pyx_GOTREF(__pyx_t_2);
58300 20 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1834, __pyx_L1_error)
58301 20 : __pyx_v_col_norms = ((PyArrayObject *)__pyx_t_2);
58302 20 : __pyx_t_2 = 0;
58303 :
58304 : /* "scipy/linalg/_decomp_interpolative.pyx":1835
58305 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
58306 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
58307 : * cdef double complex tmp_sca = 0. # <<<<<<<<<<<<<<
58308 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
58309 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
58310 : */
58311 20 : __pyx_v_tmp_sca = __pyx_t_double_complex_from_parts(0., 0);
58312 :
58313 : /* "scipy/linalg/_decomp_interpolative.pyx":1836
58314 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
58315 : * cdef double complex tmp_sca = 0.
58316 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
58317 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
58318 : * cdef double complex[::1] taus_v = taus
58319 : */
58320 20 : __pyx_t_3[0] = __pyx_v_m;
58321 20 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_3, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __pyx_L1_error)
58322 20 : __Pyx_GOTREF(__pyx_t_2);
58323 20 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1836, __pyx_L1_error)
58324 20 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_2);
58325 20 : __pyx_t_2 = 0;
58326 :
58327 : /* "scipy/linalg/_decomp_interpolative.pyx":1837
58328 : * cdef double complex tmp_sca = 0.
58329 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
58330 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0) # <<<<<<<<<<<<<<
58331 : * cdef double complex[::1] taus_v = taus
58332 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
58333 : */
58334 20 : __pyx_t_4[0] = __pyx_v_n;
58335 20 : __pyx_t_2 = PyArray_ZEROS(1, __pyx_t_4, NPY_INT64, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __pyx_L1_error)
58336 20 : __Pyx_GOTREF(__pyx_t_2);
58337 20 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1837, __pyx_L1_error)
58338 20 : __pyx_v_ind = ((PyArrayObject *)__pyx_t_2);
58339 20 : __pyx_t_2 = 0;
58340 :
58341 : /* "scipy/linalg/_decomp_interpolative.pyx":1838
58342 : * cdef cnp.ndarray taus = cnp.PyArray_ZEROS(1, [m], cnp.NPY_COMPLEX128, 0)
58343 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
58344 : * cdef double complex[::1] taus_v = taus # <<<<<<<<<<<<<<
58345 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
58346 : * cdef cnp.float64_t ssmax, ssmaxin
58347 : */
58348 20 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(((PyObject *)__pyx_v_taus), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1838, __pyx_L1_error)
58349 20 : __pyx_v_taus_v = __pyx_t_5;
58350 20 : __pyx_t_5.memview = NULL;
58351 20 : __pyx_t_5.data = NULL;
58352 :
58353 : /* "scipy/linalg/_decomp_interpolative.pyx":1839
58354 : * cdef cnp.ndarray ind = cnp.PyArray_ZEROS(1, [n], cnp.NPY_INT64, 0)
58355 : * cdef double complex[::1] taus_v = taus
58356 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps # <<<<<<<<<<<<<<
58357 : * cdef cnp.float64_t ssmax, ssmaxin
58358 : * cdef int nupdate = 0
58359 : */
58360 20 : __pyx_v_feps = 0.1e-16;
58361 :
58362 : /* "scipy/linalg/_decomp_interpolative.pyx":1841
58363 : * cdef cnp.float64_t feps = 0.1e-16 # Smaller than np.finfo(np.float64).eps
58364 : * cdef cnp.float64_t ssmax, ssmaxin
58365 : * cdef int nupdate = 0 # <<<<<<<<<<<<<<
58366 : *
58367 : * loops = min(krank, min(m, n))
58368 : */
58369 20 : __pyx_v_nupdate = 0;
58370 :
58371 : /* "scipy/linalg/_decomp_interpolative.pyx":1843
58372 : * cdef int nupdate = 0
58373 : *
58374 : * loops = min(krank, min(m, n)) # <<<<<<<<<<<<<<
58375 : * for i in range(n):
58376 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2
58377 : */
58378 20 : __pyx_t_6 = __pyx_v_n;
58379 20 : __pyx_t_7 = __pyx_v_m;
58380 20 : __pyx_t_9 = (__pyx_t_6 < __pyx_t_7);
58381 20 : if (__pyx_t_9) {
58382 : __pyx_t_8 = __pyx_t_6;
58383 : } else {
58384 : __pyx_t_8 = __pyx_t_7;
58385 : }
58386 20 : __pyx_t_6 = __pyx_t_8;
58387 20 : __pyx_t_8 = __pyx_v_krank;
58388 20 : __pyx_t_9 = (__pyx_t_6 < __pyx_t_8);
58389 20 : if (__pyx_t_9) {
58390 : __pyx_t_7 = __pyx_t_6;
58391 : } else {
58392 : __pyx_t_7 = __pyx_t_8;
58393 : }
58394 20 : __pyx_v_loops = __pyx_t_7;
58395 :
58396 : /* "scipy/linalg/_decomp_interpolative.pyx":1844
58397 : *
58398 : * loops = min(krank, min(m, n))
58399 : * for i in range(n): # <<<<<<<<<<<<<<
58400 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2
58401 : *
58402 : */
58403 20 : __pyx_t_7 = __pyx_v_n;
58404 20 : __pyx_t_6 = __pyx_t_7;
58405 2622 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
58406 2602 : __pyx_v_i = __pyx_t_8;
58407 :
58408 : /* "scipy/linalg/_decomp_interpolative.pyx":1845
58409 : * loops = min(krank, min(m, n))
58410 : * for i in range(n):
58411 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2 # <<<<<<<<<<<<<<
58412 : *
58413 : * kpiv = np.argmax(col_norms)
58414 : */
58415 2602 : __pyx_t_10 = 0;
58416 2602 : __pyx_t_11 = __pyx_v_i;
58417 2602 : __pyx_t_2 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_m), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
58418 2602 : __Pyx_GOTREF(__pyx_t_2);
58419 2602 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1845, __pyx_L1_error)
58420 5204 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58421 : }
58422 :
58423 : /* "scipy/linalg/_decomp_interpolative.pyx":1847
58424 : * col_norms[i] = dznrm2(&m, &a[0, i], &n)**2
58425 : *
58426 : * kpiv = np.argmax(col_norms) # <<<<<<<<<<<<<<
58427 : * ssmax = col_norms[kpiv]
58428 : * ssmaxin = ssmax
58429 : */
58430 20 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1847, __pyx_L1_error)
58431 20 : __Pyx_GOTREF(__pyx_t_12);
58432 20 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_argmax); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1847, __pyx_L1_error)
58433 20 : __Pyx_GOTREF(__pyx_t_13);
58434 20 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58435 20 : __pyx_t_12 = NULL;
58436 20 : __pyx_t_14 = 0;
58437 : #if CYTHON_UNPACK_METHODS
58438 20 : if (unlikely(PyMethod_Check(__pyx_t_13))) {
58439 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
58440 0 : if (likely(__pyx_t_12)) {
58441 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
58442 0 : __Pyx_INCREF(__pyx_t_12);
58443 0 : __Pyx_INCREF(function);
58444 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
58445 : __pyx_t_14 = 1;
58446 : }
58447 : }
58448 : #endif
58449 : {
58450 20 : PyObject *__pyx_callargs[2] = {__pyx_t_12, ((PyObject *)__pyx_v_col_norms)};
58451 20 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
58452 20 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
58453 20 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1847, __pyx_L1_error)
58454 20 : __Pyx_GOTREF(__pyx_t_2);
58455 20 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
58456 : }
58457 20 : __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1847, __pyx_L1_error)
58458 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58459 20 : __pyx_v_kpiv = __pyx_t_7;
58460 :
58461 : /* "scipy/linalg/_decomp_interpolative.pyx":1848
58462 : *
58463 : * kpiv = np.argmax(col_norms)
58464 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
58465 : * ssmaxin = ssmax
58466 : *
58467 : */
58468 20 : __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
58469 20 : __Pyx_GOTREF(__pyx_t_2);
58470 20 : __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L1_error)
58471 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58472 374 : __pyx_v_ssmax = __pyx_t_15;
58473 :
58474 : /* "scipy/linalg/_decomp_interpolative.pyx":1849
58475 : * kpiv = np.argmax(col_norms)
58476 : * ssmax = col_norms[kpiv]
58477 : * ssmaxin = ssmax # <<<<<<<<<<<<<<
58478 : *
58479 : * for loop in range(loops):
58480 : */
58481 : __pyx_v_ssmaxin = __pyx_v_ssmax;
58482 :
58483 : /* "scipy/linalg/_decomp_interpolative.pyx":1851
58484 : * ssmaxin = ssmax
58485 : *
58486 : * for loop in range(loops): # <<<<<<<<<<<<<<
58487 : *
58488 : * ind[loop] = kpiv
58489 : */
58490 374 : __pyx_t_7 = __pyx_v_loops;
58491 374 : __pyx_t_6 = __pyx_t_7;
58492 374 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
58493 354 : __pyx_v_loop = __pyx_t_8;
58494 :
58495 : /* "scipy/linalg/_decomp_interpolative.pyx":1853
58496 : * for loop in range(loops):
58497 : *
58498 : * ind[loop] = kpiv # <<<<<<<<<<<<<<
58499 : * # Swap columns a[:, k] and a[:, kpiv]
58500 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]]
58501 : */
58502 354 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1853, __pyx_L1_error)
58503 354 : __Pyx_GOTREF(__pyx_t_2);
58504 354 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_ind), __pyx_v_loop, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1853, __pyx_L1_error)
58505 354 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58506 :
58507 : /* "scipy/linalg/_decomp_interpolative.pyx":1855
58508 : * ind[loop] = kpiv
58509 : * # Swap columns a[:, k] and a[:, kpiv]
58510 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]] # <<<<<<<<<<<<<<
58511 : * # Swap col_norms[krank] and col_norms[kpiv]
58512 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
58513 : */
58514 354 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
58515 354 : __Pyx_GOTREF(__pyx_t_2);
58516 354 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1855, __pyx_L1_error)
58517 354 : __Pyx_GOTREF(__pyx_t_13);
58518 354 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1855, __pyx_L1_error)
58519 354 : __Pyx_GOTREF(__pyx_t_12);
58520 354 : __Pyx_GIVEREF(__pyx_t_2);
58521 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error);
58522 354 : __Pyx_GIVEREF(__pyx_t_13);
58523 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1855, __pyx_L1_error);
58524 354 : __pyx_t_2 = 0;
58525 354 : __pyx_t_13 = 0;
58526 354 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1855, __pyx_L1_error)
58527 354 : __Pyx_GOTREF(__pyx_t_13);
58528 354 : __Pyx_INCREF(__pyx_slice__5);
58529 354 : __Pyx_GIVEREF(__pyx_slice__5);
58530 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice__5)) __PYX_ERR(0, 1855, __pyx_L1_error);
58531 354 : __Pyx_GIVEREF(__pyx_t_12);
58532 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1855, __pyx_L1_error);
58533 354 : __pyx_t_12 = 0;
58534 354 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1855, __pyx_L1_error)
58535 354 : __Pyx_GOTREF(__pyx_t_12);
58536 354 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
58537 354 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1855, __pyx_L1_error)
58538 354 : __Pyx_GOTREF(__pyx_t_13);
58539 354 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
58540 354 : __Pyx_GOTREF(__pyx_t_2);
58541 354 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1855, __pyx_L1_error)
58542 354 : __Pyx_GOTREF(__pyx_t_16);
58543 354 : __Pyx_GIVEREF(__pyx_t_13);
58544 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_13)) __PYX_ERR(0, 1855, __pyx_L1_error);
58545 354 : __Pyx_GIVEREF(__pyx_t_2);
58546 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error);
58547 354 : __pyx_t_13 = 0;
58548 354 : __pyx_t_2 = 0;
58549 354 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
58550 354 : __Pyx_GOTREF(__pyx_t_2);
58551 354 : __Pyx_INCREF(__pyx_slice__5);
58552 354 : __Pyx_GIVEREF(__pyx_slice__5);
58553 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1855, __pyx_L1_error);
58554 354 : __Pyx_GIVEREF(__pyx_t_16);
58555 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16)) __PYX_ERR(0, 1855, __pyx_L1_error);
58556 354 : __pyx_t_16 = 0;
58557 354 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_12) < 0))) __PYX_ERR(0, 1855, __pyx_L1_error)
58558 354 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58559 354 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58560 :
58561 : /* "scipy/linalg/_decomp_interpolative.pyx":1857
58562 : * a[:, [kpiv, loop]] = a[:, [loop, kpiv]]
58563 : * # Swap col_norms[krank] and col_norms[kpiv]
58564 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]] # <<<<<<<<<<<<<<
58565 : *
58566 : * if loop < m-1:
58567 : */
58568 354 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1857, __pyx_L1_error)
58569 354 : __Pyx_GOTREF(__pyx_t_12);
58570 354 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
58571 354 : __Pyx_GOTREF(__pyx_t_2);
58572 354 : __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1857, __pyx_L1_error)
58573 354 : __Pyx_GOTREF(__pyx_t_16);
58574 354 : __Pyx_GIVEREF(__pyx_t_12);
58575 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_12)) __PYX_ERR(0, 1857, __pyx_L1_error);
58576 354 : __Pyx_GIVEREF(__pyx_t_2);
58577 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error);
58578 354 : __pyx_t_12 = 0;
58579 354 : __pyx_t_2 = 0;
58580 354 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1857, __pyx_L1_error)
58581 354 : __Pyx_GOTREF(__pyx_t_2);
58582 354 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
58583 354 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_kpiv); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1857, __pyx_L1_error)
58584 354 : __Pyx_GOTREF(__pyx_t_16);
58585 354 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1857, __pyx_L1_error)
58586 354 : __Pyx_GOTREF(__pyx_t_12);
58587 354 : __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1857, __pyx_L1_error)
58588 354 : __Pyx_GOTREF(__pyx_t_13);
58589 354 : __Pyx_GIVEREF(__pyx_t_16);
58590 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_16)) __PYX_ERR(0, 1857, __pyx_L1_error);
58591 354 : __Pyx_GIVEREF(__pyx_t_12);
58592 354 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1857, __pyx_L1_error);
58593 354 : __pyx_t_16 = 0;
58594 354 : __pyx_t_12 = 0;
58595 354 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_13, __pyx_t_2) < 0))) __PYX_ERR(0, 1857, __pyx_L1_error)
58596 354 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
58597 354 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58598 :
58599 : /* "scipy/linalg/_decomp_interpolative.pyx":1859
58600 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
58601 : *
58602 : * if loop < m-1: # <<<<<<<<<<<<<<
58603 : * tmp_sca = a[loop, loop]
58604 : * # FIX: Convert these to F_INT
58605 : */
58606 354 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_m - 1));
58607 354 : if (__pyx_t_9) {
58608 :
58609 : /* "scipy/linalg/_decomp_interpolative.pyx":1860
58610 : *
58611 : * if loop < m-1:
58612 : * tmp_sca = a[loop, loop] # <<<<<<<<<<<<<<
58613 : * # FIX: Convert these to F_INT
58614 : * tmp_int = (m - loop)
58615 : */
58616 354 : __pyx_t_11 = __pyx_v_loop;
58617 354 : __pyx_t_10 = __pyx_v_loop;
58618 354 : __pyx_v_tmp_sca = (*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_a.diminfo[1].strides));
58619 :
58620 : /* "scipy/linalg/_decomp_interpolative.pyx":1862
58621 : * tmp_sca = a[loop, loop]
58622 : * # FIX: Convert these to F_INT
58623 : * tmp_int = (m - loop) # <<<<<<<<<<<<<<
58624 : * zlarfgp(&tmp_int, &tmp_sca, &a[loop+1, loop], &n, &taus_v[loop])
58625 : *
58626 : */
58627 354 : __pyx_v_tmp_int = (__pyx_v_m - __pyx_v_loop);
58628 :
58629 : /* "scipy/linalg/_decomp_interpolative.pyx":1863
58630 : * # FIX: Convert these to F_INT
58631 : * tmp_int = (m - loop)
58632 : * zlarfgp(&tmp_int, &tmp_sca, &a[loop+1, loop], &n, &taus_v[loop]) # <<<<<<<<<<<<<<
58633 : *
58634 : * # Overwrite with 1. for easy matmul
58635 : */
58636 354 : __pyx_t_10 = (__pyx_v_loop + 1);
58637 354 : __pyx_t_11 = __pyx_v_loop;
58638 354 : __pyx_t_17 = __pyx_v_loop;
58639 354 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp((&__pyx_v_tmp_int), (&__pyx_v_tmp_sca), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n), (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_taus_v.data) + __pyx_t_17)) )))));
58640 :
58641 : /* "scipy/linalg/_decomp_interpolative.pyx":1866
58642 : *
58643 : * # Overwrite with 1. for easy matmul
58644 : * a[loop, loop] = 1 # <<<<<<<<<<<<<<
58645 : * if loop < n-1:
58646 : * # Apply the householder reflector to the rest on the right
58647 : */
58648 354 : __pyx_t_17 = __pyx_v_loop;
58649 354 : __pyx_t_11 = __pyx_v_loop;
58650 354 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_t_double_complex_from_parts(1, 0);
58651 :
58652 : /* "scipy/linalg/_decomp_interpolative.pyx":1867
58653 : * # Overwrite with 1. for easy matmul
58654 : * a[loop, loop] = 1
58655 : * if loop < n-1: # <<<<<<<<<<<<<<
58656 : * # Apply the householder reflector to the rest on the right
58657 : * a[loop:, loop+1:] -= np.outer(
58658 : */
58659 354 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
58660 354 : if (__pyx_t_9) {
58661 :
58662 : /* "scipy/linalg/_decomp_interpolative.pyx":1869
58663 : * if loop < n-1:
58664 : * # Apply the householder reflector to the rest on the right
58665 : * a[loop:, loop+1:] -= np.outer( # <<<<<<<<<<<<<<
58666 : * np.conj(taus[loop])*a[loop:, loop],
58667 : * a[loop:, loop].conj() @ a[loop:, loop+1:]
58668 : */
58669 344 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __pyx_L1_error)
58670 344 : __Pyx_GOTREF(__pyx_t_2);
58671 344 : __pyx_t_13 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1869, __pyx_L1_error)
58672 344 : __Pyx_GOTREF(__pyx_t_13);
58673 344 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58674 344 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __pyx_L1_error)
58675 344 : __Pyx_GOTREF(__pyx_t_2);
58676 344 : __pyx_t_12 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1869, __pyx_L1_error)
58677 344 : __Pyx_GOTREF(__pyx_t_12);
58678 344 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58679 344 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __pyx_L1_error)
58680 344 : __Pyx_GOTREF(__pyx_t_2);
58681 344 : __Pyx_GIVEREF(__pyx_t_13);
58682 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13)) __PYX_ERR(0, 1869, __pyx_L1_error);
58683 344 : __Pyx_GIVEREF(__pyx_t_12);
58684 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12)) __PYX_ERR(0, 1869, __pyx_L1_error);
58685 344 : __pyx_t_13 = 0;
58686 344 : __pyx_t_12 = 0;
58687 344 : __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1869, __pyx_L1_error)
58688 344 : __Pyx_GOTREF(__pyx_t_12);
58689 344 : __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1869, __pyx_L1_error)
58690 344 : __Pyx_GOTREF(__pyx_t_16);
58691 344 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_outer); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1869, __pyx_L1_error)
58692 344 : __Pyx_GOTREF(__pyx_t_18);
58693 344 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
58694 :
58695 : /* "scipy/linalg/_decomp_interpolative.pyx":1870
58696 : * # Apply the householder reflector to the rest on the right
58697 : * a[loop:, loop+1:] -= np.outer(
58698 : * np.conj(taus[loop])*a[loop:, loop], # <<<<<<<<<<<<<<
58699 : * a[loop:, loop].conj() @ a[loop:, loop+1:]
58700 : * )
58701 : */
58702 344 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1870, __pyx_L1_error)
58703 344 : __Pyx_GOTREF(__pyx_t_19);
58704 344 : __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conj); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1870, __pyx_L1_error)
58705 344 : __Pyx_GOTREF(__pyx_t_20);
58706 344 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
58707 344 : __pyx_t_19 = __Pyx_GetItemInt(((PyObject *)__pyx_v_taus), __pyx_v_loop, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1870, __pyx_L1_error)
58708 344 : __Pyx_GOTREF(__pyx_t_19);
58709 344 : __pyx_t_21 = NULL;
58710 344 : __pyx_t_14 = 0;
58711 : #if CYTHON_UNPACK_METHODS
58712 344 : if (unlikely(PyMethod_Check(__pyx_t_20))) {
58713 0 : __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
58714 0 : if (likely(__pyx_t_21)) {
58715 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
58716 0 : __Pyx_INCREF(__pyx_t_21);
58717 0 : __Pyx_INCREF(function);
58718 0 : __Pyx_DECREF_SET(__pyx_t_20, function);
58719 : __pyx_t_14 = 1;
58720 : }
58721 : }
58722 : #endif
58723 : {
58724 344 : PyObject *__pyx_callargs[2] = {__pyx_t_21, __pyx_t_19};
58725 344 : __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
58726 344 : __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
58727 344 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
58728 344 : if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1870, __pyx_L1_error)
58729 344 : __Pyx_GOTREF(__pyx_t_16);
58730 344 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
58731 : }
58732 344 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1870, __pyx_L1_error)
58733 344 : __Pyx_GOTREF(__pyx_t_20);
58734 344 : __pyx_t_19 = PySlice_New(__pyx_t_20, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1870, __pyx_L1_error)
58735 344 : __Pyx_GOTREF(__pyx_t_19);
58736 344 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
58737 344 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1870, __pyx_L1_error)
58738 344 : __Pyx_GOTREF(__pyx_t_20);
58739 344 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1870, __pyx_L1_error)
58740 344 : __Pyx_GOTREF(__pyx_t_21);
58741 344 : __Pyx_GIVEREF(__pyx_t_19);
58742 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19)) __PYX_ERR(0, 1870, __pyx_L1_error);
58743 344 : __Pyx_GIVEREF(__pyx_t_20);
58744 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20)) __PYX_ERR(0, 1870, __pyx_L1_error);
58745 344 : __pyx_t_19 = 0;
58746 344 : __pyx_t_20 = 0;
58747 344 : __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1870, __pyx_L1_error)
58748 344 : __Pyx_GOTREF(__pyx_t_20);
58749 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58750 344 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_16, __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1870, __pyx_L1_error)
58751 344 : __Pyx_GOTREF(__pyx_t_21);
58752 344 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
58753 344 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
58754 :
58755 : /* "scipy/linalg/_decomp_interpolative.pyx":1871
58756 : * a[loop:, loop+1:] -= np.outer(
58757 : * np.conj(taus[loop])*a[loop:, loop],
58758 : * a[loop:, loop].conj() @ a[loop:, loop+1:] # <<<<<<<<<<<<<<
58759 : * )
58760 : * # Put back the beta in place
58761 : */
58762 344 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error)
58763 344 : __Pyx_GOTREF(__pyx_t_16);
58764 344 : __pyx_t_19 = PySlice_New(__pyx_t_16, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1871, __pyx_L1_error)
58765 344 : __Pyx_GOTREF(__pyx_t_19);
58766 344 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
58767 344 : __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error)
58768 344 : __Pyx_GOTREF(__pyx_t_16);
58769 344 : __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58770 344 : __Pyx_GOTREF(__pyx_t_22);
58771 344 : __Pyx_GIVEREF(__pyx_t_19);
58772 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19)) __PYX_ERR(0, 1871, __pyx_L1_error);
58773 344 : __Pyx_GIVEREF(__pyx_t_16);
58774 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error);
58775 344 : __pyx_t_19 = 0;
58776 344 : __pyx_t_16 = 0;
58777 344 : __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_22); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error)
58778 344 : __Pyx_GOTREF(__pyx_t_16);
58779 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58780 344 : __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_conj); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58781 344 : __Pyx_GOTREF(__pyx_t_22);
58782 344 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
58783 344 : __pyx_t_16 = NULL;
58784 344 : __pyx_t_14 = 0;
58785 : #if CYTHON_UNPACK_METHODS
58786 344 : if (likely(PyMethod_Check(__pyx_t_22))) {
58787 0 : __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_22);
58788 0 : if (likely(__pyx_t_16)) {
58789 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
58790 0 : __Pyx_INCREF(__pyx_t_16);
58791 0 : __Pyx_INCREF(function);
58792 0 : __Pyx_DECREF_SET(__pyx_t_22, function);
58793 : __pyx_t_14 = 1;
58794 : }
58795 : }
58796 : #endif
58797 : {
58798 344 : PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
58799 344 : __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14);
58800 344 : __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
58801 344 : if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1871, __pyx_L1_error)
58802 344 : __Pyx_GOTREF(__pyx_t_20);
58803 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58804 : }
58805 344 : __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58806 344 : __Pyx_GOTREF(__pyx_t_22);
58807 344 : __pyx_t_16 = PySlice_New(__pyx_t_22, Py_None, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error)
58808 344 : __Pyx_GOTREF(__pyx_t_16);
58809 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58810 344 : __pyx_t_22 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58811 344 : __Pyx_GOTREF(__pyx_t_22);
58812 344 : __pyx_t_19 = PySlice_New(__pyx_t_22, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1871, __pyx_L1_error)
58813 344 : __Pyx_GOTREF(__pyx_t_19);
58814 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58815 344 : __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58816 344 : __Pyx_GOTREF(__pyx_t_22);
58817 344 : __Pyx_GIVEREF(__pyx_t_16);
58818 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_16)) __PYX_ERR(0, 1871, __pyx_L1_error);
58819 344 : __Pyx_GIVEREF(__pyx_t_19);
58820 344 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_19)) __PYX_ERR(0, 1871, __pyx_L1_error);
58821 344 : __pyx_t_16 = 0;
58822 344 : __pyx_t_19 = 0;
58823 344 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_22); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1871, __pyx_L1_error)
58824 344 : __Pyx_GOTREF(__pyx_t_19);
58825 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58826 344 : __pyx_t_22 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1871, __pyx_L1_error)
58827 344 : __Pyx_GOTREF(__pyx_t_22);
58828 344 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
58829 344 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
58830 344 : __pyx_t_19 = NULL;
58831 344 : __pyx_t_14 = 0;
58832 : #if CYTHON_UNPACK_METHODS
58833 344 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
58834 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
58835 0 : if (likely(__pyx_t_19)) {
58836 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
58837 0 : __Pyx_INCREF(__pyx_t_19);
58838 0 : __Pyx_INCREF(function);
58839 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
58840 : __pyx_t_14 = 1;
58841 : }
58842 : }
58843 : #endif
58844 : {
58845 344 : PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_21, __pyx_t_22};
58846 344 : __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_14, 2+__pyx_t_14);
58847 344 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
58848 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58849 344 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58850 344 : if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1869, __pyx_L1_error)
58851 344 : __Pyx_GOTREF(__pyx_t_13);
58852 344 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
58853 : }
58854 :
58855 : /* "scipy/linalg/_decomp_interpolative.pyx":1869
58856 : * if loop < n-1:
58857 : * # Apply the householder reflector to the rest on the right
58858 : * a[loop:, loop+1:] -= np.outer( # <<<<<<<<<<<<<<
58859 : * np.conj(taus[loop])*a[loop:, loop],
58860 : * a[loop:, loop].conj() @ a[loop:, loop+1:]
58861 : */
58862 344 : __pyx_t_18 = PyNumber_InPlaceSubtract(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1869, __pyx_L1_error)
58863 344 : __Pyx_GOTREF(__pyx_t_18);
58864 344 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58865 344 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
58866 344 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_a), __pyx_t_2, __pyx_t_18) < 0))) __PYX_ERR(0, 1869, __pyx_L1_error)
58867 344 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
58868 344 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58869 :
58870 : /* "scipy/linalg/_decomp_interpolative.pyx":1867
58871 : * # Overwrite with 1. for easy matmul
58872 : * a[loop, loop] = 1
58873 : * if loop < n-1: # <<<<<<<<<<<<<<
58874 : * # Apply the householder reflector to the rest on the right
58875 : * a[loop:, loop+1:] -= np.outer(
58876 : */
58877 : }
58878 :
58879 : /* "scipy/linalg/_decomp_interpolative.pyx":1874
58880 : * )
58881 : * # Put back the beta in place
58882 : * a[loop, loop] = tmp_sca # <<<<<<<<<<<<<<
58883 : *
58884 : * # Update the norms
58885 : */
58886 354 : __pyx_t_11 = __pyx_v_loop;
58887 354 : __pyx_t_17 = __pyx_v_loop;
58888 354 : *__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_a.diminfo[1].strides) = __pyx_v_tmp_sca;
58889 :
58890 : /* "scipy/linalg/_decomp_interpolative.pyx":1877
58891 : *
58892 : * # Update the norms
58893 : * col_norms[loop] = 0 # <<<<<<<<<<<<<<
58894 : * col_norms[loop+1:] -= (a[loop, loop+1:]*a[loop, loop+1:].conj()).real
58895 : * ssmax = 0
58896 : */
58897 354 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_loop, __pyx_int_0, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1877, __pyx_L1_error)
58898 :
58899 : /* "scipy/linalg/_decomp_interpolative.pyx":1878
58900 : * # Update the norms
58901 : * col_norms[loop] = 0
58902 : * col_norms[loop+1:] -= (a[loop, loop+1:]*a[loop, loop+1:].conj()).real # <<<<<<<<<<<<<<
58903 : * ssmax = 0
58904 : * kpiv = loop+1
58905 : */
58906 354 : __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error)
58907 354 : __Pyx_GOTREF(__pyx_t_2);
58908 354 : __pyx_t_18 = PySlice_New(__pyx_t_2, Py_None, Py_None); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1878, __pyx_L1_error)
58909 354 : __Pyx_GOTREF(__pyx_t_18);
58910 354 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58911 354 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error)
58912 354 : __Pyx_GOTREF(__pyx_t_2);
58913 354 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1878, __pyx_L1_error)
58914 354 : __Pyx_GOTREF(__pyx_t_13);
58915 354 : __pyx_t_12 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1878, __pyx_L1_error)
58916 354 : __Pyx_GOTREF(__pyx_t_12);
58917 354 : __pyx_t_22 = PySlice_New(__pyx_t_12, Py_None, Py_None); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1878, __pyx_L1_error)
58918 354 : __Pyx_GOTREF(__pyx_t_22);
58919 354 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58920 354 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1878, __pyx_L1_error)
58921 354 : __Pyx_GOTREF(__pyx_t_12);
58922 354 : __Pyx_GIVEREF(__pyx_t_13);
58923 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13)) __PYX_ERR(0, 1878, __pyx_L1_error);
58924 354 : __Pyx_GIVEREF(__pyx_t_22);
58925 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_22)) __PYX_ERR(0, 1878, __pyx_L1_error);
58926 354 : __pyx_t_13 = 0;
58927 354 : __pyx_t_22 = 0;
58928 354 : __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1878, __pyx_L1_error)
58929 354 : __Pyx_GOTREF(__pyx_t_22);
58930 354 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58931 354 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_loop); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1878, __pyx_L1_error)
58932 354 : __Pyx_GOTREF(__pyx_t_13);
58933 354 : __pyx_t_21 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1878, __pyx_L1_error)
58934 354 : __Pyx_GOTREF(__pyx_t_21);
58935 354 : __pyx_t_19 = PySlice_New(__pyx_t_21, Py_None, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1878, __pyx_L1_error)
58936 354 : __Pyx_GOTREF(__pyx_t_19);
58937 354 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58938 354 : __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1878, __pyx_L1_error)
58939 354 : __Pyx_GOTREF(__pyx_t_21);
58940 354 : __Pyx_GIVEREF(__pyx_t_13);
58941 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_13)) __PYX_ERR(0, 1878, __pyx_L1_error);
58942 354 : __Pyx_GIVEREF(__pyx_t_19);
58943 354 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19)) __PYX_ERR(0, 1878, __pyx_L1_error);
58944 354 : __pyx_t_13 = 0;
58945 354 : __pyx_t_19 = 0;
58946 354 : __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_21); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1878, __pyx_L1_error)
58947 354 : __Pyx_GOTREF(__pyx_t_19);
58948 354 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58949 354 : __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_conj); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1878, __pyx_L1_error)
58950 354 : __Pyx_GOTREF(__pyx_t_21);
58951 354 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
58952 354 : __pyx_t_19 = NULL;
58953 354 : __pyx_t_14 = 0;
58954 : #if CYTHON_UNPACK_METHODS
58955 354 : if (likely(PyMethod_Check(__pyx_t_21))) {
58956 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_21);
58957 0 : if (likely(__pyx_t_19)) {
58958 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
58959 0 : __Pyx_INCREF(__pyx_t_19);
58960 0 : __Pyx_INCREF(function);
58961 0 : __Pyx_DECREF_SET(__pyx_t_21, function);
58962 : __pyx_t_14 = 1;
58963 : }
58964 : }
58965 : #endif
58966 : {
58967 354 : PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
58968 354 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_21, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14);
58969 354 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
58970 354 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1878, __pyx_L1_error)
58971 354 : __Pyx_GOTREF(__pyx_t_12);
58972 354 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58973 : }
58974 354 : __pyx_t_21 = PyNumber_Multiply(__pyx_t_22, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1878, __pyx_L1_error)
58975 354 : __Pyx_GOTREF(__pyx_t_21);
58976 354 : __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
58977 354 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58978 354 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_real); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1878, __pyx_L1_error)
58979 354 : __Pyx_GOTREF(__pyx_t_12);
58980 354 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58981 354 : __pyx_t_21 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1878, __pyx_L1_error)
58982 354 : __Pyx_GOTREF(__pyx_t_21);
58983 354 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58984 354 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
58985 354 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col_norms), __pyx_t_18, __pyx_t_21) < 0))) __PYX_ERR(0, 1878, __pyx_L1_error)
58986 354 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
58987 354 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
58988 :
58989 : /* "scipy/linalg/_decomp_interpolative.pyx":1879
58990 : * col_norms[loop] = 0
58991 : * col_norms[loop+1:] -= (a[loop, loop+1:]*a[loop, loop+1:].conj()).real
58992 : * ssmax = 0 # <<<<<<<<<<<<<<
58993 : * kpiv = loop+1
58994 : *
58995 : */
58996 354 : __pyx_v_ssmax = 0.0;
58997 :
58998 : /* "scipy/linalg/_decomp_interpolative.pyx":1880
58999 : * col_norms[loop+1:] -= (a[loop, loop+1:]*a[loop, loop+1:].conj()).real
59000 : * ssmax = 0
59001 : * kpiv = loop+1 # <<<<<<<<<<<<<<
59002 : *
59003 : * if loop < n-1:
59004 : */
59005 354 : __pyx_v_kpiv = (__pyx_v_loop + 1);
59006 :
59007 : /* "scipy/linalg/_decomp_interpolative.pyx":1882
59008 : * kpiv = loop+1
59009 : *
59010 : * if loop < n-1: # <<<<<<<<<<<<<<
59011 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59012 : * ssmax = col_norms[kpiv]
59013 : */
59014 354 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
59015 354 : if (__pyx_t_9) {
59016 :
59017 : /* "scipy/linalg/_decomp_interpolative.pyx":1883
59018 : *
59019 : * if loop < n-1:
59020 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1) # <<<<<<<<<<<<<<
59021 : * ssmax = col_norms[kpiv]
59022 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
59023 : */
59024 344 : __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1883, __pyx_L1_error)
59025 344 : __Pyx_GOTREF(__pyx_t_21);
59026 344 : __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_argmax); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1883, __pyx_L1_error)
59027 344 : __Pyx_GOTREF(__pyx_t_12);
59028 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59029 344 : __pyx_t_21 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_loop + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1883, __pyx_L1_error)
59030 344 : __Pyx_GOTREF(__pyx_t_21);
59031 344 : __pyx_t_2 = NULL;
59032 344 : __pyx_t_14 = 0;
59033 : #if CYTHON_UNPACK_METHODS
59034 344 : if (unlikely(PyMethod_Check(__pyx_t_12))) {
59035 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
59036 0 : if (likely(__pyx_t_2)) {
59037 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
59038 0 : __Pyx_INCREF(__pyx_t_2);
59039 0 : __Pyx_INCREF(function);
59040 0 : __Pyx_DECREF_SET(__pyx_t_12, function);
59041 : __pyx_t_14 = 1;
59042 : }
59043 : }
59044 : #endif
59045 : {
59046 344 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_21};
59047 344 : __pyx_t_18 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
59048 344 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
59049 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59050 344 : if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1883, __pyx_L1_error)
59051 344 : __Pyx_GOTREF(__pyx_t_18);
59052 344 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59053 : }
59054 344 : __pyx_t_12 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1883, __pyx_L1_error)
59055 344 : __Pyx_GOTREF(__pyx_t_12);
59056 344 : __pyx_t_21 = PyNumber_Add(__pyx_t_18, __pyx_t_12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1883, __pyx_L1_error)
59057 344 : __Pyx_GOTREF(__pyx_t_21);
59058 344 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
59059 344 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59060 344 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_21); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1883, __pyx_L1_error)
59061 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59062 344 : __pyx_v_kpiv = __pyx_t_23;
59063 :
59064 : /* "scipy/linalg/_decomp_interpolative.pyx":1884
59065 : * if loop < n-1:
59066 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59067 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
59068 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
59069 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59070 : */
59071 344 : __pyx_t_21 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1884, __pyx_L1_error)
59072 344 : __Pyx_GOTREF(__pyx_t_21);
59073 344 : __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_21); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1884, __pyx_L1_error)
59074 344 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59075 : __pyx_v_ssmax = __pyx_t_15;
59076 :
59077 : /* "scipy/linalg/_decomp_interpolative.pyx":1882
59078 : * kpiv = loop+1
59079 : *
59080 : * if loop < n-1: # <<<<<<<<<<<<<<
59081 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59082 : * ssmax = col_norms[kpiv]
59083 : */
59084 : }
59085 :
59086 : /* "scipy/linalg/_decomp_interpolative.pyx":1885
59087 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59088 : * ssmax = col_norms[kpiv]
59089 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
59090 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59091 : * nupdate += 1
59092 : */
59093 354 : __pyx_t_24 = (__pyx_v_ssmax < ((1000.0 * __pyx_v_feps) * __pyx_v_ssmaxin));
59094 354 : if (!__pyx_t_24) {
59095 234 : goto __pyx_L12_next_or;
59096 : } else {
59097 120 : }
59098 120 : __pyx_t_24 = (__pyx_v_nupdate == 0);
59099 120 : if (!__pyx_t_24) {
59100 : } else {
59101 18 : __pyx_t_9 = __pyx_t_24;
59102 18 : goto __pyx_L11_bool_binop_done;
59103 : }
59104 336 : __pyx_L12_next_or:;
59105 :
59106 : /* "scipy/linalg/_decomp_interpolative.pyx":1886
59107 : * ssmax = col_norms[kpiv]
59108 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
59109 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))): # <<<<<<<<<<<<<<
59110 : * nupdate += 1
59111 : * ssmax = 0
59112 : */
59113 336 : __pyx_t_24 = (__pyx_v_ssmax < (pow((1000.0 * __pyx_v_feps), 2.0) * __pyx_v_ssmaxin));
59114 336 : if (__pyx_t_24) {
59115 7 : } else {
59116 329 : __pyx_t_9 = __pyx_t_24;
59117 329 : goto __pyx_L11_bool_binop_done;
59118 : }
59119 7 : __pyx_t_24 = (__pyx_v_nupdate == 1);
59120 7 : __pyx_t_9 = __pyx_t_24;
59121 354 : __pyx_L11_bool_binop_done:;
59122 :
59123 : /* "scipy/linalg/_decomp_interpolative.pyx":1885
59124 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59125 : * ssmax = col_norms[kpiv]
59126 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
59127 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59128 : * nupdate += 1
59129 : */
59130 354 : if (__pyx_t_9) {
59131 :
59132 : /* "scipy/linalg/_decomp_interpolative.pyx":1887
59133 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or
59134 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59135 : * nupdate += 1 # <<<<<<<<<<<<<<
59136 : * ssmax = 0
59137 : * kpiv = loop+1
59138 : */
59139 25 : __pyx_v_nupdate = (__pyx_v_nupdate + 1);
59140 :
59141 : /* "scipy/linalg/_decomp_interpolative.pyx":1888
59142 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59143 : * nupdate += 1
59144 : * ssmax = 0 # <<<<<<<<<<<<<<
59145 : * kpiv = loop+1
59146 : *
59147 : */
59148 25 : __pyx_v_ssmax = 0.0;
59149 :
59150 : /* "scipy/linalg/_decomp_interpolative.pyx":1889
59151 : * nupdate += 1
59152 : * ssmax = 0
59153 : * kpiv = loop+1 # <<<<<<<<<<<<<<
59154 : *
59155 : * if loop < n-1:
59156 : */
59157 25 : __pyx_v_kpiv = (__pyx_v_loop + 1);
59158 :
59159 : /* "scipy/linalg/_decomp_interpolative.pyx":1891
59160 : * kpiv = loop+1
59161 : *
59162 : * if loop < n-1: # <<<<<<<<<<<<<<
59163 : * for i in range(loop+1, n):
59164 : * tmp_int = m-loop-1
59165 : */
59166 25 : __pyx_t_9 = (__pyx_v_loop < (__pyx_v_n - 1));
59167 25 : if (__pyx_t_9) {
59168 :
59169 : /* "scipy/linalg/_decomp_interpolative.pyx":1892
59170 : *
59171 : * if loop < n-1:
59172 : * for i in range(loop+1, n): # <<<<<<<<<<<<<<
59173 : * tmp_int = m-loop-1
59174 : * col_norms[i] = dznrm2(&tmp_int, &a[loop+1, i], &n)**2
59175 : */
59176 2917 : __pyx_t_23 = __pyx_v_n;
59177 : __pyx_t_25 = __pyx_t_23;
59178 2917 : for (__pyx_t_26 = (__pyx_v_loop + 1); __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
59179 2902 : __pyx_v_i = __pyx_t_26;
59180 :
59181 : /* "scipy/linalg/_decomp_interpolative.pyx":1893
59182 : * if loop < n-1:
59183 : * for i in range(loop+1, n):
59184 : * tmp_int = m-loop-1 # <<<<<<<<<<<<<<
59185 : * col_norms[i] = dznrm2(&tmp_int, &a[loop+1, i], &n)**2
59186 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59187 : */
59188 2902 : __pyx_v_tmp_int = ((__pyx_v_m - __pyx_v_loop) - 1);
59189 :
59190 : /* "scipy/linalg/_decomp_interpolative.pyx":1894
59191 : * for i in range(loop+1, n):
59192 : * tmp_int = m-loop-1
59193 : * col_norms[i] = dznrm2(&tmp_int, &a[loop+1, i], &n)**2 # <<<<<<<<<<<<<<
59194 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59195 : * ssmax = col_norms[kpiv]
59196 : */
59197 2902 : __pyx_t_17 = (__pyx_v_loop + 1);
59198 2902 : __pyx_t_11 = __pyx_v_i;
59199 2902 : __pyx_t_21 = PyFloat_FromDouble(pow(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_tmp_int), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_n)), 2.0)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1894, __pyx_L1_error)
59200 2902 : __Pyx_GOTREF(__pyx_t_21);
59201 2902 : if (unlikely((__Pyx_SetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_i, __pyx_t_21, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0))) __PYX_ERR(0, 1894, __pyx_L1_error)
59202 5804 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59203 : }
59204 :
59205 : /* "scipy/linalg/_decomp_interpolative.pyx":1895
59206 : * tmp_int = m-loop-1
59207 : * col_norms[i] = dznrm2(&tmp_int, &a[loop+1, i], &n)**2
59208 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1) # <<<<<<<<<<<<<<
59209 : * ssmax = col_norms[kpiv]
59210 : *
59211 : */
59212 15 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1895, __pyx_L1_error)
59213 15 : __Pyx_GOTREF(__pyx_t_12);
59214 15 : __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_argmax); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1895, __pyx_L1_error)
59215 15 : __Pyx_GOTREF(__pyx_t_18);
59216 15 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59217 15 : __pyx_t_12 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_col_norms), (__pyx_v_loop + 1), 0, NULL, NULL, NULL, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1895, __pyx_L1_error)
59218 15 : __Pyx_GOTREF(__pyx_t_12);
59219 15 : __pyx_t_2 = NULL;
59220 15 : __pyx_t_14 = 0;
59221 : #if CYTHON_UNPACK_METHODS
59222 15 : if (unlikely(PyMethod_Check(__pyx_t_18))) {
59223 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_18);
59224 0 : if (likely(__pyx_t_2)) {
59225 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
59226 0 : __Pyx_INCREF(__pyx_t_2);
59227 0 : __Pyx_INCREF(function);
59228 0 : __Pyx_DECREF_SET(__pyx_t_18, function);
59229 : __pyx_t_14 = 1;
59230 : }
59231 : }
59232 : #endif
59233 : {
59234 15 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_12};
59235 15 : __pyx_t_21 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
59236 15 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
59237 15 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59238 15 : if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1895, __pyx_L1_error)
59239 15 : __Pyx_GOTREF(__pyx_t_21);
59240 15 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
59241 : }
59242 15 : __pyx_t_18 = __Pyx_PyInt_From_long((__pyx_v_loop + 1)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1895, __pyx_L1_error)
59243 15 : __Pyx_GOTREF(__pyx_t_18);
59244 15 : __pyx_t_12 = PyNumber_Add(__pyx_t_21, __pyx_t_18); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1895, __pyx_L1_error)
59245 15 : __Pyx_GOTREF(__pyx_t_12);
59246 15 : __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
59247 15 : __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
59248 15 : __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L1_error)
59249 15 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59250 15 : __pyx_v_kpiv = __pyx_t_23;
59251 :
59252 : /* "scipy/linalg/_decomp_interpolative.pyx":1896
59253 : * col_norms[i] = dznrm2(&tmp_int, &a[loop+1, i], &n)**2
59254 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59255 : * ssmax = col_norms[kpiv] # <<<<<<<<<<<<<<
59256 : *
59257 : * return ind, taus
59258 : */
59259 15 : __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_col_norms), __pyx_v_kpiv, int, 1, __Pyx_PyInt_From_int, 0, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1896, __pyx_L1_error)
59260 15 : __Pyx_GOTREF(__pyx_t_12);
59261 15 : __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L1_error)
59262 15 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
59263 354 : __pyx_v_ssmax = __pyx_t_15;
59264 :
59265 : /* "scipy/linalg/_decomp_interpolative.pyx":1891
59266 : * kpiv = loop+1
59267 : *
59268 : * if loop < n-1: # <<<<<<<<<<<<<<
59269 : * for i in range(loop+1, n):
59270 : * tmp_int = m-loop-1
59271 : */
59272 : }
59273 :
59274 : /* "scipy/linalg/_decomp_interpolative.pyx":1885
59275 : * kpiv = np.argmax(col_norms[loop+1:]) + (loop + 1)
59276 : * ssmax = col_norms[kpiv]
59277 : * if (((ssmax < 1000*feps*ssmaxin) and (nupdate == 0)) or # <<<<<<<<<<<<<<
59278 : * ((ssmax < ((1000*feps)**2)*ssmaxin) and (nupdate == 1))):
59279 : * nupdate += 1
59280 : */
59281 : }
59282 :
59283 : /* "scipy/linalg/_decomp_interpolative.pyx":1859
59284 : * col_norms[[kpiv, loop]] = col_norms[[loop, kpiv]]
59285 : *
59286 : * if loop < m-1: # <<<<<<<<<<<<<<
59287 : * tmp_sca = a[loop, loop]
59288 : * # FIX: Convert these to F_INT
59289 : */
59290 : }
59291 : }
59292 :
59293 : /* "scipy/linalg/_decomp_interpolative.pyx":1898
59294 : * ssmax = col_norms[kpiv]
59295 : *
59296 : * return ind, taus # <<<<<<<<<<<<<<
59297 : *
59298 : *
59299 : */
59300 20 : __Pyx_XDECREF(__pyx_r);
59301 20 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1898, __pyx_L1_error)
59302 20 : __Pyx_GOTREF(__pyx_t_12);
59303 20 : __Pyx_INCREF((PyObject *)__pyx_v_ind);
59304 20 : __Pyx_GIVEREF((PyObject *)__pyx_v_ind);
59305 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_ind))) __PYX_ERR(0, 1898, __pyx_L1_error);
59306 20 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
59307 20 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
59308 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 1898, __pyx_L1_error);
59309 20 : __pyx_r = __pyx_t_12;
59310 20 : __pyx_t_12 = 0;
59311 20 : goto __pyx_L0;
59312 :
59313 : /* "scipy/linalg/_decomp_interpolative.pyx":1831
59314 : *
59315 : *
59316 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
59317 : * cdef int m = a.shape[0], n = a.shape[1]
59318 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
59319 : */
59320 :
59321 : /* function exit code */
59322 0 : __pyx_L1_error:;
59323 0 : __Pyx_XDECREF(__pyx_t_2);
59324 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
59325 0 : __Pyx_XDECREF(__pyx_t_12);
59326 0 : __Pyx_XDECREF(__pyx_t_13);
59327 0 : __Pyx_XDECREF(__pyx_t_16);
59328 0 : __Pyx_XDECREF(__pyx_t_18);
59329 0 : __Pyx_XDECREF(__pyx_t_19);
59330 0 : __Pyx_XDECREF(__pyx_t_20);
59331 0 : __Pyx_XDECREF(__pyx_t_21);
59332 0 : __Pyx_XDECREF(__pyx_t_22);
59333 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
59334 0 : __Pyx_PyThreadState_declare
59335 0 : __Pyx_PyThreadState_assign
59336 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
59337 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
59338 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
59339 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_qrpiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
59340 0 : __pyx_r = NULL;
59341 0 : goto __pyx_L2;
59342 20 : __pyx_L0:;
59343 20 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
59344 20 : __pyx_L2:;
59345 20 : __Pyx_XDECREF((PyObject *)__pyx_v_col_norms);
59346 20 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
59347 20 : __Pyx_XDECREF((PyObject *)__pyx_v_ind);
59348 20 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_taus_v, 1);
59349 20 : __Pyx_XGIVEREF(__pyx_r);
59350 20 : __Pyx_RefNannyFinishContext();
59351 20 : return __pyx_r;
59352 : }
59353 :
59354 : /* "scipy/linalg/_decomp_interpolative.pyx":1901
59355 : *
59356 : *
59357 : * def idzr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
59358 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
59359 : * cdef int L = min(krank+2, min(m, n))
59360 : */
59361 :
59362 : /* Python wrapper */
59363 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_75idzr_rid(PyObject *__pyx_self,
59364 : #if CYTHON_METH_FASTCALL
59365 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
59366 : #else
59367 : PyObject *__pyx_args, PyObject *__pyx_kwds
59368 : #endif
59369 : ); /*proto*/
59370 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_75idzr_rid = {"idzr_rid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_75idzr_rid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
59371 2 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_75idzr_rid(PyObject *__pyx_self,
59372 : #if CYTHON_METH_FASTCALL
59373 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
59374 : #else
59375 : PyObject *__pyx_args, PyObject *__pyx_kwds
59376 : #endif
59377 : ) {
59378 2 : PyObject *__pyx_v_A = 0;
59379 2 : int __pyx_v_krank;
59380 2 : PyObject *__pyx_v_rng = 0;
59381 : #if !CYTHON_METH_FASTCALL
59382 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
59383 : #endif
59384 2 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
59385 2 : PyObject* values[3] = {0,0,0};
59386 2 : int __pyx_lineno = 0;
59387 2 : const char *__pyx_filename = NULL;
59388 2 : int __pyx_clineno = 0;
59389 2 : PyObject *__pyx_r = 0;
59390 : __Pyx_RefNannyDeclarations
59391 2 : __Pyx_RefNannySetupContext("idzr_rid (wrapper)", 0);
59392 : #if !CYTHON_METH_FASTCALL
59393 : #if CYTHON_ASSUME_SAFE_MACROS
59394 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
59395 : #else
59396 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
59397 : #endif
59398 : #endif
59399 2 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
59400 : {
59401 2 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
59402 2 : if (likely(__pyx_kwds)) {
59403 2 : Py_ssize_t kw_args;
59404 2 : switch (__pyx_nargs) {
59405 2 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
59406 2 : CYTHON_FALLTHROUGH;
59407 2 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
59408 2 : CYTHON_FALLTHROUGH;
59409 2 : case 0: break;
59410 0 : default: goto __pyx_L5_argtuple_error;
59411 : }
59412 2 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
59413 2 : switch (__pyx_nargs) {
59414 : case 0:
59415 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
59416 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
59417 0 : kw_args--;
59418 : }
59419 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
59420 0 : else goto __pyx_L5_argtuple_error;
59421 0 : CYTHON_FALLTHROUGH;
59422 : case 1:
59423 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
59424 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
59425 0 : kw_args--;
59426 : }
59427 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
59428 : else {
59429 0 : __Pyx_RaiseArgtupleInvalid("idzr_rid", 1, 2, 2, 1); __PYX_ERR(0, 1901, __pyx_L3_error)
59430 : }
59431 2 : CYTHON_FALLTHROUGH;
59432 : case 2:
59433 2 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
59434 2 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
59435 2 : kw_args--;
59436 : }
59437 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
59438 : else {
59439 0 : __Pyx_RaiseKeywordRequired("idzr_rid", __pyx_n_s_rng); __PYX_ERR(0, 1901, __pyx_L3_error)
59440 : }
59441 : }
59442 2 : if (unlikely(kw_args > 0)) {
59443 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
59444 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_rid") < 0)) __PYX_ERR(0, 1901, __pyx_L3_error)
59445 : }
59446 0 : } else if (unlikely(__pyx_nargs != 2)) {
59447 0 : goto __pyx_L5_argtuple_error;
59448 : } else {
59449 0 : __Pyx_RaiseKeywordRequired("idzr_rid", __pyx_n_s_rng); __PYX_ERR(0, 1901, __pyx_L3_error)
59450 : }
59451 2 : __pyx_v_A = values[0];
59452 2 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
59453 2 : __pyx_v_rng = values[2];
59454 : }
59455 2 : goto __pyx_L6_skip;
59456 0 : __pyx_L5_argtuple_error:;
59457 0 : __Pyx_RaiseArgtupleInvalid("idzr_rid", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1901, __pyx_L3_error)
59458 2 : __pyx_L6_skip:;
59459 2 : goto __pyx_L4_argument_unpacking_done;
59460 0 : __pyx_L3_error:;
59461 : {
59462 0 : Py_ssize_t __pyx_temp;
59463 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
59464 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
59465 : }
59466 : }
59467 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
59468 0 : __Pyx_RefNannyFinishContext();
59469 0 : return NULL;
59470 2 : __pyx_L4_argument_unpacking_done:;
59471 2 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_74idzr_rid(__pyx_self, __pyx_v_A, __pyx_v_krank, __pyx_v_rng);
59472 :
59473 : /* function exit code */
59474 : {
59475 2 : Py_ssize_t __pyx_temp;
59476 2 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
59477 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
59478 : }
59479 : }
59480 : __Pyx_RefNannyFinishContext();
59481 : return __pyx_r;
59482 : }
59483 :
59484 2 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_74idzr_rid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng) {
59485 2 : int __pyx_v_m;
59486 2 : int __pyx_v_n;
59487 2 : int __pyx_v_k;
59488 2 : int __pyx_v_L;
59489 2 : PyArrayObject *__pyx_v_r = 0;
59490 2 : __Pyx_LocalBuf_ND __pyx_pybuffernd_r;
59491 2 : __Pyx_Buffer __pyx_pybuffer_r;
59492 2 : PyObject *__pyx_r = NULL;
59493 : __Pyx_RefNannyDeclarations
59494 2 : PyObject *__pyx_t_1 = NULL;
59495 2 : PyObject *__pyx_t_2 = NULL;
59496 2 : int __pyx_t_3;
59497 2 : int __pyx_t_4;
59498 2 : int __pyx_t_5;
59499 2 : int __pyx_t_6;
59500 2 : long __pyx_t_7;
59501 2 : long __pyx_t_8;
59502 2 : npy_intp __pyx_t_9[2];
59503 2 : PyArrayObject *__pyx_t_10 = NULL;
59504 2 : PyObject *__pyx_t_11 = NULL;
59505 2 : PyObject *__pyx_t_12 = NULL;
59506 2 : PyObject *__pyx_t_13 = NULL;
59507 2 : PyObject *__pyx_t_14 = NULL;
59508 2 : PyObject *__pyx_t_15 = NULL;
59509 2 : PyObject *__pyx_t_16 = NULL;
59510 2 : PyObject *__pyx_t_17 = NULL;
59511 2 : PyObject *__pyx_t_18 = NULL;
59512 2 : PyObject *__pyx_t_19 = NULL;
59513 2 : unsigned int __pyx_t_20;
59514 2 : int __pyx_lineno = 0;
59515 2 : const char *__pyx_filename = NULL;
59516 2 : int __pyx_clineno = 0;
59517 2 : __Pyx_RefNannySetupContext("idzr_rid", 1);
59518 2 : __pyx_pybuffer_r.pybuffer.buf = NULL;
59519 2 : __pyx_pybuffer_r.refcount = 0;
59520 2 : __pyx_pybuffernd_r.data = NULL;
59521 2 : __pyx_pybuffernd_r.rcbuffer = &__pyx_pybuffer_r;
59522 :
59523 : /* "scipy/linalg/_decomp_interpolative.pyx":1902
59524 : *
59525 : * def idzr_rid(A: LinearOperator, int krank, *, rng):
59526 : * cdef int m = A.shape[0], n = A.shape[1], k = 0 # <<<<<<<<<<<<<<
59527 : * cdef int L = min(krank+2, min(m, n))
59528 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] r
59529 : */
59530 2 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error)
59531 2 : __Pyx_GOTREF(__pyx_t_1);
59532 2 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L1_error)
59533 2 : __Pyx_GOTREF(__pyx_t_2);
59534 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59535 2 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)
59536 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59537 2 : __pyx_v_m = __pyx_t_3;
59538 2 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L1_error)
59539 2 : __Pyx_GOTREF(__pyx_t_2);
59540 2 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error)
59541 2 : __Pyx_GOTREF(__pyx_t_1);
59542 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59543 2 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)
59544 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59545 2 : __pyx_v_n = __pyx_t_3;
59546 2 : __pyx_v_k = 0;
59547 :
59548 : /* "scipy/linalg/_decomp_interpolative.pyx":1903
59549 : * def idzr_rid(A: LinearOperator, int krank, *, rng):
59550 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
59551 : * cdef int L = min(krank+2, min(m, n)) # <<<<<<<<<<<<<<
59552 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] r
59553 : *
59554 : */
59555 2 : __pyx_t_3 = __pyx_v_n;
59556 2 : __pyx_t_4 = __pyx_v_m;
59557 2 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_4);
59558 2 : if (__pyx_t_6) {
59559 : __pyx_t_5 = __pyx_t_3;
59560 : } else {
59561 : __pyx_t_5 = __pyx_t_4;
59562 : }
59563 2 : __pyx_t_3 = __pyx_t_5;
59564 2 : __pyx_t_7 = (__pyx_v_krank + 2);
59565 2 : __pyx_t_6 = (__pyx_t_3 < __pyx_t_7);
59566 2 : if (__pyx_t_6) {
59567 : __pyx_t_8 = __pyx_t_3;
59568 : } else {
59569 : __pyx_t_8 = __pyx_t_7;
59570 : }
59571 2 : __pyx_v_L = __pyx_t_8;
59572 :
59573 : /* "scipy/linalg/_decomp_interpolative.pyx":1906
59574 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] r
59575 : *
59576 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
59577 : * for k in range(L):
59578 : * r[k, :] = A.rmatvec(rng.uniform(size=(m,2)).view(np.complex128).ravel())
59579 : */
59580 2 : __pyx_t_9[0] = __pyx_v_L;
59581 2 : __pyx_t_9[1] = __pyx_v_n;
59582 2 : __pyx_t_1 = PyArray_EMPTY(2, __pyx_t_9, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
59583 2 : __Pyx_GOTREF(__pyx_t_1);
59584 2 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1906, __pyx_L1_error)
59585 2 : __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
59586 : {
59587 2 : __Pyx_BufFmt_StackElem __pyx_stack[1];
59588 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
59589 2 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
59590 2 : if (unlikely(__pyx_t_3 < 0)) {
59591 0 : PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
59592 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_r, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
59593 : Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
59594 : __Pyx_RaiseBufferFallbackError();
59595 : } else {
59596 0 : PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
59597 : }
59598 0 : __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
59599 : }
59600 2 : __pyx_pybuffernd_r.diminfo[0].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_r.diminfo[0].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_r.diminfo[1].strides = __pyx_pybuffernd_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_r.diminfo[1].shape = __pyx_pybuffernd_r.rcbuffer->pybuffer.shape[1];
59601 2 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1906, __pyx_L1_error)
59602 : }
59603 2 : __pyx_t_10 = 0;
59604 2 : __pyx_v_r = ((PyArrayObject *)__pyx_t_1);
59605 2 : __pyx_t_1 = 0;
59606 :
59607 : /* "scipy/linalg/_decomp_interpolative.pyx":1907
59608 : *
59609 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_COMPLEX128, 0)
59610 : * for k in range(L): # <<<<<<<<<<<<<<
59611 : * r[k, :] = A.rmatvec(rng.uniform(size=(m,2)).view(np.complex128).ravel())
59612 : *
59613 : */
59614 2 : __pyx_t_3 = __pyx_v_L;
59615 2 : __pyx_t_5 = __pyx_t_3;
59616 46 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
59617 44 : __pyx_v_k = __pyx_t_4;
59618 :
59619 : /* "scipy/linalg/_decomp_interpolative.pyx":1908
59620 : * r = cnp.PyArray_EMPTY(2, [L, n], cnp.NPY_COMPLEX128, 0)
59621 : * for k in range(L):
59622 : * r[k, :] = A.rmatvec(rng.uniform(size=(m,2)).view(np.complex128).ravel()) # <<<<<<<<<<<<<<
59623 : *
59624 : * return idzr_id(a=r.conj(), krank=krank)
59625 : */
59626 44 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_rmatvec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error)
59627 44 : __Pyx_GOTREF(__pyx_t_2);
59628 44 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_rng, __pyx_n_s_uniform); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1908, __pyx_L1_error)
59629 44 : __Pyx_GOTREF(__pyx_t_16);
59630 44 : __pyx_t_17 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1908, __pyx_L1_error)
59631 44 : __Pyx_GOTREF(__pyx_t_17);
59632 44 : __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1908, __pyx_L1_error)
59633 44 : __Pyx_GOTREF(__pyx_t_18);
59634 44 : __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1908, __pyx_L1_error)
59635 44 : __Pyx_GOTREF(__pyx_t_19);
59636 44 : __Pyx_GIVEREF(__pyx_t_18);
59637 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18)) __PYX_ERR(0, 1908, __pyx_L1_error);
59638 44 : __Pyx_INCREF(__pyx_int_2);
59639 44 : __Pyx_GIVEREF(__pyx_int_2);
59640 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_int_2)) __PYX_ERR(0, 1908, __pyx_L1_error);
59641 44 : __pyx_t_18 = 0;
59642 44 : if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_size, __pyx_t_19) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
59643 44 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
59644 44 : __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_empty_tuple, __pyx_t_17); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1908, __pyx_L1_error)
59645 44 : __Pyx_GOTREF(__pyx_t_19);
59646 44 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
59647 44 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
59648 44 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_view); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1908, __pyx_L1_error)
59649 44 : __Pyx_GOTREF(__pyx_t_17);
59650 44 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
59651 44 : __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_np); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1908, __pyx_L1_error)
59652 44 : __Pyx_GOTREF(__pyx_t_19);
59653 44 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_complex128); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1908, __pyx_L1_error)
59654 44 : __Pyx_GOTREF(__pyx_t_16);
59655 44 : __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
59656 44 : __pyx_t_19 = NULL;
59657 44 : __pyx_t_20 = 0;
59658 : #if CYTHON_UNPACK_METHODS
59659 44 : if (likely(PyMethod_Check(__pyx_t_17))) {
59660 0 : __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_17);
59661 0 : if (likely(__pyx_t_19)) {
59662 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
59663 0 : __Pyx_INCREF(__pyx_t_19);
59664 0 : __Pyx_INCREF(function);
59665 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
59666 : __pyx_t_20 = 1;
59667 : }
59668 : }
59669 : #endif
59670 : {
59671 44 : PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_16};
59672 44 : __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 1+__pyx_t_20);
59673 44 : __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
59674 44 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
59675 44 : if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1908, __pyx_L1_error)
59676 44 : __Pyx_GOTREF(__pyx_t_15);
59677 44 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
59678 : }
59679 44 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_ravel); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1908, __pyx_L1_error)
59680 44 : __Pyx_GOTREF(__pyx_t_17);
59681 44 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
59682 44 : __pyx_t_15 = NULL;
59683 44 : __pyx_t_20 = 0;
59684 : #if CYTHON_UNPACK_METHODS
59685 44 : if (likely(PyMethod_Check(__pyx_t_17))) {
59686 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
59687 0 : if (likely(__pyx_t_15)) {
59688 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
59689 0 : __Pyx_INCREF(__pyx_t_15);
59690 0 : __Pyx_INCREF(function);
59691 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
59692 : __pyx_t_20 = 1;
59693 : }
59694 : }
59695 : #endif
59696 : {
59697 44 : PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
59698 44 : __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 0+__pyx_t_20);
59699 44 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
59700 44 : if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1908, __pyx_L1_error)
59701 44 : __Pyx_GOTREF(__pyx_t_14);
59702 44 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
59703 : }
59704 44 : __pyx_t_17 = NULL;
59705 44 : __pyx_t_20 = 0;
59706 : #if CYTHON_UNPACK_METHODS
59707 44 : if (likely(PyMethod_Check(__pyx_t_2))) {
59708 44 : __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_2);
59709 44 : if (likely(__pyx_t_17)) {
59710 44 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
59711 44 : __Pyx_INCREF(__pyx_t_17);
59712 44 : __Pyx_INCREF(function);
59713 44 : __Pyx_DECREF_SET(__pyx_t_2, function);
59714 : __pyx_t_20 = 1;
59715 : }
59716 : }
59717 : #endif
59718 : {
59719 44 : PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_14};
59720 44 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_20, 1+__pyx_t_20);
59721 44 : __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
59722 44 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
59723 44 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error)
59724 44 : __Pyx_GOTREF(__pyx_t_1);
59725 44 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59726 : }
59727 44 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error)
59728 44 : __Pyx_GOTREF(__pyx_t_2);
59729 44 : __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1908, __pyx_L1_error)
59730 44 : __Pyx_GOTREF(__pyx_t_14);
59731 44 : __Pyx_GIVEREF(__pyx_t_2);
59732 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error);
59733 44 : __Pyx_INCREF(__pyx_slice__5);
59734 44 : __Pyx_GIVEREF(__pyx_slice__5);
59735 44 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_slice__5)) __PYX_ERR(0, 1908, __pyx_L1_error);
59736 44 : __pyx_t_2 = 0;
59737 44 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_r), __pyx_t_14, __pyx_t_1) < 0))) __PYX_ERR(0, 1908, __pyx_L1_error)
59738 44 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
59739 88 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59740 : }
59741 :
59742 : /* "scipy/linalg/_decomp_interpolative.pyx":1910
59743 : * r[k, :] = A.rmatvec(rng.uniform(size=(m,2)).view(np.complex128).ravel())
59744 : *
59745 : * return idzr_id(a=r.conj(), krank=krank) # <<<<<<<<<<<<<<
59746 : *
59747 : *
59748 : */
59749 2 : __Pyx_XDECREF(__pyx_r);
59750 2 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_idzr_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __pyx_L1_error)
59751 2 : __Pyx_GOTREF(__pyx_t_1);
59752 2 : __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1910, __pyx_L1_error)
59753 2 : __Pyx_GOTREF(__pyx_t_14);
59754 2 : __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_r), __pyx_n_s_conj); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1910, __pyx_L1_error)
59755 2 : __Pyx_GOTREF(__pyx_t_17);
59756 2 : __pyx_t_15 = NULL;
59757 2 : __pyx_t_20 = 0;
59758 : #if CYTHON_UNPACK_METHODS
59759 2 : if (likely(PyMethod_Check(__pyx_t_17))) {
59760 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
59761 0 : if (likely(__pyx_t_15)) {
59762 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
59763 0 : __Pyx_INCREF(__pyx_t_15);
59764 0 : __Pyx_INCREF(function);
59765 0 : __Pyx_DECREF_SET(__pyx_t_17, function);
59766 : __pyx_t_20 = 1;
59767 : }
59768 : }
59769 : #endif
59770 : {
59771 2 : PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
59772 2 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_20, 0+__pyx_t_20);
59773 2 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
59774 2 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
59775 2 : __Pyx_GOTREF(__pyx_t_2);
59776 2 : __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
59777 : }
59778 2 : if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_a, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
59779 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59780 2 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
59781 2 : __Pyx_GOTREF(__pyx_t_2);
59782 2 : if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_krank, __pyx_t_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)
59783 2 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59784 2 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1910, __pyx_L1_error)
59785 2 : __Pyx_GOTREF(__pyx_t_2);
59786 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59787 2 : __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
59788 2 : __pyx_r = __pyx_t_2;
59789 2 : __pyx_t_2 = 0;
59790 2 : goto __pyx_L0;
59791 :
59792 : /* "scipy/linalg/_decomp_interpolative.pyx":1901
59793 : *
59794 : *
59795 : * def idzr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
59796 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
59797 : * cdef int L = min(krank+2, min(m, n))
59798 : */
59799 :
59800 : /* function exit code */
59801 0 : __pyx_L1_error:;
59802 0 : __Pyx_XDECREF(__pyx_t_1);
59803 0 : __Pyx_XDECREF(__pyx_t_2);
59804 0 : __Pyx_XDECREF(__pyx_t_14);
59805 0 : __Pyx_XDECREF(__pyx_t_15);
59806 0 : __Pyx_XDECREF(__pyx_t_16);
59807 0 : __Pyx_XDECREF(__pyx_t_17);
59808 0 : __Pyx_XDECREF(__pyx_t_18);
59809 0 : __Pyx_XDECREF(__pyx_t_19);
59810 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
59811 0 : __Pyx_PyThreadState_declare
59812 0 : __Pyx_PyThreadState_assign
59813 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
59814 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
59815 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
59816 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_rid", __pyx_clineno, __pyx_lineno, __pyx_filename);
59817 0 : __pyx_r = NULL;
59818 0 : goto __pyx_L2;
59819 2 : __pyx_L0:;
59820 2 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_r.rcbuffer->pybuffer);
59821 2 : __pyx_L2:;
59822 2 : __Pyx_XDECREF((PyObject *)__pyx_v_r);
59823 2 : __Pyx_XGIVEREF(__pyx_r);
59824 2 : __Pyx_RefNannyFinishContext();
59825 2 : return __pyx_r;
59826 : }
59827 :
59828 : /* "scipy/linalg/_decomp_interpolative.pyx":1913
59829 : *
59830 : *
59831 : * def idzr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
59832 : * cdef int n = A.shape[1], j
59833 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
59834 : */
59835 :
59836 : /* Python wrapper */
59837 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_77idzr_rsvd(PyObject *__pyx_self,
59838 : #if CYTHON_METH_FASTCALL
59839 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
59840 : #else
59841 : PyObject *__pyx_args, PyObject *__pyx_kwds
59842 : #endif
59843 : ); /*proto*/
59844 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_77idzr_rsvd = {"idzr_rsvd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_77idzr_rsvd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
59845 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_77idzr_rsvd(PyObject *__pyx_self,
59846 : #if CYTHON_METH_FASTCALL
59847 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
59848 : #else
59849 : PyObject *__pyx_args, PyObject *__pyx_kwds
59850 : #endif
59851 : ) {
59852 1 : PyObject *__pyx_v_A = 0;
59853 1 : int __pyx_v_krank;
59854 1 : PyObject *__pyx_v_rng = 0;
59855 : #if !CYTHON_METH_FASTCALL
59856 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
59857 : #endif
59858 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
59859 1 : PyObject* values[3] = {0,0,0};
59860 1 : int __pyx_lineno = 0;
59861 1 : const char *__pyx_filename = NULL;
59862 1 : int __pyx_clineno = 0;
59863 1 : PyObject *__pyx_r = 0;
59864 : __Pyx_RefNannyDeclarations
59865 1 : __Pyx_RefNannySetupContext("idzr_rsvd (wrapper)", 0);
59866 : #if !CYTHON_METH_FASTCALL
59867 : #if CYTHON_ASSUME_SAFE_MACROS
59868 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
59869 : #else
59870 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
59871 : #endif
59872 : #endif
59873 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
59874 : {
59875 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_krank,&__pyx_n_s_rng,0};
59876 1 : if (likely(__pyx_kwds)) {
59877 1 : Py_ssize_t kw_args;
59878 1 : switch (__pyx_nargs) {
59879 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
59880 1 : CYTHON_FALLTHROUGH;
59881 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
59882 1 : CYTHON_FALLTHROUGH;
59883 1 : case 0: break;
59884 0 : default: goto __pyx_L5_argtuple_error;
59885 : }
59886 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
59887 1 : switch (__pyx_nargs) {
59888 : case 0:
59889 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_A)) != 0)) {
59890 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
59891 0 : kw_args--;
59892 : }
59893 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
59894 0 : else goto __pyx_L5_argtuple_error;
59895 0 : CYTHON_FALLTHROUGH;
59896 : case 1:
59897 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
59898 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
59899 0 : kw_args--;
59900 : }
59901 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
59902 : else {
59903 0 : __Pyx_RaiseArgtupleInvalid("idzr_rsvd", 1, 2, 2, 1); __PYX_ERR(0, 1913, __pyx_L3_error)
59904 : }
59905 1 : CYTHON_FALLTHROUGH;
59906 : case 2:
59907 1 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rng)) != 0)) {
59908 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
59909 1 : kw_args--;
59910 : }
59911 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
59912 : else {
59913 0 : __Pyx_RaiseKeywordRequired("idzr_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1913, __pyx_L3_error)
59914 : }
59915 : }
59916 1 : if (unlikely(kw_args > 0)) {
59917 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
59918 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_rsvd") < 0)) __PYX_ERR(0, 1913, __pyx_L3_error)
59919 : }
59920 0 : } else if (unlikely(__pyx_nargs != 2)) {
59921 0 : goto __pyx_L5_argtuple_error;
59922 : } else {
59923 0 : __Pyx_RaiseKeywordRequired("idzr_rsvd", __pyx_n_s_rng); __PYX_ERR(0, 1913, __pyx_L3_error)
59924 : }
59925 1 : __pyx_v_A = values[0];
59926 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error)
59927 1 : __pyx_v_rng = values[2];
59928 : }
59929 1 : goto __pyx_L6_skip;
59930 0 : __pyx_L5_argtuple_error:;
59931 0 : __Pyx_RaiseArgtupleInvalid("idzr_rsvd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1913, __pyx_L3_error)
59932 1 : __pyx_L6_skip:;
59933 1 : goto __pyx_L4_argument_unpacking_done;
59934 0 : __pyx_L3_error:;
59935 : {
59936 0 : Py_ssize_t __pyx_temp;
59937 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
59938 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
59939 : }
59940 : }
59941 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
59942 0 : __Pyx_RefNannyFinishContext();
59943 0 : return NULL;
59944 1 : __pyx_L4_argument_unpacking_done:;
59945 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_76idzr_rsvd(__pyx_self, __pyx_v_A, __pyx_v_krank, __pyx_v_rng);
59946 :
59947 : /* function exit code */
59948 : {
59949 1 : Py_ssize_t __pyx_temp;
59950 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
59951 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
59952 : }
59953 : }
59954 : __Pyx_RefNannyFinishContext();
59955 : return __pyx_r;
59956 : }
59957 :
59958 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_76idzr_rsvd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, int __pyx_v_krank, PyObject *__pyx_v_rng) {
59959 1 : int __pyx_v_n;
59960 1 : int __pyx_v_j;
59961 1 : PyArrayObject *__pyx_v_perms = 0;
59962 1 : PyArrayObject *__pyx_v_proj = 0;
59963 1 : PyArrayObject *__pyx_v_col = 0;
59964 1 : PyObject *__pyx_v_x = NULL;
59965 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_col;
59966 1 : __Pyx_Buffer __pyx_pybuffer_col;
59967 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_perms;
59968 1 : __Pyx_Buffer __pyx_pybuffer_perms;
59969 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_proj;
59970 1 : __Pyx_Buffer __pyx_pybuffer_proj;
59971 1 : PyObject *__pyx_r = NULL;
59972 : __Pyx_RefNannyDeclarations
59973 1 : PyObject *__pyx_t_1 = NULL;
59974 1 : PyObject *__pyx_t_2 = NULL;
59975 1 : int __pyx_t_3;
59976 1 : PyObject *__pyx_t_4 = NULL;
59977 1 : PyObject *__pyx_t_5 = NULL;
59978 1 : PyObject *(*__pyx_t_6)(PyObject *);
59979 1 : PyArrayObject *__pyx_t_7 = NULL;
59980 1 : PyObject *__pyx_t_8 = NULL;
59981 1 : PyObject *__pyx_t_9 = NULL;
59982 1 : PyObject *__pyx_t_10 = NULL;
59983 1 : PyArrayObject *__pyx_t_11 = NULL;
59984 1 : npy_intp __pyx_t_12[2];
59985 1 : PyArrayObject *__pyx_t_13 = NULL;
59986 1 : npy_intp __pyx_t_14[1];
59987 1 : int __pyx_t_15;
59988 1 : int __pyx_t_16;
59989 1 : Py_ssize_t __pyx_t_17;
59990 1 : __pyx_t_5numpy_int64_t __pyx_t_18;
59991 1 : unsigned int __pyx_t_19;
59992 1 : int __pyx_lineno = 0;
59993 1 : const char *__pyx_filename = NULL;
59994 1 : int __pyx_clineno = 0;
59995 1 : __Pyx_RefNannySetupContext("idzr_rsvd", 1);
59996 1 : __pyx_pybuffer_perms.pybuffer.buf = NULL;
59997 1 : __pyx_pybuffer_perms.refcount = 0;
59998 1 : __pyx_pybuffernd_perms.data = NULL;
59999 1 : __pyx_pybuffernd_perms.rcbuffer = &__pyx_pybuffer_perms;
60000 1 : __pyx_pybuffer_proj.pybuffer.buf = NULL;
60001 1 : __pyx_pybuffer_proj.refcount = 0;
60002 1 : __pyx_pybuffernd_proj.data = NULL;
60003 1 : __pyx_pybuffernd_proj.rcbuffer = &__pyx_pybuffer_proj;
60004 1 : __pyx_pybuffer_col.pybuffer.buf = NULL;
60005 1 : __pyx_pybuffer_col.refcount = 0;
60006 1 : __pyx_pybuffernd_col.data = NULL;
60007 1 : __pyx_pybuffernd_col.rcbuffer = &__pyx_pybuffer_col;
60008 :
60009 : /* "scipy/linalg/_decomp_interpolative.pyx":1914
60010 : *
60011 : * def idzr_rsvd(A: LinearOperator, int krank, *, rng):
60012 : * cdef int n = A.shape[1], j # <<<<<<<<<<<<<<
60013 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
60014 : * cdef cnp.ndarray[cnp.complex128_t, ndim=2] proj
60015 : */
60016 1 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error)
60017 1 : __Pyx_GOTREF(__pyx_t_1);
60018 1 : __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error)
60019 1 : __Pyx_GOTREF(__pyx_t_2);
60020 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60021 1 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error)
60022 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60023 1 : __pyx_v_n = __pyx_t_3;
60024 :
60025 : /* "scipy/linalg/_decomp_interpolative.pyx":1919
60026 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] col
60027 : *
60028 : * perms, proj = idzr_rid(A, krank, rng=rng) # <<<<<<<<<<<<<<
60029 : * # idd_getcols
60030 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
60031 : */
60032 1 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_idzr_rid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1919, __pyx_L1_error)
60033 1 : __Pyx_GOTREF(__pyx_t_2);
60034 1 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error)
60035 1 : __Pyx_GOTREF(__pyx_t_1);
60036 1 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L1_error)
60037 1 : __Pyx_GOTREF(__pyx_t_4);
60038 1 : __Pyx_INCREF(__pyx_v_A);
60039 1 : __Pyx_GIVEREF(__pyx_v_A);
60040 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1919, __pyx_L1_error);
60041 1 : __Pyx_GIVEREF(__pyx_t_1);
60042 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error);
60043 1 : __pyx_t_1 = 0;
60044 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error)
60045 1 : __Pyx_GOTREF(__pyx_t_1);
60046 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rng, __pyx_v_rng) < 0) __PYX_ERR(0, 1919, __pyx_L1_error)
60047 1 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1919, __pyx_L1_error)
60048 1 : __Pyx_GOTREF(__pyx_t_5);
60049 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60050 1 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
60051 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60052 1 : if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
60053 1 : PyObject* sequence = __pyx_t_5;
60054 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
60055 1 : if (unlikely(size != 2)) {
60056 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
60057 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
60058 0 : __PYX_ERR(0, 1919, __pyx_L1_error)
60059 : }
60060 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60061 1 : if (likely(PyTuple_CheckExact(sequence))) {
60062 1 : __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
60063 1 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
60064 : } else {
60065 0 : __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
60066 0 : __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
60067 : }
60068 1 : __Pyx_INCREF(__pyx_t_1);
60069 1 : __Pyx_INCREF(__pyx_t_4);
60070 : #else
60071 : __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error)
60072 : __Pyx_GOTREF(__pyx_t_1);
60073 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L1_error)
60074 : __Pyx_GOTREF(__pyx_t_4);
60075 : #endif
60076 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
60077 : } else {
60078 0 : Py_ssize_t index = -1;
60079 0 : __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1919, __pyx_L1_error)
60080 0 : __Pyx_GOTREF(__pyx_t_2);
60081 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
60082 0 : __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
60083 0 : index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
60084 0 : __Pyx_GOTREF(__pyx_t_1);
60085 0 : index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
60086 0 : __Pyx_GOTREF(__pyx_t_4);
60087 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 1919, __pyx_L1_error)
60088 0 : __pyx_t_6 = NULL;
60089 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60090 0 : goto __pyx_L4_unpacking_done;
60091 0 : __pyx_L3_unpacking_failed:;
60092 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60093 0 : __pyx_t_6 = NULL;
60094 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
60095 0 : __PYX_ERR(0, 1919, __pyx_L1_error)
60096 0 : __pyx_L4_unpacking_done:;
60097 : }
60098 1 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1919, __pyx_L1_error)
60099 1 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1919, __pyx_L1_error)
60100 1 : __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
60101 : {
60102 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60103 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
60104 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
60105 1 : if (unlikely(__pyx_t_3 < 0)) {
60106 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
60107 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_perms.rcbuffer->pybuffer, (PyObject*)__pyx_v_perms, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
60108 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
60109 : __Pyx_RaiseBufferFallbackError();
60110 : } else {
60111 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
60112 : }
60113 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
60114 : }
60115 1 : __pyx_pybuffernd_perms.diminfo[0].strides = __pyx_pybuffernd_perms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_perms.diminfo[0].shape = __pyx_pybuffernd_perms.rcbuffer->pybuffer.shape[0];
60116 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1919, __pyx_L1_error)
60117 : }
60118 1 : __pyx_t_7 = 0;
60119 1 : __pyx_v_perms = ((PyArrayObject *)__pyx_t_1);
60120 1 : __pyx_t_1 = 0;
60121 1 : __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
60122 : {
60123 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60124 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
60125 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
60126 1 : if (unlikely(__pyx_t_3 < 0)) {
60127 0 : PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
60128 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_proj.rcbuffer->pybuffer, (PyObject*)__pyx_v_proj, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
60129 : Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
60130 : __Pyx_RaiseBufferFallbackError();
60131 : } else {
60132 0 : PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
60133 : }
60134 0 : __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
60135 : }
60136 1 : __pyx_pybuffernd_proj.diminfo[0].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_proj.diminfo[0].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_proj.diminfo[1].strides = __pyx_pybuffernd_proj.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_proj.diminfo[1].shape = __pyx_pybuffernd_proj.rcbuffer->pybuffer.shape[1];
60137 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1919, __pyx_L1_error)
60138 : }
60139 1 : __pyx_t_11 = 0;
60140 1 : __pyx_v_proj = ((PyArrayObject *)__pyx_t_4);
60141 1 : __pyx_t_4 = 0;
60142 :
60143 : /* "scipy/linalg/_decomp_interpolative.pyx":1921
60144 : * perms, proj = idzr_rid(A, krank, rng=rng)
60145 : * # idd_getcols
60146 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
60147 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
60148 : * for j in range(krank):
60149 : */
60150 1 : __pyx_t_12[0] = __pyx_v_n;
60151 1 : __pyx_t_12[1] = __pyx_v_krank;
60152 1 : __pyx_t_5 = PyArray_EMPTY(2, __pyx_t_12, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1921, __pyx_L1_error)
60153 1 : __Pyx_GOTREF(__pyx_t_5);
60154 1 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1921, __pyx_L1_error)
60155 1 : __pyx_t_13 = ((PyArrayObject *)__pyx_t_5);
60156 : {
60157 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60158 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
60159 1 : __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
60160 1 : if (unlikely(__pyx_t_3 < 0)) {
60161 0 : PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
60162 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_col.rcbuffer->pybuffer, (PyObject*)__pyx_v_col, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
60163 : Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
60164 : __Pyx_RaiseBufferFallbackError();
60165 : } else {
60166 0 : PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
60167 : }
60168 0 : __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
60169 : }
60170 1 : __pyx_pybuffernd_col.diminfo[0].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_col.diminfo[0].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_col.diminfo[1].strides = __pyx_pybuffernd_col.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_col.diminfo[1].shape = __pyx_pybuffernd_col.rcbuffer->pybuffer.shape[1];
60171 1 : if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1921, __pyx_L1_error)
60172 : }
60173 1 : __pyx_t_13 = 0;
60174 1 : __pyx_v_col = ((PyArrayObject *)__pyx_t_5);
60175 1 : __pyx_t_5 = 0;
60176 :
60177 : /* "scipy/linalg/_decomp_interpolative.pyx":1922
60178 : * # idd_getcols
60179 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
60180 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
60181 : * for j in range(krank):
60182 : * x[perms[j]] = 1.
60183 : */
60184 1 : __pyx_t_14[0] = __pyx_v_n;
60185 1 : __pyx_t_5 = PyArray_ZEROS(1, __pyx_t_14, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1922, __pyx_L1_error)
60186 : __Pyx_GOTREF(__pyx_t_5);
60187 21 : __pyx_v_x = __pyx_t_5;
60188 : __pyx_t_5 = 0;
60189 :
60190 : /* "scipy/linalg/_decomp_interpolative.pyx":1923
60191 : * col = cnp.PyArray_EMPTY(2, [n, krank], cnp.NPY_COMPLEX128, 0)
60192 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
60193 : * for j in range(krank): # <<<<<<<<<<<<<<
60194 : * x[perms[j]] = 1.
60195 : * col[:, j] = A.matvec(x)
60196 : */
60197 21 : __pyx_t_3 = __pyx_v_krank;
60198 : __pyx_t_15 = __pyx_t_3;
60199 21 : for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
60200 20 : __pyx_v_j = __pyx_t_16;
60201 :
60202 : /* "scipy/linalg/_decomp_interpolative.pyx":1924
60203 : * x = cnp.PyArray_ZEROS(1, [n], cnp.NPY_COMPLEX128, 0)
60204 : * for j in range(krank):
60205 : * x[perms[j]] = 1. # <<<<<<<<<<<<<<
60206 : * col[:, j] = A.matvec(x)
60207 : * x[perms[j]] = 0.
60208 : */
60209 20 : __pyx_t_17 = __pyx_v_j;
60210 20 : __pyx_t_18 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
60211 20 : if (unlikely((__Pyx_SetItemInt(__pyx_v_x, __pyx_t_18, __pyx_float_1_, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0) < 0))) __PYX_ERR(0, 1924, __pyx_L1_error)
60212 :
60213 : /* "scipy/linalg/_decomp_interpolative.pyx":1925
60214 : * for j in range(krank):
60215 : * x[perms[j]] = 1.
60216 : * col[:, j] = A.matvec(x) # <<<<<<<<<<<<<<
60217 : * x[perms[j]] = 0.
60218 : *
60219 : */
60220 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_matvec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
60221 20 : __Pyx_GOTREF(__pyx_t_4);
60222 20 : __pyx_t_1 = NULL;
60223 20 : __pyx_t_19 = 0;
60224 : #if CYTHON_UNPACK_METHODS
60225 20 : if (likely(PyMethod_Check(__pyx_t_4))) {
60226 20 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
60227 20 : if (likely(__pyx_t_1)) {
60228 20 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
60229 20 : __Pyx_INCREF(__pyx_t_1);
60230 20 : __Pyx_INCREF(function);
60231 20 : __Pyx_DECREF_SET(__pyx_t_4, function);
60232 : __pyx_t_19 = 1;
60233 : }
60234 : }
60235 : #endif
60236 : {
60237 20 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_x};
60238 20 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_19, 1+__pyx_t_19);
60239 20 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
60240 20 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1925, __pyx_L1_error)
60241 20 : __Pyx_GOTREF(__pyx_t_5);
60242 20 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
60243 : }
60244 20 : __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
60245 20 : __Pyx_GOTREF(__pyx_t_4);
60246 20 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error)
60247 20 : __Pyx_GOTREF(__pyx_t_1);
60248 20 : __Pyx_INCREF(__pyx_slice__5);
60249 20 : __Pyx_GIVEREF(__pyx_slice__5);
60250 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__5)) __PYX_ERR(0, 1925, __pyx_L1_error);
60251 20 : __Pyx_GIVEREF(__pyx_t_4);
60252 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error);
60253 20 : __pyx_t_4 = 0;
60254 20 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_col), __pyx_t_1, __pyx_t_5) < 0))) __PYX_ERR(0, 1925, __pyx_L1_error)
60255 20 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60256 20 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
60257 :
60258 : /* "scipy/linalg/_decomp_interpolative.pyx":1926
60259 : * x[perms[j]] = 1.
60260 : * col[:, j] = A.matvec(x)
60261 : * x[perms[j]] = 0. # <<<<<<<<<<<<<<
60262 : *
60263 : * return idz_id2svd(cols=col, perms=perms, proj=proj)
60264 : */
60265 20 : __pyx_t_17 = __pyx_v_j;
60266 20 : __pyx_t_18 = (*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_perms.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_perms.diminfo[0].strides));
60267 20 : if (unlikely((__Pyx_SetItemInt(__pyx_v_x, __pyx_t_18, __pyx_float_0_, __pyx_t_5numpy_int64_t, 1, __Pyx_PyInt_From_npy_int64, 0, 0, 0) < 0))) __PYX_ERR(0, 1926, __pyx_L1_error)
60268 : }
60269 :
60270 : /* "scipy/linalg/_decomp_interpolative.pyx":1928
60271 : * x[perms[j]] = 0.
60272 : *
60273 : * return idz_id2svd(cols=col, perms=perms, proj=proj) # <<<<<<<<<<<<<<
60274 : *
60275 : *
60276 : */
60277 1 : __Pyx_XDECREF(__pyx_r);
60278 1 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_idz_id2svd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1928, __pyx_L1_error)
60279 1 : __Pyx_GOTREF(__pyx_t_5);
60280 1 : __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error)
60281 1 : __Pyx_GOTREF(__pyx_t_1);
60282 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cols, ((PyObject *)__pyx_v_col)) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
60283 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_perms, ((PyObject *)__pyx_v_perms)) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
60284 1 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_proj, ((PyObject *)__pyx_v_proj)) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
60285 1 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1928, __pyx_L1_error)
60286 1 : __Pyx_GOTREF(__pyx_t_4);
60287 1 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
60288 1 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60289 1 : __pyx_r = __pyx_t_4;
60290 1 : __pyx_t_4 = 0;
60291 1 : goto __pyx_L0;
60292 :
60293 : /* "scipy/linalg/_decomp_interpolative.pyx":1913
60294 : *
60295 : *
60296 : * def idzr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
60297 : * cdef int n = A.shape[1], j
60298 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
60299 : */
60300 :
60301 : /* function exit code */
60302 0 : __pyx_L1_error:;
60303 0 : __Pyx_XDECREF(__pyx_t_1);
60304 0 : __Pyx_XDECREF(__pyx_t_2);
60305 0 : __Pyx_XDECREF(__pyx_t_4);
60306 0 : __Pyx_XDECREF(__pyx_t_5);
60307 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
60308 0 : __Pyx_PyThreadState_declare
60309 0 : __Pyx_PyThreadState_assign
60310 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
60311 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
60312 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
60313 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
60314 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
60315 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_rsvd", __pyx_clineno, __pyx_lineno, __pyx_filename);
60316 0 : __pyx_r = NULL;
60317 0 : goto __pyx_L2;
60318 1 : __pyx_L0:;
60319 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_col.rcbuffer->pybuffer);
60320 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_perms.rcbuffer->pybuffer);
60321 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_proj.rcbuffer->pybuffer);
60322 1 : __pyx_L2:;
60323 1 : __Pyx_XDECREF((PyObject *)__pyx_v_perms);
60324 1 : __Pyx_XDECREF((PyObject *)__pyx_v_proj);
60325 1 : __Pyx_XDECREF((PyObject *)__pyx_v_col);
60326 1 : __Pyx_XDECREF(__pyx_v_x);
60327 1 : __Pyx_XGIVEREF(__pyx_r);
60328 1 : __Pyx_RefNannyFinishContext();
60329 1 : return __pyx_r;
60330 : }
60331 :
60332 : /* "scipy/linalg/_decomp_interpolative.pyx":1931
60333 : *
60334 : *
60335 : * def idzr_svd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
60336 : * cdef int m = a.shape[0], n = a.shape[1], info = 0
60337 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
60338 : */
60339 :
60340 : /* Python wrapper */
60341 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_79idzr_svd(PyObject *__pyx_self,
60342 : #if CYTHON_METH_FASTCALL
60343 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
60344 : #else
60345 : PyObject *__pyx_args, PyObject *__pyx_kwds
60346 : #endif
60347 : ); /*proto*/
60348 : static PyMethodDef __pyx_mdef_5scipy_6linalg_21_decomp_interpolative_79idzr_svd = {"idzr_svd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_21_decomp_interpolative_79idzr_svd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
60349 1 : static PyObject *__pyx_pw_5scipy_6linalg_21_decomp_interpolative_79idzr_svd(PyObject *__pyx_self,
60350 : #if CYTHON_METH_FASTCALL
60351 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
60352 : #else
60353 : PyObject *__pyx_args, PyObject *__pyx_kwds
60354 : #endif
60355 : ) {
60356 1 : PyArrayObject *__pyx_v_a = 0;
60357 1 : int __pyx_v_krank;
60358 : #if !CYTHON_METH_FASTCALL
60359 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
60360 : #endif
60361 1 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
60362 1 : PyObject* values[2] = {0,0};
60363 1 : int __pyx_lineno = 0;
60364 1 : const char *__pyx_filename = NULL;
60365 1 : int __pyx_clineno = 0;
60366 1 : PyObject *__pyx_r = 0;
60367 : __Pyx_RefNannyDeclarations
60368 1 : __Pyx_RefNannySetupContext("idzr_svd (wrapper)", 0);
60369 : #if !CYTHON_METH_FASTCALL
60370 : #if CYTHON_ASSUME_SAFE_MACROS
60371 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
60372 : #else
60373 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
60374 : #endif
60375 : #endif
60376 1 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
60377 : {
60378 1 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_krank,0};
60379 1 : if (__pyx_kwds) {
60380 0 : Py_ssize_t kw_args;
60381 0 : switch (__pyx_nargs) {
60382 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
60383 0 : CYTHON_FALLTHROUGH;
60384 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
60385 0 : CYTHON_FALLTHROUGH;
60386 0 : case 0: break;
60387 0 : default: goto __pyx_L5_argtuple_error;
60388 : }
60389 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
60390 0 : switch (__pyx_nargs) {
60391 : case 0:
60392 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
60393 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
60394 0 : kw_args--;
60395 : }
60396 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
60397 0 : else goto __pyx_L5_argtuple_error;
60398 0 : CYTHON_FALLTHROUGH;
60399 : case 1:
60400 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_krank)) != 0)) {
60401 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
60402 0 : kw_args--;
60403 : }
60404 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
60405 : else {
60406 0 : __Pyx_RaiseArgtupleInvalid("idzr_svd", 1, 2, 2, 1); __PYX_ERR(0, 1931, __pyx_L3_error)
60407 : }
60408 : }
60409 0 : if (unlikely(kw_args > 0)) {
60410 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
60411 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "idzr_svd") < 0)) __PYX_ERR(0, 1931, __pyx_L3_error)
60412 : }
60413 1 : } else if (unlikely(__pyx_nargs != 2)) {
60414 0 : goto __pyx_L5_argtuple_error;
60415 : } else {
60416 1 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
60417 1 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
60418 : }
60419 1 : __pyx_v_a = ((PyArrayObject *)values[0]);
60420 1 : __pyx_v_krank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_krank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L3_error)
60421 : }
60422 1 : goto __pyx_L6_skip;
60423 0 : __pyx_L5_argtuple_error:;
60424 0 : __Pyx_RaiseArgtupleInvalid("idzr_svd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1931, __pyx_L3_error)
60425 1 : __pyx_L6_skip:;
60426 1 : goto __pyx_L4_argument_unpacking_done;
60427 0 : __pyx_L3_error:;
60428 : {
60429 0 : Py_ssize_t __pyx_temp;
60430 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
60431 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
60432 : }
60433 : }
60434 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
60435 0 : __Pyx_RefNannyFinishContext();
60436 0 : return NULL;
60437 1 : __pyx_L4_argument_unpacking_done:;
60438 1 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) __PYX_ERR(0, 1931, __pyx_L1_error)
60439 1 : __pyx_r = __pyx_pf_5scipy_6linalg_21_decomp_interpolative_78idzr_svd(__pyx_self, __pyx_v_a, __pyx_v_krank);
60440 :
60441 : /* function exit code */
60442 1 : goto __pyx_L0;
60443 0 : __pyx_L1_error:;
60444 0 : __pyx_r = NULL;
60445 1 : __pyx_L0:;
60446 : {
60447 1 : Py_ssize_t __pyx_temp;
60448 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
60449 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
60450 : }
60451 : }
60452 : __Pyx_RefNannyFinishContext();
60453 : return __pyx_r;
60454 : }
60455 :
60456 1 : static PyObject *__pyx_pf_5scipy_6linalg_21_decomp_interpolative_78idzr_svd(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_a, int __pyx_v_krank) {
60457 1 : int __pyx_v_m;
60458 1 : int __pyx_v_n;
60459 1 : int __pyx_v_info;
60460 1 : PyArrayObject *__pyx_v_taus = 0;
60461 1 : PyArrayObject *__pyx_v_inds = 0;
60462 1 : PyArrayObject *__pyx_v_UU = 0;
60463 1 : PyArrayObject *__pyx_v_C = 0;
60464 1 : PyObject *__pyx_v_r = NULL;
60465 1 : long __pyx_v_p;
60466 1 : PyObject *__pyx_v_S = NULL;
60467 1 : PyObject *__pyx_v_V = NULL;
60468 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_C;
60469 1 : __Pyx_Buffer __pyx_pybuffer_C;
60470 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_UU;
60471 1 : __Pyx_Buffer __pyx_pybuffer_UU;
60472 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_a;
60473 1 : __Pyx_Buffer __pyx_pybuffer_a;
60474 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_inds;
60475 1 : __Pyx_Buffer __pyx_pybuffer_inds;
60476 1 : __Pyx_LocalBuf_ND __pyx_pybuffernd_taus;
60477 1 : __Pyx_Buffer __pyx_pybuffer_taus;
60478 1 : PyObject *__pyx_r = NULL;
60479 : __Pyx_RefNannyDeclarations
60480 1 : npy_intp __pyx_t_1[2];
60481 1 : PyObject *__pyx_t_2 = NULL;
60482 1 : PyArrayObject *__pyx_t_3 = NULL;
60483 1 : int __pyx_t_4;
60484 1 : PyObject *__pyx_t_5 = NULL;
60485 1 : PyObject *__pyx_t_6 = NULL;
60486 1 : PyObject *__pyx_t_7 = NULL;
60487 1 : int __pyx_t_8;
60488 1 : int __pyx_t_9;
60489 1 : int __pyx_t_10;
60490 1 : PyObject *__pyx_t_11 = NULL;
60491 1 : PyObject *__pyx_t_12 = NULL;
60492 1 : PyObject *__pyx_t_13 = NULL;
60493 1 : unsigned int __pyx_t_14;
60494 1 : PyObject *(*__pyx_t_15)(PyObject *);
60495 1 : PyArrayObject *__pyx_t_16 = NULL;
60496 1 : PyArrayObject *__pyx_t_17 = NULL;
60497 1 : long __pyx_t_18;
60498 1 : Py_ssize_t __pyx_t_19;
60499 1 : PyObject *__pyx_t_20 = NULL;
60500 1 : PyObject *__pyx_t_21 = NULL;
60501 1 : PyObject *__pyx_t_22 = NULL;
60502 1 : PyArrayObject *__pyx_t_23 = NULL;
60503 1 : Py_ssize_t __pyx_t_24;
60504 1 : Py_ssize_t __pyx_t_25;
60505 1 : Py_ssize_t __pyx_t_26;
60506 1 : Py_ssize_t __pyx_t_27;
60507 1 : Py_ssize_t __pyx_t_28;
60508 1 : Py_ssize_t __pyx_t_29;
60509 1 : int __pyx_lineno = 0;
60510 1 : const char *__pyx_filename = NULL;
60511 1 : int __pyx_clineno = 0;
60512 1 : __Pyx_RefNannySetupContext("idzr_svd", 1);
60513 1 : __pyx_pybuffer_taus.pybuffer.buf = NULL;
60514 1 : __pyx_pybuffer_taus.refcount = 0;
60515 1 : __pyx_pybuffernd_taus.data = NULL;
60516 1 : __pyx_pybuffernd_taus.rcbuffer = &__pyx_pybuffer_taus;
60517 1 : __pyx_pybuffer_inds.pybuffer.buf = NULL;
60518 1 : __pyx_pybuffer_inds.refcount = 0;
60519 1 : __pyx_pybuffernd_inds.data = NULL;
60520 1 : __pyx_pybuffernd_inds.rcbuffer = &__pyx_pybuffer_inds;
60521 1 : __pyx_pybuffer_UU.pybuffer.buf = NULL;
60522 1 : __pyx_pybuffer_UU.refcount = 0;
60523 1 : __pyx_pybuffernd_UU.data = NULL;
60524 1 : __pyx_pybuffernd_UU.rcbuffer = &__pyx_pybuffer_UU;
60525 1 : __pyx_pybuffer_C.pybuffer.buf = NULL;
60526 1 : __pyx_pybuffer_C.refcount = 0;
60527 1 : __pyx_pybuffernd_C.data = NULL;
60528 1 : __pyx_pybuffernd_C.rcbuffer = &__pyx_pybuffer_C;
60529 1 : __pyx_pybuffer_a.pybuffer.buf = NULL;
60530 1 : __pyx_pybuffer_a.refcount = 0;
60531 1 : __pyx_pybuffernd_a.data = NULL;
60532 1 : __pyx_pybuffernd_a.rcbuffer = &__pyx_pybuffer_a;
60533 : {
60534 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60535 1 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a.rcbuffer->pybuffer, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 1931, __pyx_L1_error)
60536 : }
60537 1 : __pyx_pybuffernd_a.diminfo[0].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a.diminfo[0].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_a.diminfo[1].strides = __pyx_pybuffernd_a.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_a.diminfo[1].shape = __pyx_pybuffernd_a.rcbuffer->pybuffer.shape[1];
60538 :
60539 : /* "scipy/linalg/_decomp_interpolative.pyx":1932
60540 : *
60541 : * def idzr_svd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank):
60542 : * cdef int m = a.shape[0], n = a.shape[1], info = 0 # <<<<<<<<<<<<<<
60543 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
60544 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] inds
60545 : */
60546 1 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[0]);
60547 1 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_a))[1]);
60548 1 : __pyx_v_info = 0;
60549 :
60550 : /* "scipy/linalg/_decomp_interpolative.pyx":1937
60551 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] UU
60552 : * cdef cnp.ndarray[cnp.complex128_t, mode='fortran', ndim=2] C
60553 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0) # <<<<<<<<<<<<<<
60554 : *
60555 : * krank = min(krank, min(m, n))
60556 : */
60557 1 : __pyx_t_1[0] = __pyx_v_m;
60558 1 : __pyx_t_1[1] = __pyx_v_krank;
60559 1 : __pyx_t_2 = PyArray_ZEROS(2, __pyx_t_1, NPY_COMPLEX128, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error)
60560 1 : __Pyx_GOTREF(__pyx_t_2);
60561 1 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1937, __pyx_L1_error)
60562 1 : __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
60563 : {
60564 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60565 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
60566 1 : __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
60567 1 : if (unlikely(__pyx_t_4 < 0)) {
60568 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
60569 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_UU.rcbuffer->pybuffer, (PyObject*)__pyx_v_UU, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
60570 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
60571 : __Pyx_RaiseBufferFallbackError();
60572 : } else {
60573 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
60574 : }
60575 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
60576 : }
60577 1 : __pyx_pybuffernd_UU.diminfo[0].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_UU.diminfo[0].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_UU.diminfo[1].strides = __pyx_pybuffernd_UU.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_UU.diminfo[1].shape = __pyx_pybuffernd_UU.rcbuffer->pybuffer.shape[1];
60578 1 : if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
60579 : }
60580 1 : __pyx_t_3 = 0;
60581 1 : __pyx_v_UU = ((PyArrayObject *)__pyx_t_2);
60582 1 : __pyx_t_2 = 0;
60583 :
60584 : /* "scipy/linalg/_decomp_interpolative.pyx":1939
60585 : * UU = cnp.PyArray_ZEROS(2, [m, krank], cnp.NPY_COMPLEX128, 0)
60586 : *
60587 : * krank = min(krank, min(m, n)) # <<<<<<<<<<<<<<
60588 : * # Get the pivoted QR
60589 : * inds, taus = idzr_qrpiv(a, krank)
60590 : */
60591 1 : __pyx_t_4 = __pyx_v_n;
60592 1 : __pyx_t_8 = __pyx_v_m;
60593 1 : __pyx_t_10 = (__pyx_t_4 < __pyx_t_8);
60594 1 : if (__pyx_t_10) {
60595 : __pyx_t_9 = __pyx_t_4;
60596 : } else {
60597 : __pyx_t_9 = __pyx_t_8;
60598 : }
60599 1 : __pyx_t_4 = __pyx_t_9;
60600 1 : __pyx_t_9 = __pyx_v_krank;
60601 1 : __pyx_t_10 = (__pyx_t_4 < __pyx_t_9);
60602 1 : if (__pyx_t_10) {
60603 : __pyx_t_8 = __pyx_t_4;
60604 : } else {
60605 : __pyx_t_8 = __pyx_t_9;
60606 : }
60607 1 : __pyx_v_krank = __pyx_t_8;
60608 :
60609 : /* "scipy/linalg/_decomp_interpolative.pyx":1941
60610 : * krank = min(krank, min(m, n))
60611 : * # Get the pivoted QR
60612 : * inds, taus = idzr_qrpiv(a, krank) # <<<<<<<<<<<<<<
60613 : * r = np.triu(a[:krank, :])
60614 : * # Apply pivots in reverse
60615 : */
60616 1 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_idzr_qrpiv); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1941, __pyx_L1_error)
60617 1 : __Pyx_GOTREF(__pyx_t_11);
60618 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1941, __pyx_L1_error)
60619 1 : __Pyx_GOTREF(__pyx_t_12);
60620 1 : __pyx_t_13 = NULL;
60621 1 : __pyx_t_14 = 0;
60622 : #if CYTHON_UNPACK_METHODS
60623 1 : if (unlikely(PyMethod_Check(__pyx_t_11))) {
60624 0 : __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
60625 0 : if (likely(__pyx_t_13)) {
60626 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
60627 0 : __Pyx_INCREF(__pyx_t_13);
60628 0 : __Pyx_INCREF(function);
60629 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
60630 : __pyx_t_14 = 1;
60631 : }
60632 : }
60633 : #endif
60634 : {
60635 1 : PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_a), __pyx_t_12};
60636 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_14, 2+__pyx_t_14);
60637 1 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
60638 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60639 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error)
60640 1 : __Pyx_GOTREF(__pyx_t_2);
60641 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60642 : }
60643 1 : if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
60644 1 : PyObject* sequence = __pyx_t_2;
60645 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
60646 1 : if (unlikely(size != 2)) {
60647 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
60648 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
60649 0 : __PYX_ERR(0, 1941, __pyx_L1_error)
60650 : }
60651 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60652 1 : if (likely(PyTuple_CheckExact(sequence))) {
60653 1 : __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
60654 1 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
60655 : } else {
60656 0 : __pyx_t_11 = PyList_GET_ITEM(sequence, 0);
60657 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 1);
60658 : }
60659 1 : __Pyx_INCREF(__pyx_t_11);
60660 1 : __Pyx_INCREF(__pyx_t_12);
60661 : #else
60662 : __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1941, __pyx_L1_error)
60663 : __Pyx_GOTREF(__pyx_t_11);
60664 : __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1941, __pyx_L1_error)
60665 : __Pyx_GOTREF(__pyx_t_12);
60666 : #endif
60667 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60668 : } else {
60669 0 : Py_ssize_t index = -1;
60670 0 : __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1941, __pyx_L1_error)
60671 0 : __Pyx_GOTREF(__pyx_t_13);
60672 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60673 0 : __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13);
60674 0 : index = 0; __pyx_t_11 = __pyx_t_15(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L3_unpacking_failed;
60675 0 : __Pyx_GOTREF(__pyx_t_11);
60676 0 : index = 1; __pyx_t_12 = __pyx_t_15(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L3_unpacking_failed;
60677 0 : __Pyx_GOTREF(__pyx_t_12);
60678 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_13), 2) < 0) __PYX_ERR(0, 1941, __pyx_L1_error)
60679 0 : __pyx_t_15 = NULL;
60680 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60681 0 : goto __pyx_L4_unpacking_done;
60682 0 : __pyx_L3_unpacking_failed:;
60683 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60684 0 : __pyx_t_15 = NULL;
60685 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
60686 0 : __PYX_ERR(0, 1941, __pyx_L1_error)
60687 0 : __pyx_L4_unpacking_done:;
60688 : }
60689 1 : if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1941, __pyx_L1_error)
60690 1 : if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1941, __pyx_L1_error)
60691 1 : __pyx_t_16 = ((PyArrayObject *)__pyx_t_11);
60692 : {
60693 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60694 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
60695 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
60696 1 : if (unlikely(__pyx_t_8 < 0)) {
60697 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
60698 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
60699 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
60700 : __Pyx_RaiseBufferFallbackError();
60701 : } else {
60702 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
60703 : }
60704 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
60705 : }
60706 1 : __pyx_pybuffernd_inds.diminfo[0].strides = __pyx_pybuffernd_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inds.diminfo[0].shape = __pyx_pybuffernd_inds.rcbuffer->pybuffer.shape[0];
60707 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1941, __pyx_L1_error)
60708 : }
60709 1 : __pyx_t_16 = 0;
60710 1 : __pyx_v_inds = ((PyArrayObject *)__pyx_t_11);
60711 1 : __pyx_t_11 = 0;
60712 1 : __pyx_t_17 = ((PyArrayObject *)__pyx_t_12);
60713 : {
60714 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
60715 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
60716 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
60717 1 : if (unlikely(__pyx_t_8 < 0)) {
60718 0 : PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
60719 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_taus.rcbuffer->pybuffer, (PyObject*)__pyx_v_taus, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
60720 : Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
60721 : __Pyx_RaiseBufferFallbackError();
60722 : } else {
60723 0 : PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
60724 : }
60725 0 : __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
60726 : }
60727 1 : __pyx_pybuffernd_taus.diminfo[0].strides = __pyx_pybuffernd_taus.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_taus.diminfo[0].shape = __pyx_pybuffernd_taus.rcbuffer->pybuffer.shape[0];
60728 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1941, __pyx_L1_error)
60729 : }
60730 1 : __pyx_t_17 = 0;
60731 1 : __pyx_v_taus = ((PyArrayObject *)__pyx_t_12);
60732 1 : __pyx_t_12 = 0;
60733 :
60734 : /* "scipy/linalg/_decomp_interpolative.pyx":1942
60735 : * # Get the pivoted QR
60736 : * inds, taus = idzr_qrpiv(a, krank)
60737 : * r = np.triu(a[:krank, :]) # <<<<<<<<<<<<<<
60738 : * # Apply pivots in reverse
60739 : * for p in range(krank-1, -1, -1):
60740 : */
60741 1 : __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1942, __pyx_L1_error)
60742 1 : __Pyx_GOTREF(__pyx_t_12);
60743 1 : __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_triu); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1942, __pyx_L1_error)
60744 1 : __Pyx_GOTREF(__pyx_t_11);
60745 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60746 1 : __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1942, __pyx_L1_error)
60747 1 : __Pyx_GOTREF(__pyx_t_12);
60748 1 : __pyx_t_13 = PySlice_New(Py_None, __pyx_t_12, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1942, __pyx_L1_error)
60749 1 : __Pyx_GOTREF(__pyx_t_13);
60750 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60751 1 : __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1942, __pyx_L1_error)
60752 1 : __Pyx_GOTREF(__pyx_t_12);
60753 1 : __Pyx_GIVEREF(__pyx_t_13);
60754 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13)) __PYX_ERR(0, 1942, __pyx_L1_error);
60755 1 : __Pyx_INCREF(__pyx_slice__5);
60756 1 : __Pyx_GIVEREF(__pyx_slice__5);
60757 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__5)) __PYX_ERR(0, 1942, __pyx_L1_error);
60758 1 : __pyx_t_13 = 0;
60759 1 : __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1942, __pyx_L1_error)
60760 1 : __Pyx_GOTREF(__pyx_t_13);
60761 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60762 1 : __pyx_t_12 = NULL;
60763 1 : __pyx_t_14 = 0;
60764 : #if CYTHON_UNPACK_METHODS
60765 1 : if (unlikely(PyMethod_Check(__pyx_t_11))) {
60766 0 : __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
60767 0 : if (likely(__pyx_t_12)) {
60768 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
60769 0 : __Pyx_INCREF(__pyx_t_12);
60770 0 : __Pyx_INCREF(function);
60771 0 : __Pyx_DECREF_SET(__pyx_t_11, function);
60772 : __pyx_t_14 = 1;
60773 : }
60774 : }
60775 : #endif
60776 : {
60777 1 : PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
60778 1 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
60779 1 : __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
60780 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60781 1 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
60782 1 : __Pyx_GOTREF(__pyx_t_2);
60783 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60784 : }
60785 1 : __pyx_v_r = __pyx_t_2;
60786 1 : __pyx_t_2 = 0;
60787 :
60788 : /* "scipy/linalg/_decomp_interpolative.pyx":1944
60789 : * r = np.triu(a[:krank, :])
60790 : * # Apply pivots in reverse
60791 : * for p in range(krank-1, -1, -1): # <<<<<<<<<<<<<<
60792 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]]
60793 : *
60794 : */
60795 21 : for (__pyx_t_18 = (__pyx_v_krank - 1); __pyx_t_18 > -1L; __pyx_t_18-=1) {
60796 20 : __pyx_v_p = __pyx_t_18;
60797 :
60798 : /* "scipy/linalg/_decomp_interpolative.pyx":1945
60799 : * # Apply pivots in reverse
60800 : * for p in range(krank-1, -1, -1):
60801 : * r[:, [p, inds[p]]] = r[:, [inds[p], p]] # <<<<<<<<<<<<<<
60802 : *
60803 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
60804 : */
60805 20 : __pyx_t_19 = __pyx_v_p;
60806 20 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_inds.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error)
60807 20 : __Pyx_GOTREF(__pyx_t_2);
60808 20 : __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1945, __pyx_L1_error)
60809 20 : __Pyx_GOTREF(__pyx_t_11);
60810 20 : __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1945, __pyx_L1_error)
60811 20 : __Pyx_GOTREF(__pyx_t_13);
60812 20 : __Pyx_GIVEREF(__pyx_t_2);
60813 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error);
60814 20 : __Pyx_GIVEREF(__pyx_t_11);
60815 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_11)) __PYX_ERR(0, 1945, __pyx_L1_error);
60816 20 : __pyx_t_2 = 0;
60817 20 : __pyx_t_11 = 0;
60818 20 : __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1945, __pyx_L1_error)
60819 20 : __Pyx_GOTREF(__pyx_t_11);
60820 20 : __Pyx_INCREF(__pyx_slice__5);
60821 20 : __Pyx_GIVEREF(__pyx_slice__5);
60822 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_slice__5)) __PYX_ERR(0, 1945, __pyx_L1_error);
60823 20 : __Pyx_GIVEREF(__pyx_t_13);
60824 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13)) __PYX_ERR(0, 1945, __pyx_L1_error);
60825 20 : __pyx_t_13 = 0;
60826 20 : __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_r, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1945, __pyx_L1_error)
60827 20 : __Pyx_GOTREF(__pyx_t_13);
60828 20 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60829 20 : __pyx_t_11 = __Pyx_PyInt_From_long(__pyx_v_p); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1945, __pyx_L1_error)
60830 20 : __Pyx_GOTREF(__pyx_t_11);
60831 20 : __pyx_t_19 = __pyx_v_p;
60832 20 : __pyx_t_2 = __Pyx_PyInt_From_npy_int64((*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_inds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_inds.diminfo[0].strides))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error)
60833 20 : __Pyx_GOTREF(__pyx_t_2);
60834 20 : __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1945, __pyx_L1_error)
60835 20 : __Pyx_GOTREF(__pyx_t_12);
60836 20 : __Pyx_GIVEREF(__pyx_t_11);
60837 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_11)) __PYX_ERR(0, 1945, __pyx_L1_error);
60838 20 : __Pyx_GIVEREF(__pyx_t_2);
60839 20 : if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error);
60840 20 : __pyx_t_11 = 0;
60841 20 : __pyx_t_2 = 0;
60842 20 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error)
60843 20 : __Pyx_GOTREF(__pyx_t_2);
60844 20 : __Pyx_INCREF(__pyx_slice__5);
60845 20 : __Pyx_GIVEREF(__pyx_slice__5);
60846 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__5)) __PYX_ERR(0, 1945, __pyx_L1_error);
60847 20 : __Pyx_GIVEREF(__pyx_t_12);
60848 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12)) __PYX_ERR(0, 1945, __pyx_L1_error);
60849 20 : __pyx_t_12 = 0;
60850 20 : if (unlikely((PyObject_SetItem(__pyx_v_r, __pyx_t_2, __pyx_t_13) < 0))) __PYX_ERR(0, 1945, __pyx_L1_error)
60851 20 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60852 40 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60853 : }
60854 :
60855 : /* "scipy/linalg/_decomp_interpolative.pyx":1949
60856 : * # JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO
60857 : * # zgesvd()
60858 : * UU[:krank, :krank], S, V = la.svd(r, full_matrices=False) # <<<<<<<<<<<<<<
60859 : *
60860 : * # Apply Q to U via zunm2r
60861 : */
60862 1 : __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_la); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1949, __pyx_L1_error)
60863 1 : __Pyx_GOTREF(__pyx_t_13);
60864 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_svd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error)
60865 1 : __Pyx_GOTREF(__pyx_t_2);
60866 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60867 1 : __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1949, __pyx_L1_error)
60868 1 : __Pyx_GOTREF(__pyx_t_13);
60869 1 : __Pyx_INCREF(__pyx_v_r);
60870 1 : __Pyx_GIVEREF(__pyx_v_r);
60871 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_r)) __PYX_ERR(0, 1949, __pyx_L1_error);
60872 1 : __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1949, __pyx_L1_error)
60873 1 : __Pyx_GOTREF(__pyx_t_12);
60874 1 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
60875 1 : __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1949, __pyx_L1_error)
60876 1 : __Pyx_GOTREF(__pyx_t_11);
60877 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60878 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60879 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60880 1 : if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
60881 1 : PyObject* sequence = __pyx_t_11;
60882 1 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
60883 1 : if (unlikely(size != 3)) {
60884 0 : if (size > 3) __Pyx_RaiseTooManyValuesError(3);
60885 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
60886 0 : __PYX_ERR(0, 1949, __pyx_L1_error)
60887 : }
60888 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60889 1 : if (likely(PyTuple_CheckExact(sequence))) {
60890 1 : __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
60891 1 : __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
60892 1 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
60893 : } else {
60894 0 : __pyx_t_12 = PyList_GET_ITEM(sequence, 0);
60895 0 : __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
60896 0 : __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
60897 : }
60898 1 : __Pyx_INCREF(__pyx_t_12);
60899 1 : __Pyx_INCREF(__pyx_t_13);
60900 1 : __Pyx_INCREF(__pyx_t_2);
60901 : #else
60902 : __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1949, __pyx_L1_error)
60903 : __Pyx_GOTREF(__pyx_t_12);
60904 : __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1949, __pyx_L1_error)
60905 : __Pyx_GOTREF(__pyx_t_13);
60906 : __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error)
60907 : __Pyx_GOTREF(__pyx_t_2);
60908 : #endif
60909 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60910 : } else {
60911 0 : Py_ssize_t index = -1;
60912 0 : __pyx_t_20 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1949, __pyx_L1_error)
60913 0 : __Pyx_GOTREF(__pyx_t_20);
60914 0 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60915 0 : __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_20);
60916 0 : index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_20); if (unlikely(!__pyx_t_12)) goto __pyx_L7_unpacking_failed;
60917 0 : __Pyx_GOTREF(__pyx_t_12);
60918 0 : index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_20); if (unlikely(!__pyx_t_13)) goto __pyx_L7_unpacking_failed;
60919 0 : __Pyx_GOTREF(__pyx_t_13);
60920 0 : index = 2; __pyx_t_2 = __pyx_t_15(__pyx_t_20); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
60921 0 : __Pyx_GOTREF(__pyx_t_2);
60922 0 : if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_20), 3) < 0) __PYX_ERR(0, 1949, __pyx_L1_error)
60923 0 : __pyx_t_15 = NULL;
60924 0 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
60925 0 : goto __pyx_L8_unpacking_done;
60926 0 : __pyx_L7_unpacking_failed:;
60927 0 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
60928 0 : __pyx_t_15 = NULL;
60929 0 : if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
60930 0 : __PYX_ERR(0, 1949, __pyx_L1_error)
60931 0 : __pyx_L8_unpacking_done:;
60932 : }
60933 1 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1949, __pyx_L1_error)
60934 1 : __Pyx_GOTREF(__pyx_t_20);
60935 1 : __pyx_t_21 = PySlice_New(Py_None, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1949, __pyx_L1_error)
60936 1 : __Pyx_GOTREF(__pyx_t_21);
60937 1 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
60938 1 : __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1949, __pyx_L1_error)
60939 1 : __Pyx_GOTREF(__pyx_t_20);
60940 1 : __pyx_t_22 = PySlice_New(Py_None, __pyx_t_20, Py_None); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1949, __pyx_L1_error)
60941 1 : __Pyx_GOTREF(__pyx_t_22);
60942 1 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
60943 1 : __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1949, __pyx_L1_error)
60944 1 : __Pyx_GOTREF(__pyx_t_20);
60945 1 : __Pyx_GIVEREF(__pyx_t_21);
60946 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21)) __PYX_ERR(0, 1949, __pyx_L1_error);
60947 1 : __Pyx_GIVEREF(__pyx_t_22);
60948 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22)) __PYX_ERR(0, 1949, __pyx_L1_error);
60949 1 : __pyx_t_21 = 0;
60950 1 : __pyx_t_22 = 0;
60951 1 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_UU), __pyx_t_20, __pyx_t_12) < 0))) __PYX_ERR(0, 1949, __pyx_L1_error)
60952 1 : __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
60953 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60954 1 : __pyx_v_S = __pyx_t_13;
60955 1 : __pyx_t_13 = 0;
60956 1 : __pyx_v_V = __pyx_t_2;
60957 1 : __pyx_t_2 = 0;
60958 :
60959 : /* "scipy/linalg/_decomp_interpolative.pyx":1952
60960 : *
60961 : * # Apply Q to U via zunm2r
60962 : * np.conjugate(taus, out=taus) # <<<<<<<<<<<<<<
60963 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
60964 : * C = a[:, :krank].conj().copy(order='F')
60965 : */
60966 1 : __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1952, __pyx_L1_error)
60967 1 : __Pyx_GOTREF(__pyx_t_11);
60968 1 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error)
60969 1 : __Pyx_GOTREF(__pyx_t_2);
60970 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60971 1 : __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1952, __pyx_L1_error)
60972 1 : __Pyx_GOTREF(__pyx_t_11);
60973 1 : __Pyx_INCREF((PyObject *)__pyx_v_taus);
60974 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_taus);
60975 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_taus))) __PYX_ERR(0, 1952, __pyx_L1_error);
60976 1 : __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1952, __pyx_L1_error)
60977 1 : __Pyx_GOTREF(__pyx_t_13);
60978 1 : if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_out, ((PyObject *)__pyx_v_taus)) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
60979 1 : __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1952, __pyx_L1_error)
60980 1 : __Pyx_GOTREF(__pyx_t_12);
60981 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60982 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
60983 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60984 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
60985 :
60986 : /* "scipy/linalg/_decomp_interpolative.pyx":1954
60987 : * np.conjugate(taus, out=taus)
60988 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
60989 : * C = a[:, :krank].conj().copy(order='F') # <<<<<<<<<<<<<<
60990 : * zunm2r(<char*>'R', <char*>'C',
60991 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
60992 : */
60993 1 : __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_krank); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1954, __pyx_L1_error)
60994 1 : __Pyx_GOTREF(__pyx_t_13);
60995 1 : __pyx_t_11 = PySlice_New(Py_None, __pyx_t_13, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1954, __pyx_L1_error)
60996 1 : __Pyx_GOTREF(__pyx_t_11);
60997 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
60998 1 : __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1954, __pyx_L1_error)
60999 1 : __Pyx_GOTREF(__pyx_t_13);
61000 1 : __Pyx_INCREF(__pyx_slice__5);
61001 1 : __Pyx_GIVEREF(__pyx_slice__5);
61002 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_slice__5)) __PYX_ERR(0, 1954, __pyx_L1_error);
61003 1 : __Pyx_GIVEREF(__pyx_t_11);
61004 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11)) __PYX_ERR(0, 1954, __pyx_L1_error);
61005 1 : __pyx_t_11 = 0;
61006 1 : __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_a), __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1954, __pyx_L1_error)
61007 1 : __Pyx_GOTREF(__pyx_t_11);
61008 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
61009 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_conj); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1954, __pyx_L1_error)
61010 1 : __Pyx_GOTREF(__pyx_t_13);
61011 1 : __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
61012 1 : __pyx_t_11 = NULL;
61013 1 : __pyx_t_14 = 0;
61014 : #if CYTHON_UNPACK_METHODS
61015 1 : if (likely(PyMethod_Check(__pyx_t_13))) {
61016 0 : __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
61017 0 : if (likely(__pyx_t_11)) {
61018 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
61019 0 : __Pyx_INCREF(__pyx_t_11);
61020 0 : __Pyx_INCREF(function);
61021 0 : __Pyx_DECREF_SET(__pyx_t_13, function);
61022 : __pyx_t_14 = 1;
61023 : }
61024 : }
61025 : #endif
61026 : {
61027 1 : PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
61028 1 : __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14);
61029 1 : __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
61030 1 : if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1954, __pyx_L1_error)
61031 1 : __Pyx_GOTREF(__pyx_t_12);
61032 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
61033 : }
61034 1 : __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_copy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1954, __pyx_L1_error)
61035 1 : __Pyx_GOTREF(__pyx_t_13);
61036 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
61037 1 : __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1954, __pyx_L1_error)
61038 1 : __Pyx_GOTREF(__pyx_t_12);
61039 1 : if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 1954, __pyx_L1_error)
61040 1 : __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1954, __pyx_L1_error)
61041 1 : __Pyx_GOTREF(__pyx_t_11);
61042 1 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
61043 1 : __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
61044 1 : if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1954, __pyx_L1_error)
61045 1 : __pyx_t_23 = ((PyArrayObject *)__pyx_t_11);
61046 : {
61047 1 : __Pyx_BufFmt_StackElem __pyx_stack[1];
61048 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
61049 1 : __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack);
61050 1 : if (unlikely(__pyx_t_8 < 0)) {
61051 0 : PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
61052 0 : if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_v_C, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
61053 : Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
61054 : __Pyx_RaiseBufferFallbackError();
61055 : } else {
61056 0 : PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
61057 : }
61058 0 : __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
61059 : }
61060 1 : __pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_C.diminfo[1].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_C.diminfo[1].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[1];
61061 1 : if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1954, __pyx_L1_error)
61062 : }
61063 1 : __pyx_t_23 = 0;
61064 1 : __pyx_v_C = ((PyArrayObject *)__pyx_t_11);
61065 1 : __pyx_t_11 = 0;
61066 :
61067 : /* "scipy/linalg/_decomp_interpolative.pyx":1956
61068 : * C = a[:, :krank].conj().copy(order='F')
61069 : * zunm2r(<char*>'R', <char*>'C',
61070 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0], # <<<<<<<<<<<<<<
61071 : * &UU[0,0], &krank, &a[0, 0], &info)
61072 : *
61073 : */
61074 1 : __pyx_t_19 = 0;
61075 1 : __pyx_t_24 = 0;
61076 1 : __pyx_t_25 = 0;
61077 :
61078 : /* "scipy/linalg/_decomp_interpolative.pyx":1957
61079 : * zunm2r(<char*>'R', <char*>'C',
61080 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
61081 : * &UU[0,0], &krank, &a[0, 0], &info) # <<<<<<<<<<<<<<
61082 : *
61083 : * return UU, S, V
61084 : */
61085 1 : __pyx_t_26 = 0;
61086 1 : __pyx_t_27 = 0;
61087 1 : __pyx_t_28 = 0;
61088 1 : __pyx_t_29 = 0;
61089 :
61090 : /* "scipy/linalg/_decomp_interpolative.pyx":1955
61091 : * # But do the adjoint dance for LAPACK via U.H @ Q.H; use a for scratch
61092 : * C = a[:, :krank].conj().copy(order='F')
61093 : * zunm2r(<char*>'R', <char*>'C', # <<<<<<<<<<<<<<
61094 : * &krank, &m, &krank, &C[0, 0], &m, &taus[0],
61095 : * &UU[0,0], &krank, &a[0, 0], &info)
61096 : */
61097 1 : __pyx_f_5scipy_6linalg_13cython_lapack_zunm2r(((char *)((char *)"R")), ((char *)((char *)"C")), (&__pyx_v_krank), (&__pyx_v_m), (&__pyx_v_krank), (&(*__Pyx_BufPtrFortranContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_C.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_C.diminfo[1].strides))), (&__pyx_v_m), (&(*__Pyx_BufPtrCContig1d(__pyx_t_double_complex *, __pyx_pybuffernd_taus.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_taus.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_UU.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_UU.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_UU.diminfo[1].strides))), (&__pyx_v_krank), (&(*__Pyx_BufPtrCContig2d(__pyx_t_double_complex *, __pyx_pybuffernd_a.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_a.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_a.diminfo[1].strides))), (&__pyx_v_info));
61098 :
61099 : /* "scipy/linalg/_decomp_interpolative.pyx":1959
61100 : * &UU[0,0], &krank, &a[0, 0], &info)
61101 : *
61102 : * return UU, S, V # <<<<<<<<<<<<<<
61103 : */
61104 1 : __Pyx_XDECREF(__pyx_r);
61105 1 : __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1959, __pyx_L1_error)
61106 1 : __Pyx_GOTREF(__pyx_t_11);
61107 1 : __Pyx_INCREF((PyObject *)__pyx_v_UU);
61108 1 : __Pyx_GIVEREF((PyObject *)__pyx_v_UU);
61109 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_UU))) __PYX_ERR(0, 1959, __pyx_L1_error);
61110 1 : __Pyx_INCREF(__pyx_v_S);
61111 1 : __Pyx_GIVEREF(__pyx_v_S);
61112 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_S)) __PYX_ERR(0, 1959, __pyx_L1_error);
61113 1 : __Pyx_INCREF(__pyx_v_V);
61114 1 : __Pyx_GIVEREF(__pyx_v_V);
61115 1 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_V)) __PYX_ERR(0, 1959, __pyx_L1_error);
61116 1 : __pyx_r = __pyx_t_11;
61117 1 : __pyx_t_11 = 0;
61118 1 : goto __pyx_L0;
61119 :
61120 : /* "scipy/linalg/_decomp_interpolative.pyx":1931
61121 : *
61122 : *
61123 : * def idzr_svd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
61124 : * cdef int m = a.shape[0], n = a.shape[1], info = 0
61125 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
61126 : */
61127 :
61128 : /* function exit code */
61129 0 : __pyx_L1_error:;
61130 0 : __Pyx_XDECREF(__pyx_t_2);
61131 0 : __Pyx_XDECREF(__pyx_t_11);
61132 0 : __Pyx_XDECREF(__pyx_t_12);
61133 0 : __Pyx_XDECREF(__pyx_t_13);
61134 0 : __Pyx_XDECREF(__pyx_t_20);
61135 0 : __Pyx_XDECREF(__pyx_t_21);
61136 0 : __Pyx_XDECREF(__pyx_t_22);
61137 0 : { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
61138 0 : __Pyx_PyThreadState_declare
61139 0 : __Pyx_PyThreadState_assign
61140 0 : __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
61141 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
61142 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
61143 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
61144 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
61145 0 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
61146 0 : __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
61147 0 : __Pyx_AddTraceback("scipy.linalg._decomp_interpolative.idzr_svd", __pyx_clineno, __pyx_lineno, __pyx_filename);
61148 0 : __pyx_r = NULL;
61149 0 : goto __pyx_L2;
61150 1 : __pyx_L0:;
61151 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_C.rcbuffer->pybuffer);
61152 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_UU.rcbuffer->pybuffer);
61153 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a.rcbuffer->pybuffer);
61154 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inds.rcbuffer->pybuffer);
61155 1 : __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_taus.rcbuffer->pybuffer);
61156 1 : __pyx_L2:;
61157 1 : __Pyx_XDECREF((PyObject *)__pyx_v_taus);
61158 1 : __Pyx_XDECREF((PyObject *)__pyx_v_inds);
61159 1 : __Pyx_XDECREF((PyObject *)__pyx_v_UU);
61160 1 : __Pyx_XDECREF((PyObject *)__pyx_v_C);
61161 1 : __Pyx_XDECREF(__pyx_v_r);
61162 1 : __Pyx_XDECREF(__pyx_v_S);
61163 1 : __Pyx_XDECREF(__pyx_v_V);
61164 1 : __Pyx_XGIVEREF(__pyx_r);
61165 1 : __Pyx_RefNannyFinishContext();
61166 1 : return __pyx_r;
61167 : }
61168 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
61169 :
61170 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
61171 0 : struct __pyx_array_obj *p;
61172 0 : PyObject *o;
61173 : #if CYTHON_COMPILING_IN_LIMITED_API
61174 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
61175 : o = alloc_func(t, 0);
61176 : #else
61177 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
61178 0 : o = (*t->tp_alloc)(t, 0);
61179 : } else {
61180 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61181 : }
61182 0 : if (unlikely(!o)) return 0;
61183 : #endif
61184 0 : p = ((struct __pyx_array_obj *)o);
61185 0 : p->__pyx_vtab = __pyx_vtabptr_array;
61186 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
61187 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
61188 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
61189 : return o;
61190 0 : bad:
61191 0 : Py_DECREF(o); o = 0;
61192 : return NULL;
61193 : }
61194 :
61195 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
61196 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
61197 : #if CYTHON_USE_TP_FINALIZE
61198 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
61199 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
61200 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
61201 : }
61202 : }
61203 : #endif
61204 : {
61205 0 : PyObject *etype, *eval, *etb;
61206 0 : PyErr_Fetch(&etype, &eval, &etb);
61207 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
61208 0 : __pyx_array___dealloc__(o);
61209 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
61210 0 : PyErr_Restore(etype, eval, etb);
61211 : }
61212 0 : Py_CLEAR(p->mode);
61213 0 : Py_CLEAR(p->_format);
61214 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
61215 0 : (*Py_TYPE(o)->tp_free)(o);
61216 : #else
61217 : {
61218 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
61219 : if (tp_free) tp_free(o);
61220 : }
61221 : #endif
61222 : }
61223 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
61224 0 : PyObject *r;
61225 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
61226 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
61227 0 : Py_DECREF(x);
61228 : return r;
61229 : }
61230 :
61231 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
61232 0 : if (v) {
61233 0 : return __pyx_array___setitem__(o, i, v);
61234 : }
61235 : else {
61236 0 : __Pyx_TypeName o_type_name;
61237 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
61238 0 : PyErr_Format(PyExc_NotImplementedError,
61239 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
61240 0 : __Pyx_DECREF_TypeName(o_type_name);
61241 0 : return -1;
61242 : }
61243 : }
61244 :
61245 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
61246 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
61247 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
61248 0 : PyErr_Clear();
61249 0 : v = __pyx_array___getattr__(o, n);
61250 : }
61251 0 : return v;
61252 : }
61253 :
61254 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
61255 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
61256 : }
61257 :
61258 : static PyMethodDef __pyx_methods_array[] = {
61259 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
61260 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61261 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61262 : {0, 0, 0, 0}
61263 : };
61264 :
61265 : static struct PyGetSetDef __pyx_getsets_array[] = {
61266 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
61267 : {0, 0, 0, 0, 0}
61268 : };
61269 : #if CYTHON_USE_TYPE_SPECS
61270 : #if !CYTHON_COMPILING_IN_LIMITED_API
61271 :
61272 : static PyBufferProcs __pyx_tp_as_buffer_array = {
61273 : #if PY_MAJOR_VERSION < 3
61274 : 0, /*bf_getreadbuffer*/
61275 : #endif
61276 : #if PY_MAJOR_VERSION < 3
61277 : 0, /*bf_getwritebuffer*/
61278 : #endif
61279 : #if PY_MAJOR_VERSION < 3
61280 : 0, /*bf_getsegcount*/
61281 : #endif
61282 : #if PY_MAJOR_VERSION < 3
61283 : 0, /*bf_getcharbuffer*/
61284 : #endif
61285 : __pyx_array_getbuffer, /*bf_getbuffer*/
61286 : 0, /*bf_releasebuffer*/
61287 : };
61288 : #endif
61289 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
61290 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
61291 : {Py_sq_length, (void *)__pyx_array___len__},
61292 : {Py_sq_item, (void *)__pyx_sq_item_array},
61293 : {Py_mp_length, (void *)__pyx_array___len__},
61294 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
61295 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
61296 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
61297 : #if defined(Py_bf_getbuffer)
61298 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
61299 : #endif
61300 : {Py_tp_methods, (void *)__pyx_methods_array},
61301 : {Py_tp_getset, (void *)__pyx_getsets_array},
61302 : {Py_tp_new, (void *)__pyx_tp_new_array},
61303 : {0, 0},
61304 : };
61305 : static PyType_Spec __pyx_type___pyx_array_spec = {
61306 : "scipy.linalg._decomp_interpolative.array",
61307 : sizeof(struct __pyx_array_obj),
61308 : 0,
61309 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
61310 : __pyx_type___pyx_array_slots,
61311 : };
61312 : #else
61313 :
61314 : static PySequenceMethods __pyx_tp_as_sequence_array = {
61315 : __pyx_array___len__, /*sq_length*/
61316 : 0, /*sq_concat*/
61317 : 0, /*sq_repeat*/
61318 : __pyx_sq_item_array, /*sq_item*/
61319 : 0, /*sq_slice*/
61320 : 0, /*sq_ass_item*/
61321 : 0, /*sq_ass_slice*/
61322 : 0, /*sq_contains*/
61323 : 0, /*sq_inplace_concat*/
61324 : 0, /*sq_inplace_repeat*/
61325 : };
61326 :
61327 : static PyMappingMethods __pyx_tp_as_mapping_array = {
61328 : __pyx_array___len__, /*mp_length*/
61329 : __pyx_array___getitem__, /*mp_subscript*/
61330 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
61331 : };
61332 :
61333 : static PyBufferProcs __pyx_tp_as_buffer_array = {
61334 : #if PY_MAJOR_VERSION < 3
61335 : 0, /*bf_getreadbuffer*/
61336 : #endif
61337 : #if PY_MAJOR_VERSION < 3
61338 : 0, /*bf_getwritebuffer*/
61339 : #endif
61340 : #if PY_MAJOR_VERSION < 3
61341 : 0, /*bf_getsegcount*/
61342 : #endif
61343 : #if PY_MAJOR_VERSION < 3
61344 : 0, /*bf_getcharbuffer*/
61345 : #endif
61346 : __pyx_array_getbuffer, /*bf_getbuffer*/
61347 : 0, /*bf_releasebuffer*/
61348 : };
61349 :
61350 : static PyTypeObject __pyx_type___pyx_array = {
61351 : PyVarObject_HEAD_INIT(0, 0)
61352 : "scipy.linalg._decomp_interpolative.""array", /*tp_name*/
61353 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
61354 : 0, /*tp_itemsize*/
61355 : __pyx_tp_dealloc_array, /*tp_dealloc*/
61356 : #if PY_VERSION_HEX < 0x030800b4
61357 : 0, /*tp_print*/
61358 : #endif
61359 : #if PY_VERSION_HEX >= 0x030800b4
61360 : 0, /*tp_vectorcall_offset*/
61361 : #endif
61362 : 0, /*tp_getattr*/
61363 : 0, /*tp_setattr*/
61364 : #if PY_MAJOR_VERSION < 3
61365 : 0, /*tp_compare*/
61366 : #endif
61367 : #if PY_MAJOR_VERSION >= 3
61368 : 0, /*tp_as_async*/
61369 : #endif
61370 : 0, /*tp_repr*/
61371 : 0, /*tp_as_number*/
61372 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
61373 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
61374 : 0, /*tp_hash*/
61375 : 0, /*tp_call*/
61376 : 0, /*tp_str*/
61377 : __pyx_tp_getattro_array, /*tp_getattro*/
61378 : 0, /*tp_setattro*/
61379 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
61380 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
61381 : 0, /*tp_doc*/
61382 : 0, /*tp_traverse*/
61383 : 0, /*tp_clear*/
61384 : 0, /*tp_richcompare*/
61385 : 0, /*tp_weaklistoffset*/
61386 : 0, /*tp_iter*/
61387 : 0, /*tp_iternext*/
61388 : __pyx_methods_array, /*tp_methods*/
61389 : 0, /*tp_members*/
61390 : __pyx_getsets_array, /*tp_getset*/
61391 : 0, /*tp_base*/
61392 : 0, /*tp_dict*/
61393 : 0, /*tp_descr_get*/
61394 : 0, /*tp_descr_set*/
61395 : #if !CYTHON_USE_TYPE_SPECS
61396 : 0, /*tp_dictoffset*/
61397 : #endif
61398 : 0, /*tp_init*/
61399 : 0, /*tp_alloc*/
61400 : __pyx_tp_new_array, /*tp_new*/
61401 : 0, /*tp_free*/
61402 : 0, /*tp_is_gc*/
61403 : 0, /*tp_bases*/
61404 : 0, /*tp_mro*/
61405 : 0, /*tp_cache*/
61406 : 0, /*tp_subclasses*/
61407 : 0, /*tp_weaklist*/
61408 : 0, /*tp_del*/
61409 : 0, /*tp_version_tag*/
61410 : #if PY_VERSION_HEX >= 0x030400a1
61411 : #if CYTHON_USE_TP_FINALIZE
61412 : 0, /*tp_finalize*/
61413 : #else
61414 : NULL, /*tp_finalize*/
61415 : #endif
61416 : #endif
61417 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
61418 : 0, /*tp_vectorcall*/
61419 : #endif
61420 : #if __PYX_NEED_TP_PRINT_SLOT == 1
61421 : 0, /*tp_print*/
61422 : #endif
61423 : #if PY_VERSION_HEX >= 0x030C0000
61424 : 0, /*tp_watched*/
61425 : #endif
61426 : #if PY_VERSION_HEX >= 0x030d00A4
61427 : 0, /*tp_versions_used*/
61428 : #endif
61429 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
61430 : 0, /*tp_pypy_flags*/
61431 : #endif
61432 : };
61433 : #endif
61434 :
61435 15 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
61436 15 : struct __pyx_MemviewEnum_obj *p;
61437 15 : PyObject *o;
61438 : #if CYTHON_COMPILING_IN_LIMITED_API
61439 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
61440 : o = alloc_func(t, 0);
61441 : #else
61442 15 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
61443 15 : o = (*t->tp_alloc)(t, 0);
61444 : } else {
61445 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61446 : }
61447 15 : if (unlikely(!o)) return 0;
61448 : #endif
61449 15 : p = ((struct __pyx_MemviewEnum_obj *)o);
61450 15 : p->name = Py_None; Py_INCREF(Py_None);
61451 : return o;
61452 : }
61453 :
61454 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
61455 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
61456 : #if CYTHON_USE_TP_FINALIZE
61457 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
61458 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
61459 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
61460 : }
61461 : }
61462 : #endif
61463 0 : PyObject_GC_UnTrack(o);
61464 0 : Py_CLEAR(p->name);
61465 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
61466 0 : (*Py_TYPE(o)->tp_free)(o);
61467 : #else
61468 : {
61469 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
61470 : if (tp_free) tp_free(o);
61471 : }
61472 : #endif
61473 : }
61474 :
61475 795 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
61476 795 : int e;
61477 795 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
61478 795 : if (p->name) {
61479 795 : e = (*v)(p->name, a); if (e) return e;
61480 : }
61481 : return 0;
61482 : }
61483 :
61484 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
61485 0 : PyObject* tmp;
61486 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
61487 0 : tmp = ((PyObject*)p->name);
61488 0 : p->name = Py_None; Py_INCREF(Py_None);
61489 0 : Py_XDECREF(tmp);
61490 0 : return 0;
61491 : }
61492 :
61493 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
61494 0 : return __pyx_MemviewEnum___repr__(self);
61495 : }
61496 :
61497 : static PyMethodDef __pyx_methods_Enum[] = {
61498 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
61499 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61500 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61501 : {0, 0, 0, 0}
61502 : };
61503 : #if CYTHON_USE_TYPE_SPECS
61504 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
61505 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
61506 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
61507 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
61508 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
61509 : {Py_tp_methods, (void *)__pyx_methods_Enum},
61510 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
61511 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
61512 : {0, 0},
61513 : };
61514 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
61515 : "scipy.linalg._decomp_interpolative.Enum",
61516 : sizeof(struct __pyx_MemviewEnum_obj),
61517 : 0,
61518 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
61519 : __pyx_type___pyx_MemviewEnum_slots,
61520 : };
61521 : #else
61522 :
61523 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
61524 : PyVarObject_HEAD_INIT(0, 0)
61525 : "scipy.linalg._decomp_interpolative.""Enum", /*tp_name*/
61526 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
61527 : 0, /*tp_itemsize*/
61528 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
61529 : #if PY_VERSION_HEX < 0x030800b4
61530 : 0, /*tp_print*/
61531 : #endif
61532 : #if PY_VERSION_HEX >= 0x030800b4
61533 : 0, /*tp_vectorcall_offset*/
61534 : #endif
61535 : 0, /*tp_getattr*/
61536 : 0, /*tp_setattr*/
61537 : #if PY_MAJOR_VERSION < 3
61538 : 0, /*tp_compare*/
61539 : #endif
61540 : #if PY_MAJOR_VERSION >= 3
61541 : 0, /*tp_as_async*/
61542 : #endif
61543 : __pyx_MemviewEnum___repr__, /*tp_repr*/
61544 : 0, /*tp_as_number*/
61545 : 0, /*tp_as_sequence*/
61546 : 0, /*tp_as_mapping*/
61547 : 0, /*tp_hash*/
61548 : 0, /*tp_call*/
61549 : 0, /*tp_str*/
61550 : 0, /*tp_getattro*/
61551 : 0, /*tp_setattro*/
61552 : 0, /*tp_as_buffer*/
61553 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
61554 : 0, /*tp_doc*/
61555 : __pyx_tp_traverse_Enum, /*tp_traverse*/
61556 : __pyx_tp_clear_Enum, /*tp_clear*/
61557 : 0, /*tp_richcompare*/
61558 : 0, /*tp_weaklistoffset*/
61559 : 0, /*tp_iter*/
61560 : 0, /*tp_iternext*/
61561 : __pyx_methods_Enum, /*tp_methods*/
61562 : 0, /*tp_members*/
61563 : 0, /*tp_getset*/
61564 : 0, /*tp_base*/
61565 : 0, /*tp_dict*/
61566 : 0, /*tp_descr_get*/
61567 : 0, /*tp_descr_set*/
61568 : #if !CYTHON_USE_TYPE_SPECS
61569 : 0, /*tp_dictoffset*/
61570 : #endif
61571 : __pyx_MemviewEnum___init__, /*tp_init*/
61572 : 0, /*tp_alloc*/
61573 : __pyx_tp_new_Enum, /*tp_new*/
61574 : 0, /*tp_free*/
61575 : 0, /*tp_is_gc*/
61576 : 0, /*tp_bases*/
61577 : 0, /*tp_mro*/
61578 : 0, /*tp_cache*/
61579 : 0, /*tp_subclasses*/
61580 : 0, /*tp_weaklist*/
61581 : 0, /*tp_del*/
61582 : 0, /*tp_version_tag*/
61583 : #if PY_VERSION_HEX >= 0x030400a1
61584 : #if CYTHON_USE_TP_FINALIZE
61585 : 0, /*tp_finalize*/
61586 : #else
61587 : NULL, /*tp_finalize*/
61588 : #endif
61589 : #endif
61590 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
61591 : 0, /*tp_vectorcall*/
61592 : #endif
61593 : #if __PYX_NEED_TP_PRINT_SLOT == 1
61594 : 0, /*tp_print*/
61595 : #endif
61596 : #if PY_VERSION_HEX >= 0x030C0000
61597 : 0, /*tp_watched*/
61598 : #endif
61599 : #if PY_VERSION_HEX >= 0x030d00A4
61600 : 0, /*tp_versions_used*/
61601 : #endif
61602 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
61603 : 0, /*tp_pypy_flags*/
61604 : #endif
61605 : };
61606 : #endif
61607 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
61608 :
61609 219 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
61610 219 : struct __pyx_memoryview_obj *p;
61611 219 : PyObject *o;
61612 : #if CYTHON_COMPILING_IN_LIMITED_API
61613 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
61614 : o = alloc_func(t, 0);
61615 : #else
61616 219 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
61617 219 : o = (*t->tp_alloc)(t, 0);
61618 : } else {
61619 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61620 : }
61621 219 : if (unlikely(!o)) return 0;
61622 : #endif
61623 219 : p = ((struct __pyx_memoryview_obj *)o);
61624 219 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
61625 219 : p->obj = Py_None; Py_INCREF(Py_None);
61626 219 : p->_size = Py_None; Py_INCREF(Py_None);
61627 219 : p->_array_interface = Py_None; Py_INCREF(Py_None);
61628 219 : p->view.obj = NULL;
61629 219 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
61630 : return o;
61631 0 : bad:
61632 0 : Py_DECREF(o); o = 0;
61633 : return NULL;
61634 : }
61635 :
61636 219 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
61637 219 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
61638 : #if CYTHON_USE_TP_FINALIZE
61639 219 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
61640 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
61641 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
61642 : }
61643 : }
61644 : #endif
61645 219 : PyObject_GC_UnTrack(o);
61646 : {
61647 219 : PyObject *etype, *eval, *etb;
61648 219 : PyErr_Fetch(&etype, &eval, &etb);
61649 219 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
61650 219 : __pyx_memoryview___dealloc__(o);
61651 219 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
61652 219 : PyErr_Restore(etype, eval, etb);
61653 : }
61654 219 : Py_CLEAR(p->obj);
61655 219 : Py_CLEAR(p->_size);
61656 219 : Py_CLEAR(p->_array_interface);
61657 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
61658 219 : (*Py_TYPE(o)->tp_free)(o);
61659 : #else
61660 : {
61661 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
61662 : if (tp_free) tp_free(o);
61663 : }
61664 : #endif
61665 : }
61666 :
61667 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
61668 0 : int e;
61669 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
61670 0 : if (p->obj) {
61671 0 : e = (*v)(p->obj, a); if (e) return e;
61672 : }
61673 0 : if (p->_size) {
61674 0 : e = (*v)(p->_size, a); if (e) return e;
61675 : }
61676 0 : if (p->_array_interface) {
61677 0 : e = (*v)(p->_array_interface, a); if (e) return e;
61678 : }
61679 0 : if (p->view.obj) {
61680 0 : e = (*v)(p->view.obj, a); if (e) return e;
61681 : }
61682 : return 0;
61683 : }
61684 :
61685 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
61686 0 : PyObject* tmp;
61687 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
61688 0 : tmp = ((PyObject*)p->obj);
61689 0 : p->obj = Py_None; Py_INCREF(Py_None);
61690 0 : Py_XDECREF(tmp);
61691 0 : tmp = ((PyObject*)p->_size);
61692 0 : p->_size = Py_None; Py_INCREF(Py_None);
61693 0 : Py_XDECREF(tmp);
61694 0 : tmp = ((PyObject*)p->_array_interface);
61695 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
61696 0 : Py_XDECREF(tmp);
61697 0 : Py_CLEAR(p->view.obj);
61698 0 : return 0;
61699 : }
61700 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
61701 0 : PyObject *r;
61702 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
61703 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
61704 0 : Py_DECREF(x);
61705 : return r;
61706 : }
61707 :
61708 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
61709 0 : if (v) {
61710 0 : return __pyx_memoryview___setitem__(o, i, v);
61711 : }
61712 : else {
61713 0 : __Pyx_TypeName o_type_name;
61714 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
61715 0 : PyErr_Format(PyExc_NotImplementedError,
61716 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
61717 0 : __Pyx_DECREF_TypeName(o_type_name);
61718 0 : return -1;
61719 : }
61720 : }
61721 :
61722 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
61723 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
61724 : }
61725 :
61726 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
61727 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
61728 : }
61729 :
61730 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
61731 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
61732 : }
61733 :
61734 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
61735 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
61736 : }
61737 :
61738 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
61739 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
61740 : }
61741 :
61742 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
61743 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
61744 : }
61745 :
61746 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
61747 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
61748 : }
61749 :
61750 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
61751 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
61752 : }
61753 :
61754 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
61755 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
61756 : }
61757 :
61758 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
61759 0 : return __pyx_memoryview___repr__(self);
61760 : }
61761 :
61762 : static PyMethodDef __pyx_methods_memoryview[] = {
61763 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
61764 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61765 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61766 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61767 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61768 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61769 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
61770 : {0, 0, 0, 0}
61771 : };
61772 :
61773 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
61774 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
61775 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
61776 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
61777 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
61778 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
61779 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
61780 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
61781 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
61782 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
61783 : {0, 0, 0, 0, 0}
61784 : };
61785 : #if CYTHON_USE_TYPE_SPECS
61786 : #if !CYTHON_COMPILING_IN_LIMITED_API
61787 :
61788 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
61789 : #if PY_MAJOR_VERSION < 3
61790 : 0, /*bf_getreadbuffer*/
61791 : #endif
61792 : #if PY_MAJOR_VERSION < 3
61793 : 0, /*bf_getwritebuffer*/
61794 : #endif
61795 : #if PY_MAJOR_VERSION < 3
61796 : 0, /*bf_getsegcount*/
61797 : #endif
61798 : #if PY_MAJOR_VERSION < 3
61799 : 0, /*bf_getcharbuffer*/
61800 : #endif
61801 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
61802 : 0, /*bf_releasebuffer*/
61803 : };
61804 : #endif
61805 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
61806 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
61807 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
61808 : {Py_sq_length, (void *)__pyx_memoryview___len__},
61809 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
61810 : {Py_mp_length, (void *)__pyx_memoryview___len__},
61811 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
61812 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
61813 : {Py_tp_str, (void *)__pyx_memoryview___str__},
61814 : #if defined(Py_bf_getbuffer)
61815 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
61816 : #endif
61817 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
61818 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
61819 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
61820 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
61821 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
61822 : {0, 0},
61823 : };
61824 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
61825 : "scipy.linalg._decomp_interpolative.memoryview",
61826 : sizeof(struct __pyx_memoryview_obj),
61827 : 0,
61828 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
61829 : __pyx_type___pyx_memoryview_slots,
61830 : };
61831 : #else
61832 :
61833 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
61834 : __pyx_memoryview___len__, /*sq_length*/
61835 : 0, /*sq_concat*/
61836 : 0, /*sq_repeat*/
61837 : __pyx_sq_item_memoryview, /*sq_item*/
61838 : 0, /*sq_slice*/
61839 : 0, /*sq_ass_item*/
61840 : 0, /*sq_ass_slice*/
61841 : 0, /*sq_contains*/
61842 : 0, /*sq_inplace_concat*/
61843 : 0, /*sq_inplace_repeat*/
61844 : };
61845 :
61846 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
61847 : __pyx_memoryview___len__, /*mp_length*/
61848 : __pyx_memoryview___getitem__, /*mp_subscript*/
61849 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
61850 : };
61851 :
61852 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
61853 : #if PY_MAJOR_VERSION < 3
61854 : 0, /*bf_getreadbuffer*/
61855 : #endif
61856 : #if PY_MAJOR_VERSION < 3
61857 : 0, /*bf_getwritebuffer*/
61858 : #endif
61859 : #if PY_MAJOR_VERSION < 3
61860 : 0, /*bf_getsegcount*/
61861 : #endif
61862 : #if PY_MAJOR_VERSION < 3
61863 : 0, /*bf_getcharbuffer*/
61864 : #endif
61865 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
61866 : 0, /*bf_releasebuffer*/
61867 : };
61868 :
61869 : static PyTypeObject __pyx_type___pyx_memoryview = {
61870 : PyVarObject_HEAD_INIT(0, 0)
61871 : "scipy.linalg._decomp_interpolative.""memoryview", /*tp_name*/
61872 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
61873 : 0, /*tp_itemsize*/
61874 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
61875 : #if PY_VERSION_HEX < 0x030800b4
61876 : 0, /*tp_print*/
61877 : #endif
61878 : #if PY_VERSION_HEX >= 0x030800b4
61879 : 0, /*tp_vectorcall_offset*/
61880 : #endif
61881 : 0, /*tp_getattr*/
61882 : 0, /*tp_setattr*/
61883 : #if PY_MAJOR_VERSION < 3
61884 : 0, /*tp_compare*/
61885 : #endif
61886 : #if PY_MAJOR_VERSION >= 3
61887 : 0, /*tp_as_async*/
61888 : #endif
61889 : __pyx_memoryview___repr__, /*tp_repr*/
61890 : 0, /*tp_as_number*/
61891 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
61892 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
61893 : 0, /*tp_hash*/
61894 : 0, /*tp_call*/
61895 : __pyx_memoryview___str__, /*tp_str*/
61896 : 0, /*tp_getattro*/
61897 : 0, /*tp_setattro*/
61898 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
61899 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
61900 : 0, /*tp_doc*/
61901 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
61902 : __pyx_tp_clear_memoryview, /*tp_clear*/
61903 : 0, /*tp_richcompare*/
61904 : 0, /*tp_weaklistoffset*/
61905 : 0, /*tp_iter*/
61906 : 0, /*tp_iternext*/
61907 : __pyx_methods_memoryview, /*tp_methods*/
61908 : 0, /*tp_members*/
61909 : __pyx_getsets_memoryview, /*tp_getset*/
61910 : 0, /*tp_base*/
61911 : 0, /*tp_dict*/
61912 : 0, /*tp_descr_get*/
61913 : 0, /*tp_descr_set*/
61914 : #if !CYTHON_USE_TYPE_SPECS
61915 : 0, /*tp_dictoffset*/
61916 : #endif
61917 : 0, /*tp_init*/
61918 : 0, /*tp_alloc*/
61919 : __pyx_tp_new_memoryview, /*tp_new*/
61920 : 0, /*tp_free*/
61921 : 0, /*tp_is_gc*/
61922 : 0, /*tp_bases*/
61923 : 0, /*tp_mro*/
61924 : 0, /*tp_cache*/
61925 : 0, /*tp_subclasses*/
61926 : 0, /*tp_weaklist*/
61927 : 0, /*tp_del*/
61928 : 0, /*tp_version_tag*/
61929 : #if PY_VERSION_HEX >= 0x030400a1
61930 : #if CYTHON_USE_TP_FINALIZE
61931 : 0, /*tp_finalize*/
61932 : #else
61933 : NULL, /*tp_finalize*/
61934 : #endif
61935 : #endif
61936 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
61937 : 0, /*tp_vectorcall*/
61938 : #endif
61939 : #if __PYX_NEED_TP_PRINT_SLOT == 1
61940 : 0, /*tp_print*/
61941 : #endif
61942 : #if PY_VERSION_HEX >= 0x030C0000
61943 : 0, /*tp_watched*/
61944 : #endif
61945 : #if PY_VERSION_HEX >= 0x030d00A4
61946 : 0, /*tp_versions_used*/
61947 : #endif
61948 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
61949 : 0, /*tp_pypy_flags*/
61950 : #endif
61951 : };
61952 : #endif
61953 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
61954 :
61955 0 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
61956 0 : struct __pyx_memoryviewslice_obj *p;
61957 0 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
61958 0 : if (unlikely(!o)) return 0;
61959 0 : p = ((struct __pyx_memoryviewslice_obj *)o);
61960 0 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
61961 0 : p->from_object = Py_None; Py_INCREF(Py_None);
61962 0 : p->from_slice.memview = NULL;
61963 0 : return o;
61964 : }
61965 :
61966 0 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
61967 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
61968 : #if CYTHON_USE_TP_FINALIZE
61969 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
61970 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
61971 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
61972 : }
61973 : }
61974 : #endif
61975 0 : PyObject_GC_UnTrack(o);
61976 : {
61977 0 : PyObject *etype, *eval, *etb;
61978 0 : PyErr_Fetch(&etype, &eval, &etb);
61979 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
61980 0 : __pyx_memoryviewslice___dealloc__(o);
61981 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
61982 0 : PyErr_Restore(etype, eval, etb);
61983 : }
61984 0 : Py_CLEAR(p->from_object);
61985 0 : PyObject_GC_Track(o);
61986 0 : __pyx_tp_dealloc_memoryview(o);
61987 : }
61988 :
61989 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
61990 0 : int e;
61991 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
61992 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
61993 0 : if (p->from_object) {
61994 0 : e = (*v)(p->from_object, a); if (e) return e;
61995 : }
61996 : return 0;
61997 : }
61998 :
61999 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
62000 0 : PyObject* tmp;
62001 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
62002 0 : __pyx_tp_clear_memoryview(o);
62003 0 : tmp = ((PyObject*)p->from_object);
62004 0 : p->from_object = Py_None; Py_INCREF(Py_None);
62005 0 : Py_XDECREF(tmp);
62006 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
62007 0 : return 0;
62008 : }
62009 :
62010 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
62011 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
62012 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
62013 : {0, 0, 0, 0}
62014 : };
62015 : #if CYTHON_USE_TYPE_SPECS
62016 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
62017 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
62018 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
62019 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
62020 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
62021 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
62022 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
62023 : {0, 0},
62024 : };
62025 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
62026 : "scipy.linalg._decomp_interpolative._memoryviewslice",
62027 : sizeof(struct __pyx_memoryviewslice_obj),
62028 : 0,
62029 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
62030 : __pyx_type___pyx_memoryviewslice_slots,
62031 : };
62032 : #else
62033 :
62034 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
62035 : PyVarObject_HEAD_INIT(0, 0)
62036 : "scipy.linalg._decomp_interpolative.""_memoryviewslice", /*tp_name*/
62037 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
62038 : 0, /*tp_itemsize*/
62039 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
62040 : #if PY_VERSION_HEX < 0x030800b4
62041 : 0, /*tp_print*/
62042 : #endif
62043 : #if PY_VERSION_HEX >= 0x030800b4
62044 : 0, /*tp_vectorcall_offset*/
62045 : #endif
62046 : 0, /*tp_getattr*/
62047 : 0, /*tp_setattr*/
62048 : #if PY_MAJOR_VERSION < 3
62049 : 0, /*tp_compare*/
62050 : #endif
62051 : #if PY_MAJOR_VERSION >= 3
62052 : 0, /*tp_as_async*/
62053 : #endif
62054 : #if CYTHON_COMPILING_IN_PYPY || 0
62055 : __pyx_memoryview___repr__, /*tp_repr*/
62056 : #else
62057 : 0, /*tp_repr*/
62058 : #endif
62059 : 0, /*tp_as_number*/
62060 : 0, /*tp_as_sequence*/
62061 : 0, /*tp_as_mapping*/
62062 : 0, /*tp_hash*/
62063 : 0, /*tp_call*/
62064 : #if CYTHON_COMPILING_IN_PYPY || 0
62065 : __pyx_memoryview___str__, /*tp_str*/
62066 : #else
62067 : 0, /*tp_str*/
62068 : #endif
62069 : 0, /*tp_getattro*/
62070 : 0, /*tp_setattro*/
62071 : 0, /*tp_as_buffer*/
62072 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
62073 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
62074 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
62075 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
62076 : 0, /*tp_richcompare*/
62077 : 0, /*tp_weaklistoffset*/
62078 : 0, /*tp_iter*/
62079 : 0, /*tp_iternext*/
62080 : __pyx_methods__memoryviewslice, /*tp_methods*/
62081 : 0, /*tp_members*/
62082 : 0, /*tp_getset*/
62083 : 0, /*tp_base*/
62084 : 0, /*tp_dict*/
62085 : 0, /*tp_descr_get*/
62086 : 0, /*tp_descr_set*/
62087 : #if !CYTHON_USE_TYPE_SPECS
62088 : 0, /*tp_dictoffset*/
62089 : #endif
62090 : 0, /*tp_init*/
62091 : 0, /*tp_alloc*/
62092 : __pyx_tp_new__memoryviewslice, /*tp_new*/
62093 : 0, /*tp_free*/
62094 : 0, /*tp_is_gc*/
62095 : 0, /*tp_bases*/
62096 : 0, /*tp_mro*/
62097 : 0, /*tp_cache*/
62098 : 0, /*tp_subclasses*/
62099 : 0, /*tp_weaklist*/
62100 : 0, /*tp_del*/
62101 : 0, /*tp_version_tag*/
62102 : #if PY_VERSION_HEX >= 0x030400a1
62103 : #if CYTHON_USE_TP_FINALIZE
62104 : 0, /*tp_finalize*/
62105 : #else
62106 : NULL, /*tp_finalize*/
62107 : #endif
62108 : #endif
62109 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
62110 : 0, /*tp_vectorcall*/
62111 : #endif
62112 : #if __PYX_NEED_TP_PRINT_SLOT == 1
62113 : 0, /*tp_print*/
62114 : #endif
62115 : #if PY_VERSION_HEX >= 0x030C0000
62116 : 0, /*tp_watched*/
62117 : #endif
62118 : #if PY_VERSION_HEX >= 0x030d00A4
62119 : 0, /*tp_versions_used*/
62120 : #endif
62121 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
62122 : 0, /*tp_pypy_flags*/
62123 : #endif
62124 : };
62125 : #endif
62126 :
62127 : static PyMethodDef __pyx_methods[] = {
62128 : {0, 0, 0, 0}
62129 : };
62130 : #ifndef CYTHON_SMALL_CODE
62131 : #if defined(__clang__)
62132 : #define CYTHON_SMALL_CODE
62133 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
62134 : #define CYTHON_SMALL_CODE __attribute__((cold))
62135 : #else
62136 : #define CYTHON_SMALL_CODE
62137 : #endif
62138 : #endif
62139 : /* #### Code section: pystring_table ### */
62140 :
62141 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
62142 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
62143 3 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
62144 3 : {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
62145 3 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
62146 3 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
62147 3 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
62148 3 : {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
62149 3 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
62150 3 : {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
62151 3 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
62152 3 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
62153 3 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
62154 3 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
62155 3 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
62156 3 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
62157 3 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
62158 3 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
62159 3 : {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
62160 3 : {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1},
62161 3 : {&__pyx_kp_u_Failed_to_allocate_at_least_requ, __pyx_k_Failed_to_allocate_at_least_requ, sizeof(__pyx_k_Failed_to_allocate_at_least_requ), 0, 1, 0, 0},
62162 3 : {&__pyx_n_s_Fc, __pyx_k_Fc, sizeof(__pyx_k_Fc), 0, 0, 1, 1},
62163 3 : {&__pyx_n_s_Fcopy, __pyx_k_Fcopy, sizeof(__pyx_k_Fcopy), 0, 0, 1, 1},
62164 3 : {&__pyx_n_s_Fmemview, __pyx_k_Fmemview, sizeof(__pyx_k_Fmemview), 0, 0, 1, 1},
62165 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
62166 3 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
62167 3 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
62168 3 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
62169 3 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
62170 3 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
62171 3 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
62172 3 : {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
62173 3 : {&__pyx_n_s_LinearOperator, __pyx_k_LinearOperator, sizeof(__pyx_k_LinearOperator), 0, 0, 1, 1},
62174 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
62175 3 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
62176 3 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
62177 3 : {&__pyx_n_s_NDArray, __pyx_k_NDArray, sizeof(__pyx_k_NDArray), 0, 0, 1, 1},
62178 3 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
62179 3 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
62180 3 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
62181 3 : {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
62182 3 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
62183 3 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
62184 3 : {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
62185 3 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
62186 3 : {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
62187 3 : {&__pyx_n_s_UU, __pyx_k_UU, sizeof(__pyx_k_UU), 0, 0, 1, 1},
62188 3 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
62189 3 : {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1},
62190 3 : {&__pyx_n_s_VV, __pyx_k_VV, sizeof(__pyx_k_VV), 0, 0, 1, 1},
62191 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
62192 3 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
62193 3 : {&__pyx_n_s__102, __pyx_k__102, sizeof(__pyx_k__102), 0, 0, 1, 1},
62194 3 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
62195 3 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
62196 3 : {&__pyx_n_s__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 1, 1},
62197 3 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
62198 3 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
62199 3 : {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
62200 3 : {&__pyx_n_s_aa, __pyx_k_aa, sizeof(__pyx_k_aa), 0, 0, 1, 1},
62201 3 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
62202 3 : {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
62203 3 : {&__pyx_n_s_albetas, __pyx_k_albetas, sizeof(__pyx_k_albetas), 0, 0, 1, 1},
62204 3 : {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
62205 3 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
62206 3 : {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
62207 3 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
62208 3 : {&__pyx_n_s_approx, __pyx_k_approx, sizeof(__pyx_k_approx), 0, 0, 1, 1},
62209 3 : {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
62210 3 : {&__pyx_n_s_argmax, __pyx_k_argmax, sizeof(__pyx_k_argmax), 0, 0, 1, 1},
62211 3 : {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
62212 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
62213 3 : {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
62214 3 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
62215 3 : {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1},
62216 3 : {&__pyx_kp_u_bytes_for_scipy_linalg_interpol, __pyx_k_bytes_for_scipy_linalg_interpol, sizeof(__pyx_k_bytes_for_scipy_linalg_interpol), 0, 1, 0, 0},
62217 3 : {&__pyx_kp_u_bytes_for_scipy_linalg_interpol_2, __pyx_k_bytes_for_scipy_linalg_interpol_2, sizeof(__pyx_k_bytes_for_scipy_linalg_interpol_2), 0, 1, 0, 0},
62218 3 : {&__pyx_kp_u_bytes_while_trying_to_determine, __pyx_k_bytes_while_trying_to_determine, sizeof(__pyx_k_bytes_while_trying_to_determine), 0, 1, 0, 0},
62219 3 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
62220 3 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
62221 3 : {&__pyx_n_s_check_finite, __pyx_k_check_finite, sizeof(__pyx_k_check_finite), 0, 0, 1, 1},
62222 3 : {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1},
62223 3 : {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 0, 0, 1, 1},
62224 3 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
62225 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
62226 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
62227 3 : {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
62228 3 : {&__pyx_n_s_col_norms, __pyx_k_col_norms, sizeof(__pyx_k_col_norms), 0, 0, 1, 1},
62229 3 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
62230 3 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
62231 3 : {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1},
62232 3 : {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1},
62233 3 : {&__pyx_n_s_conj, __pyx_k_conj, sizeof(__pyx_k_conj), 0, 0, 1, 1},
62234 3 : {&__pyx_n_s_conjugate, __pyx_k_conjugate, sizeof(__pyx_k_conjugate), 0, 0, 1, 1},
62235 3 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
62236 3 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
62237 3 : {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
62238 3 : {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
62239 3 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
62240 3 : {&__pyx_n_s_csum, __pyx_k_csum, sizeof(__pyx_k_csum), 0, 0, 1, 1},
62241 3 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
62242 3 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
62243 3 : {&__pyx_n_s_divmod, __pyx_k_divmod, sizeof(__pyx_k_divmod), 0, 0, 1, 1},
62244 3 : {&__pyx_n_s_dm1, __pyx_k_dm1, sizeof(__pyx_k_dm1), 0, 0, 1, 1},
62245 3 : {&__pyx_n_s_dm2, __pyx_k_dm2, sizeof(__pyx_k_dm2), 0, 0, 1, 1},
62246 3 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
62247 3 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
62248 3 : {&__pyx_n_s_einsum, __pyx_k_einsum, sizeof(__pyx_k_einsum), 0, 0, 1, 1},
62249 3 : {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
62250 3 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
62251 3 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
62252 3 : {&__pyx_n_s_enorm, __pyx_k_enorm, sizeof(__pyx_k_enorm), 0, 0, 1, 1},
62253 3 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
62254 3 : {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1},
62255 3 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
62256 3 : {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
62257 3 : {&__pyx_n_s_fact, __pyx_k_fact, sizeof(__pyx_k_fact), 0, 0, 1, 1},
62258 3 : {&__pyx_n_s_feps, __pyx_k_feps, sizeof(__pyx_k_feps), 0, 0, 1, 1},
62259 3 : {&__pyx_n_s_ff, __pyx_k_ff, sizeof(__pyx_k_ff), 0, 0, 1, 1},
62260 3 : {&__pyx_n_s_fft, __pyx_k_fft, sizeof(__pyx_k_fft), 0, 0, 1, 1},
62261 3 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
62262 3 : {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
62263 3 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
62264 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
62265 3 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
62266 3 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
62267 3 : {&__pyx_n_s_full_matrices, __pyx_k_full_matrices, sizeof(__pyx_k_full_matrices), 0, 0, 1, 1},
62268 3 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
62269 3 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
62270 3 : {&__pyx_n_s_giv2x2, __pyx_k_giv2x2, sizeof(__pyx_k_giv2x2), 0, 0, 1, 1},
62271 3 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
62272 3 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
62273 3 : {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
62274 3 : {&__pyx_n_s_high, __pyx_k_high, sizeof(__pyx_k_high), 0, 0, 1, 1},
62275 3 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
62276 3 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
62277 3 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
62278 3 : {&__pyx_n_s_idd_diffsnorm, __pyx_k_idd_diffsnorm, sizeof(__pyx_k_idd_diffsnorm), 0, 0, 1, 1},
62279 3 : {&__pyx_n_u_idd_diffsnorm, __pyx_k_idd_diffsnorm, sizeof(__pyx_k_idd_diffsnorm), 0, 1, 0, 1},
62280 3 : {&__pyx_n_s_idd_estrank, __pyx_k_idd_estrank, sizeof(__pyx_k_idd_estrank), 0, 0, 1, 1},
62281 3 : {&__pyx_n_u_idd_estrank, __pyx_k_idd_estrank, sizeof(__pyx_k_idd_estrank), 0, 1, 0, 1},
62282 3 : {&__pyx_n_s_idd_findrank, __pyx_k_idd_findrank, sizeof(__pyx_k_idd_findrank), 0, 0, 1, 1},
62283 3 : {&__pyx_n_s_idd_id2svd, __pyx_k_idd_id2svd, sizeof(__pyx_k_idd_id2svd), 0, 0, 1, 1},
62284 3 : {&__pyx_n_u_idd_id2svd, __pyx_k_idd_id2svd, sizeof(__pyx_k_idd_id2svd), 0, 1, 0, 1},
62285 3 : {&__pyx_n_u_idd_ldiv, __pyx_k_idd_ldiv, sizeof(__pyx_k_idd_ldiv), 0, 1, 0, 1},
62286 3 : {&__pyx_n_u_idd_poweroftwo, __pyx_k_idd_poweroftwo, sizeof(__pyx_k_idd_poweroftwo), 0, 1, 0, 1},
62287 3 : {&__pyx_n_s_idd_reconid, __pyx_k_idd_reconid, sizeof(__pyx_k_idd_reconid), 0, 0, 1, 1},
62288 3 : {&__pyx_n_u_idd_reconid, __pyx_k_idd_reconid, sizeof(__pyx_k_idd_reconid), 0, 1, 0, 1},
62289 3 : {&__pyx_n_s_idd_snorm, __pyx_k_idd_snorm, sizeof(__pyx_k_idd_snorm), 0, 0, 1, 1},
62290 3 : {&__pyx_n_u_idd_snorm, __pyx_k_idd_snorm, sizeof(__pyx_k_idd_snorm), 0, 1, 0, 1},
62291 3 : {&__pyx_n_s_iddp_aid, __pyx_k_iddp_aid, sizeof(__pyx_k_iddp_aid), 0, 0, 1, 1},
62292 3 : {&__pyx_n_u_iddp_aid, __pyx_k_iddp_aid, sizeof(__pyx_k_iddp_aid), 0, 1, 0, 1},
62293 3 : {&__pyx_n_s_iddp_asvd, __pyx_k_iddp_asvd, sizeof(__pyx_k_iddp_asvd), 0, 0, 1, 1},
62294 3 : {&__pyx_n_u_iddp_asvd, __pyx_k_iddp_asvd, sizeof(__pyx_k_iddp_asvd), 0, 1, 0, 1},
62295 3 : {&__pyx_n_s_iddp_id, __pyx_k_iddp_id, sizeof(__pyx_k_iddp_id), 0, 0, 1, 1},
62296 3 : {&__pyx_n_u_iddp_id, __pyx_k_iddp_id, sizeof(__pyx_k_iddp_id), 0, 1, 0, 1},
62297 3 : {&__pyx_n_s_iddp_qrpiv, __pyx_k_iddp_qrpiv, sizeof(__pyx_k_iddp_qrpiv), 0, 0, 1, 1},
62298 3 : {&__pyx_n_u_iddp_qrpiv, __pyx_k_iddp_qrpiv, sizeof(__pyx_k_iddp_qrpiv), 0, 1, 0, 1},
62299 3 : {&__pyx_n_s_iddp_rid, __pyx_k_iddp_rid, sizeof(__pyx_k_iddp_rid), 0, 0, 1, 1},
62300 3 : {&__pyx_n_u_iddp_rid, __pyx_k_iddp_rid, sizeof(__pyx_k_iddp_rid), 0, 1, 0, 1},
62301 3 : {&__pyx_n_s_iddp_rsvd, __pyx_k_iddp_rsvd, sizeof(__pyx_k_iddp_rsvd), 0, 0, 1, 1},
62302 3 : {&__pyx_n_u_iddp_rsvd, __pyx_k_iddp_rsvd, sizeof(__pyx_k_iddp_rsvd), 0, 1, 0, 1},
62303 3 : {&__pyx_n_s_iddp_svd, __pyx_k_iddp_svd, sizeof(__pyx_k_iddp_svd), 0, 0, 1, 1},
62304 3 : {&__pyx_n_u_iddp_svd, __pyx_k_iddp_svd, sizeof(__pyx_k_iddp_svd), 0, 1, 0, 1},
62305 3 : {&__pyx_n_s_iddr_aid, __pyx_k_iddr_aid, sizeof(__pyx_k_iddr_aid), 0, 0, 1, 1},
62306 3 : {&__pyx_n_u_iddr_aid, __pyx_k_iddr_aid, sizeof(__pyx_k_iddr_aid), 0, 1, 0, 1},
62307 3 : {&__pyx_n_s_iddr_asvd, __pyx_k_iddr_asvd, sizeof(__pyx_k_iddr_asvd), 0, 0, 1, 1},
62308 3 : {&__pyx_n_u_iddr_asvd, __pyx_k_iddr_asvd, sizeof(__pyx_k_iddr_asvd), 0, 1, 0, 1},
62309 3 : {&__pyx_n_s_iddr_id, __pyx_k_iddr_id, sizeof(__pyx_k_iddr_id), 0, 0, 1, 1},
62310 3 : {&__pyx_n_u_iddr_id, __pyx_k_iddr_id, sizeof(__pyx_k_iddr_id), 0, 1, 0, 1},
62311 3 : {&__pyx_n_s_iddr_qrpiv, __pyx_k_iddr_qrpiv, sizeof(__pyx_k_iddr_qrpiv), 0, 0, 1, 1},
62312 3 : {&__pyx_n_u_iddr_qrpiv, __pyx_k_iddr_qrpiv, sizeof(__pyx_k_iddr_qrpiv), 0, 1, 0, 1},
62313 3 : {&__pyx_n_s_iddr_rid, __pyx_k_iddr_rid, sizeof(__pyx_k_iddr_rid), 0, 0, 1, 1},
62314 3 : {&__pyx_n_u_iddr_rid, __pyx_k_iddr_rid, sizeof(__pyx_k_iddr_rid), 0, 1, 0, 1},
62315 3 : {&__pyx_n_s_iddr_rsvd, __pyx_k_iddr_rsvd, sizeof(__pyx_k_iddr_rsvd), 0, 0, 1, 1},
62316 3 : {&__pyx_n_u_iddr_rsvd, __pyx_k_iddr_rsvd, sizeof(__pyx_k_iddr_rsvd), 0, 1, 0, 1},
62317 3 : {&__pyx_n_s_iddr_svd, __pyx_k_iddr_svd, sizeof(__pyx_k_iddr_svd), 0, 0, 1, 1},
62318 3 : {&__pyx_n_u_iddr_svd, __pyx_k_iddr_svd, sizeof(__pyx_k_iddr_svd), 0, 1, 0, 1},
62319 3 : {&__pyx_n_s_idivm, __pyx_k_idivm, sizeof(__pyx_k_idivm), 0, 0, 1, 1},
62320 3 : {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
62321 3 : {&__pyx_n_s_idz_diffsnorm, __pyx_k_idz_diffsnorm, sizeof(__pyx_k_idz_diffsnorm), 0, 0, 1, 1},
62322 3 : {&__pyx_n_u_idz_diffsnorm, __pyx_k_idz_diffsnorm, sizeof(__pyx_k_idz_diffsnorm), 0, 1, 0, 1},
62323 3 : {&__pyx_n_s_idz_estrank, __pyx_k_idz_estrank, sizeof(__pyx_k_idz_estrank), 0, 0, 1, 1},
62324 3 : {&__pyx_n_u_idz_estrank, __pyx_k_idz_estrank, sizeof(__pyx_k_idz_estrank), 0, 1, 0, 1},
62325 3 : {&__pyx_n_s_idz_findrank, __pyx_k_idz_findrank, sizeof(__pyx_k_idz_findrank), 0, 0, 1, 1},
62326 3 : {&__pyx_n_u_idz_findrank, __pyx_k_idz_findrank, sizeof(__pyx_k_idz_findrank), 0, 1, 0, 1},
62327 3 : {&__pyx_n_s_idz_id2svd, __pyx_k_idz_id2svd, sizeof(__pyx_k_idz_id2svd), 0, 0, 1, 1},
62328 3 : {&__pyx_n_u_idz_id2svdidd_findrank, __pyx_k_idz_id2svdidd_findrank, sizeof(__pyx_k_idz_id2svdidd_findrank), 0, 1, 0, 1},
62329 3 : {&__pyx_n_s_idz_reconid, __pyx_k_idz_reconid, sizeof(__pyx_k_idz_reconid), 0, 0, 1, 1},
62330 3 : {&__pyx_n_u_idz_reconid, __pyx_k_idz_reconid, sizeof(__pyx_k_idz_reconid), 0, 1, 0, 1},
62331 3 : {&__pyx_n_s_idz_snorm, __pyx_k_idz_snorm, sizeof(__pyx_k_idz_snorm), 0, 0, 1, 1},
62332 3 : {&__pyx_n_u_idz_snorm, __pyx_k_idz_snorm, sizeof(__pyx_k_idz_snorm), 0, 1, 0, 1},
62333 3 : {&__pyx_n_s_idzp_aid, __pyx_k_idzp_aid, sizeof(__pyx_k_idzp_aid), 0, 0, 1, 1},
62334 3 : {&__pyx_n_u_idzp_aid, __pyx_k_idzp_aid, sizeof(__pyx_k_idzp_aid), 0, 1, 0, 1},
62335 3 : {&__pyx_n_s_idzp_asvd, __pyx_k_idzp_asvd, sizeof(__pyx_k_idzp_asvd), 0, 0, 1, 1},
62336 3 : {&__pyx_n_u_idzp_asvd, __pyx_k_idzp_asvd, sizeof(__pyx_k_idzp_asvd), 0, 1, 0, 1},
62337 3 : {&__pyx_n_s_idzp_id, __pyx_k_idzp_id, sizeof(__pyx_k_idzp_id), 0, 0, 1, 1},
62338 3 : {&__pyx_n_u_idzp_id, __pyx_k_idzp_id, sizeof(__pyx_k_idzp_id), 0, 1, 0, 1},
62339 3 : {&__pyx_n_s_idzp_qrpiv, __pyx_k_idzp_qrpiv, sizeof(__pyx_k_idzp_qrpiv), 0, 0, 1, 1},
62340 3 : {&__pyx_n_u_idzp_qrpiv, __pyx_k_idzp_qrpiv, sizeof(__pyx_k_idzp_qrpiv), 0, 1, 0, 1},
62341 3 : {&__pyx_n_s_idzp_rid, __pyx_k_idzp_rid, sizeof(__pyx_k_idzp_rid), 0, 0, 1, 1},
62342 3 : {&__pyx_n_u_idzp_rid, __pyx_k_idzp_rid, sizeof(__pyx_k_idzp_rid), 0, 1, 0, 1},
62343 3 : {&__pyx_n_s_idzp_rsvd, __pyx_k_idzp_rsvd, sizeof(__pyx_k_idzp_rsvd), 0, 0, 1, 1},
62344 3 : {&__pyx_n_u_idzp_rsvd, __pyx_k_idzp_rsvd, sizeof(__pyx_k_idzp_rsvd), 0, 1, 0, 1},
62345 3 : {&__pyx_n_s_idzp_svd, __pyx_k_idzp_svd, sizeof(__pyx_k_idzp_svd), 0, 0, 1, 1},
62346 3 : {&__pyx_n_u_idzp_svd, __pyx_k_idzp_svd, sizeof(__pyx_k_idzp_svd), 0, 1, 0, 1},
62347 3 : {&__pyx_n_s_idzr_aid, __pyx_k_idzr_aid, sizeof(__pyx_k_idzr_aid), 0, 0, 1, 1},
62348 3 : {&__pyx_n_u_idzr_aid, __pyx_k_idzr_aid, sizeof(__pyx_k_idzr_aid), 0, 1, 0, 1},
62349 3 : {&__pyx_n_s_idzr_asvd, __pyx_k_idzr_asvd, sizeof(__pyx_k_idzr_asvd), 0, 0, 1, 1},
62350 3 : {&__pyx_n_u_idzr_asvd, __pyx_k_idzr_asvd, sizeof(__pyx_k_idzr_asvd), 0, 1, 0, 1},
62351 3 : {&__pyx_n_s_idzr_id, __pyx_k_idzr_id, sizeof(__pyx_k_idzr_id), 0, 0, 1, 1},
62352 3 : {&__pyx_n_u_idzr_id, __pyx_k_idzr_id, sizeof(__pyx_k_idzr_id), 0, 1, 0, 1},
62353 3 : {&__pyx_n_s_idzr_qrpiv, __pyx_k_idzr_qrpiv, sizeof(__pyx_k_idzr_qrpiv), 0, 0, 1, 1},
62354 3 : {&__pyx_n_u_idzr_qrpiv, __pyx_k_idzr_qrpiv, sizeof(__pyx_k_idzr_qrpiv), 0, 1, 0, 1},
62355 3 : {&__pyx_n_s_idzr_rid, __pyx_k_idzr_rid, sizeof(__pyx_k_idzr_rid), 0, 0, 1, 1},
62356 3 : {&__pyx_n_u_idzr_rid, __pyx_k_idzr_rid, sizeof(__pyx_k_idzr_rid), 0, 1, 0, 1},
62357 3 : {&__pyx_n_s_idzr_rsvd, __pyx_k_idzr_rsvd, sizeof(__pyx_k_idzr_rsvd), 0, 0, 1, 1},
62358 3 : {&__pyx_n_u_idzr_rsvd, __pyx_k_idzr_rsvd, sizeof(__pyx_k_idzr_rsvd), 0, 1, 0, 1},
62359 3 : {&__pyx_n_s_idzr_svd, __pyx_k_idzr_svd, sizeof(__pyx_k_idzr_svd), 0, 0, 1, 1},
62360 3 : {&__pyx_n_u_idzr_svd, __pyx_k_idzr_svd, sizeof(__pyx_k_idzr_svd), 0, 1, 0, 1},
62361 3 : {&__pyx_kp_u_ij_jim_im, __pyx_k_ij_jim_im, sizeof(__pyx_k_ij_jim_im), 0, 1, 0, 0},
62362 3 : {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1},
62363 3 : {&__pyx_n_s_imatmul, __pyx_k_imatmul, sizeof(__pyx_k_imatmul), 0, 0, 1, 1},
62364 3 : {&__pyx_n_s_imodm, __pyx_k_imodm, sizeof(__pyx_k_imodm), 0, 0, 1, 1},
62365 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
62366 3 : {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
62367 3 : {&__pyx_n_s_ind2, __pyx_k_ind2, sizeof(__pyx_k_ind2), 0, 0, 1, 1},
62368 3 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
62369 3 : {&__pyx_n_s_inds, __pyx_k_inds, sizeof(__pyx_k_inds), 0, 0, 1, 1},
62370 3 : {&__pyx_n_s_inds1, __pyx_k_inds1, sizeof(__pyx_k_inds1), 0, 0, 1, 1},
62371 3 : {&__pyx_n_s_inds2, __pyx_k_inds2, sizeof(__pyx_k_inds2), 0, 0, 1, 1},
62372 3 : {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
62373 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
62374 3 : {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
62375 3 : {&__pyx_n_s_int_n, __pyx_k_int_n, sizeof(__pyx_k_int_n), 0, 0, 1, 1},
62376 3 : {&__pyx_n_s_intone, __pyx_k_intone, sizeof(__pyx_k_intone), 0, 0, 1, 1},
62377 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
62378 3 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
62379 3 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
62380 3 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
62381 3 : {&__pyx_n_s_its, __pyx_k_its, sizeof(__pyx_k_its), 0, 0, 1, 1},
62382 3 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
62383 3 : {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
62384 3 : {&__pyx_n_s_kk, __pyx_k_kk, sizeof(__pyx_k_kk), 0, 0, 1, 1},
62385 3 : {&__pyx_n_s_kpiv, __pyx_k_kpiv, sizeof(__pyx_k_kpiv), 0, 0, 1, 1},
62386 3 : {&__pyx_n_s_krank, __pyx_k_krank, sizeof(__pyx_k_krank), 0, 0, 1, 1},
62387 3 : {&__pyx_n_s_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 0, 1, 1},
62388 3 : {&__pyx_n_s_la, __pyx_k_la, sizeof(__pyx_k_la), 0, 0, 1, 1},
62389 3 : {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1},
62390 3 : {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
62391 3 : {&__pyx_n_s_loops, __pyx_k_loops, sizeof(__pyx_k_loops), 0, 0, 1, 1},
62392 3 : {&__pyx_n_s_low, __pyx_k_low, sizeof(__pyx_k_low), 0, 0, 1, 1},
62393 3 : {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
62394 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
62395 3 : {&__pyx_n_s_marker, __pyx_k_marker, sizeof(__pyx_k_marker), 0, 0, 1, 1},
62396 3 : {&__pyx_n_s_matmul, __pyx_k_matmul, sizeof(__pyx_k_matmul), 0, 0, 1, 1},
62397 3 : {&__pyx_n_s_matmul_2, __pyx_k_matmul_2, sizeof(__pyx_k_matmul_2), 0, 0, 1, 1},
62398 3 : {&__pyx_n_s_matvec, __pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 0, 1, 1},
62399 3 : {&__pyx_n_s_mb, __pyx_k_mb, sizeof(__pyx_k_mb), 0, 0, 1, 1},
62400 3 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
62401 3 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
62402 3 : {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
62403 3 : {&__pyx_n_s_n2, __pyx_k_n2, sizeof(__pyx_k_n2), 0, 0, 1, 1},
62404 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
62405 3 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
62406 3 : {&__pyx_n_s_nblock, __pyx_k_nblock, sizeof(__pyx_k_nblock), 0, 0, 1, 1},
62407 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
62408 3 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
62409 3 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
62410 3 : {&__pyx_n_s_no_of_cols, __pyx_k_no_of_cols, sizeof(__pyx_k_no_of_cols), 0, 0, 1, 1},
62411 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
62412 3 : {&__pyx_n_s_nstep, __pyx_k_nstep, sizeof(__pyx_k_nstep), 0, 0, 1, 1},
62413 3 : {&__pyx_n_s_nsteps, __pyx_k_nsteps, sizeof(__pyx_k_nsteps), 0, 0, 1, 1},
62414 3 : {&__pyx_n_s_nulls, __pyx_k_nulls, sizeof(__pyx_k_nulls), 0, 0, 1, 1},
62415 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
62416 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
62417 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
62418 3 : {&__pyx_n_s_numpy_typing, __pyx_k_numpy_typing, sizeof(__pyx_k_numpy_typing), 0, 0, 1, 1},
62419 3 : {&__pyx_n_s_nupdate, __pyx_k_nupdate, sizeof(__pyx_k_nupdate), 0, 0, 1, 1},
62420 3 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
62421 3 : {&__pyx_kp_u_of_a_LinearOperator_with_precis, __pyx_k_of_a_LinearOperator_with_precis, sizeof(__pyx_k_of_a_LinearOperator_with_precis), 0, 1, 0, 0},
62422 3 : {&__pyx_n_s_one, __pyx_k_one, sizeof(__pyx_k_one), 0, 0, 1, 1},
62423 3 : {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
62424 3 : {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
62425 3 : {&__pyx_n_s_outer, __pyx_k_outer, sizeof(__pyx_k_outer), 0, 0, 1, 1},
62426 3 : {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
62427 3 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
62428 3 : {&__pyx_n_s_perms, __pyx_k_perms, sizeof(__pyx_k_perms), 0, 0, 1, 1},
62429 3 : {&__pyx_n_s_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 0, 0, 1, 1},
62430 3 : {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
62431 3 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
62432 3 : {&__pyx_n_s_proj, __pyx_k_proj, sizeof(__pyx_k_proj), 0, 0, 1, 1},
62433 3 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
62434 3 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
62435 3 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
62436 3 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
62437 3 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
62438 3 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
62439 3 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
62440 3 : {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
62441 3 : {&__pyx_n_s_r2, __pyx_k_r2, sizeof(__pyx_k_r2), 0, 0, 1, 1},
62442 3 : {&__pyx_n_s_r3, __pyx_k_r3, sizeof(__pyx_k_r3), 0, 0, 1, 1},
62443 3 : {&__pyx_n_s_ra, __pyx_k_ra, sizeof(__pyx_k_ra), 0, 0, 1, 1},
62444 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
62445 3 : {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
62446 3 : {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
62447 3 : {&__pyx_n_s_reallocated_ra, __pyx_k_reallocated_ra, sizeof(__pyx_k_reallocated_ra), 0, 0, 1, 1},
62448 3 : {&__pyx_n_s_reallocated_ret, __pyx_k_reallocated_ret, sizeof(__pyx_k_reallocated_ret), 0, 0, 1, 1},
62449 3 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
62450 3 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
62451 3 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
62452 3 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
62453 3 : {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
62454 3 : {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
62455 3 : {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
62456 3 : {&__pyx_n_s_retarr, __pyx_k_retarr, sizeof(__pyx_k_retarr), 0, 0, 1, 1},
62457 3 : {&__pyx_n_s_rfft, __pyx_k_rfft, sizeof(__pyx_k_rfft), 0, 0, 1, 1},
62458 3 : {&__pyx_n_s_rmatmul, __pyx_k_rmatmul, sizeof(__pyx_k_rmatmul), 0, 0, 1, 1},
62459 3 : {&__pyx_n_s_rmatvec, __pyx_k_rmatvec, sizeof(__pyx_k_rmatvec), 0, 0, 1, 1},
62460 3 : {&__pyx_n_s_rng, __pyx_k_rng, sizeof(__pyx_k_rng), 0, 0, 1, 1},
62461 3 : {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
62462 3 : {&__pyx_n_s_rsum, __pyx_k_rsum, sizeof(__pyx_k_rsum), 0, 0, 1, 1},
62463 3 : {&__pyx_n_s_rta, __pyx_k_rta, sizeof(__pyx_k_rta), 0, 0, 1, 1},
62464 3 : {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1},
62465 3 : {&__pyx_n_s_scipy_fft, __pyx_k_scipy_fft, sizeof(__pyx_k_scipy_fft), 0, 0, 1, 1},
62466 3 : {&__pyx_n_s_scipy_linalg, __pyx_k_scipy_linalg, sizeof(__pyx_k_scipy_linalg), 0, 0, 1, 1},
62467 3 : {&__pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_k_scipy_linalg__decomp_interpolati, sizeof(__pyx_k_scipy_linalg__decomp_interpolati), 0, 0, 1, 1},
62468 3 : {&__pyx_kp_u_scipy_linalg_interpolative_idd, __pyx_k_scipy_linalg_interpolative_idd, sizeof(__pyx_k_scipy_linalg_interpolative_idd), 0, 1, 0, 0},
62469 3 : {&__pyx_kp_u_scipy_linalg_interpolative_idz, __pyx_k_scipy_linalg_interpolative_idz, sizeof(__pyx_k_scipy_linalg_interpolative_idz), 0, 1, 0, 0},
62470 3 : {&__pyx_n_s_scipy_sparse_linalg, __pyx_k_scipy_sparse_linalg, sizeof(__pyx_k_scipy_sparse_linalg), 0, 0, 1, 1},
62471 3 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
62472 3 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
62473 3 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
62474 3 : {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
62475 3 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
62476 3 : {&__pyx_n_s_snorm, __pyx_k_snorm, sizeof(__pyx_k_snorm), 0, 0, 1, 1},
62477 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
62478 3 : {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
62479 3 : {&__pyx_n_s_ssmax, __pyx_k_ssmax, sizeof(__pyx_k_ssmax), 0, 0, 1, 1},
62480 3 : {&__pyx_n_s_ssmaxin, __pyx_k_ssmaxin, sizeof(__pyx_k_ssmaxin), 0, 0, 1, 1},
62481 3 : {&__pyx_n_s_sssmax, __pyx_k_sssmax, sizeof(__pyx_k_sssmax), 0, 0, 1, 1},
62482 3 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
62483 3 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
62484 3 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
62485 3 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
62486 3 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
62487 3 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
62488 3 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
62489 3 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
62490 3 : {&__pyx_n_s_subselect, __pyx_k_subselect, sizeof(__pyx_k_subselect), 0, 0, 1, 1},
62491 3 : {&__pyx_n_s_svd, __pyx_k_svd, sizeof(__pyx_k_svd), 0, 0, 1, 1},
62492 3 : {&__pyx_n_s_swapaxes, __pyx_k_swapaxes, sizeof(__pyx_k_swapaxes), 0, 0, 1, 1},
62493 3 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
62494 3 : {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
62495 3 : {&__pyx_n_s_tau, __pyx_k_tau, sizeof(__pyx_k_tau), 0, 0, 1, 1},
62496 3 : {&__pyx_n_s_tau1, __pyx_k_tau1, sizeof(__pyx_k_tau1), 0, 0, 1, 1},
62497 3 : {&__pyx_n_s_tau2, __pyx_k_tau2, sizeof(__pyx_k_tau2), 0, 0, 1, 1},
62498 3 : {&__pyx_n_s_tau_arr, __pyx_k_tau_arr, sizeof(__pyx_k_tau_arr), 0, 0, 1, 1},
62499 3 : {&__pyx_n_s_taus, __pyx_k_taus, sizeof(__pyx_k_taus), 0, 0, 1, 1},
62500 3 : {&__pyx_n_s_taus_v, __pyx_k_taus_v, sizeof(__pyx_k_taus_v), 0, 0, 1, 1},
62501 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
62502 3 : {&__pyx_n_s_tmp_int, __pyx_k_tmp_int, sizeof(__pyx_k_tmp_int), 0, 0, 1, 1},
62503 3 : {&__pyx_n_s_tmp_sca, __pyx_k_tmp_sca, sizeof(__pyx_k_tmp_sca), 0, 0, 1, 1},
62504 3 : {&__pyx_n_s_triu, __pyx_k_triu, sizeof(__pyx_k_triu), 0, 0, 1, 1},
62505 3 : {&__pyx_n_s_twopi, __pyx_k_twopi, sizeof(__pyx_k_twopi), 0, 0, 1, 1},
62506 3 : {&__pyx_n_s_twopii, __pyx_k_twopii, sizeof(__pyx_k_twopii), 0, 0, 1, 1},
62507 3 : {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
62508 3 : {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1},
62509 3 : {&__pyx_n_s_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 0, 1, 1},
62510 3 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
62511 3 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
62512 3 : {&__pyx_n_s_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 1, 1},
62513 3 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
62514 3 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
62515 3 : {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
62516 3 : {&__pyx_n_s_v1, __pyx_k_v1, sizeof(__pyx_k_v1), 0, 0, 1, 1},
62517 3 : {&__pyx_n_s_v2, __pyx_k_v2, sizeof(__pyx_k_v2), 0, 0, 1, 1},
62518 3 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
62519 3 : {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
62520 3 : {&__pyx_n_s_wsave, __pyx_k_wsave, sizeof(__pyx_k_wsave), 0, 0, 1, 1},
62521 3 : {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
62522 3 : {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
62523 3 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
62524 3 : {&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 0, 0, 1, 1},
62525 : {0, 0, 0, 0, 0, 0, 0}
62526 : };
62527 3 : return __Pyx_InitStrings(__pyx_string_tab);
62528 : }
62529 : /* #### Code section: cached_builtins ### */
62530 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
62531 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 146, __pyx_L1_error)
62532 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 305, __pyx_L1_error)
62533 3 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
62534 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 141, __pyx_L1_error)
62535 3 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
62536 3 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
62537 3 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
62538 3 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
62539 3 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
62540 3 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
62541 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
62542 : return 0;
62543 : __pyx_L1_error:;
62544 : return -1;
62545 : }
62546 : /* #### Code section: cached_constants ### */
62547 :
62548 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
62549 : __Pyx_RefNannyDeclarations
62550 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
62551 :
62552 : /* "View.MemoryView":582
62553 : * def suboffsets(self):
62554 : * if self.view.suboffsets == NULL:
62555 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
62556 : *
62557 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
62558 : */
62559 3 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
62560 3 : __Pyx_GOTREF(__pyx_tuple__4);
62561 3 : __Pyx_INCREF(__pyx_int_neg_1);
62562 3 : __Pyx_GIVEREF(__pyx_int_neg_1);
62563 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
62564 3 : __Pyx_GIVEREF(__pyx_tuple__4);
62565 :
62566 : /* "View.MemoryView":679
62567 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
62568 : *
62569 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
62570 : * have_slices = False
62571 : * seen_ellipsis = False
62572 : */
62573 3 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
62574 3 : __Pyx_GOTREF(__pyx_slice__5);
62575 3 : __Pyx_GIVEREF(__pyx_slice__5);
62576 :
62577 : /* "(tree fragment)":4
62578 : * cdef object __pyx_PickleError
62579 : * cdef object __pyx_result
62580 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
62581 : * from pickle import PickleError as __pyx_PickleError
62582 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
62583 : */
62584 3 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
62585 3 : __Pyx_GOTREF(__pyx_tuple__8);
62586 3 : __Pyx_GIVEREF(__pyx_tuple__8);
62587 :
62588 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
62589 : * __pyx_import_array()
62590 : * except Exception:
62591 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
62592 : *
62593 : * cdef inline int import_umath() except -1:
62594 : */
62595 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
62596 3 : __Pyx_GOTREF(__pyx_tuple__9);
62597 3 : __Pyx_GIVEREF(__pyx_tuple__9);
62598 :
62599 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
62600 : * _import_umath()
62601 : * except Exception:
62602 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
62603 : *
62604 : * cdef inline int import_ufunc() except -1:
62605 : */
62606 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
62607 3 : __Pyx_GOTREF(__pyx_tuple__10);
62608 3 : __Pyx_GIVEREF(__pyx_tuple__10);
62609 :
62610 : /* "scipy/linalg/_decomp_interpolative.pyx":222
62611 : * Fc = rfft(rta.T, axis=1)
62612 : * # Move the first col to second col
62613 : * Fc[:, 0] *= 1.j # <<<<<<<<<<<<<<
62614 : * # Perform the final permutation
62615 : * F = Fc.view(np.float64)[:, 1:-1].T[rng.permutation(n2), :]
62616 : */
62617 3 : __pyx_tuple__11 = PyTuple_Pack(2, __pyx_slice__5, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 222, __pyx_L1_error)
62618 3 : __Pyx_GOTREF(__pyx_tuple__11);
62619 3 : __Pyx_GIVEREF(__pyx_tuple__11);
62620 :
62621 : /* "scipy/linalg/_decomp_interpolative.pyx":224
62622 : * Fc[:, 0] *= 1.j
62623 : * # Perform the final permutation
62624 : * F = Fc.view(np.float64)[:, 1:-1].T[rng.permutation(n2), :] # <<<<<<<<<<<<<<
62625 : *
62626 : * Fcopy = F.copy()
62627 : */
62628 3 : __pyx_slice__12 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 224, __pyx_L1_error)
62629 3 : __Pyx_GOTREF(__pyx_slice__12);
62630 3 : __Pyx_GIVEREF(__pyx_slice__12);
62631 3 : __pyx_tuple__13 = PyTuple_Pack(2, __pyx_slice__5, __pyx_slice__12); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 224, __pyx_L1_error)
62632 3 : __Pyx_GOTREF(__pyx_tuple__13);
62633 3 : __Pyx_GIVEREF(__pyx_tuple__13);
62634 :
62635 : /* "scipy/linalg/_decomp_interpolative.pyx":396
62636 : * p[ci, perms[ci]] = 1.0
62637 : *
62638 : * p[:, perms[krank:]] = proj[:, :] # <<<<<<<<<<<<<<
62639 : *
62640 : * inds1, tau1 = iddr_qrpiv(cols, krank)
62641 : */
62642 3 : __pyx_tuple__14 = PyTuple_Pack(2, __pyx_slice__5, __pyx_slice__5); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 396, __pyx_L1_error)
62643 3 : __Pyx_GOTREF(__pyx_tuple__14);
62644 3 : __Pyx_GIVEREF(__pyx_tuple__14);
62645 :
62646 : /* "scipy/linalg/_decomp_interpolative.pyx":844
62647 : * F = F.reshape(F.shape[0]*F.shape[1], -1)
62648 : *
62649 : * csum = np.zeros_like(F[0, :]) # <<<<<<<<<<<<<<
62650 : * rsum = np.zeros_like(F[0, :])
62651 : *
62652 : */
62653 3 : __pyx_tuple__15 = PyTuple_Pack(2, __pyx_int_0, __pyx_slice__5); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 844, __pyx_L1_error)
62654 3 : __Pyx_GOTREF(__pyx_tuple__15);
62655 3 : __Pyx_GIVEREF(__pyx_tuple__15);
62656 :
62657 : /* "scipy/linalg/_decomp_interpolative.pyx":1155
62658 : * # random points on complex unit circle and unitary rotations
62659 : * albetas = np.empty([nsteps, m, 4])
62660 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2]) # <<<<<<<<<<<<<<
62661 : * albetas[:, :, 2:] *= np.pi
62662 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
62663 : */
62664 3 : __pyx_slice__16 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 1155, __pyx_L1_error)
62665 3 : __Pyx_GOTREF(__pyx_slice__16);
62666 3 : __Pyx_GIVEREF(__pyx_slice__16);
62667 3 : __pyx_tuple__17 = PyTuple_Pack(3, __pyx_slice__5, __pyx_slice__5, __pyx_slice__16); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1155, __pyx_L1_error)
62668 3 : __Pyx_GOTREF(__pyx_tuple__17);
62669 3 : __Pyx_GIVEREF(__pyx_tuple__17);
62670 :
62671 : /* "scipy/linalg/_decomp_interpolative.pyx":1157
62672 : * albetas[:, :, 2:] = rng.uniform(low=0.0, high=2.0, size=[nsteps, m, 2])
62673 : * albetas[:, :, 2:] *= np.pi
62674 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0]) # <<<<<<<<<<<<<<
62675 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
62676 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
62677 : */
62678 3 : __pyx_tuple__18 = PyTuple_Pack(3, __pyx_slice__5, __pyx_slice__5, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1157, __pyx_L1_error)
62679 3 : __Pyx_GOTREF(__pyx_tuple__18);
62680 3 : __Pyx_GIVEREF(__pyx_tuple__18);
62681 3 : __pyx_tuple__19 = PyTuple_Pack(3, __pyx_slice__5, __pyx_slice__5, __pyx_int_0); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1157, __pyx_L1_error)
62682 3 : __Pyx_GOTREF(__pyx_tuple__19);
62683 3 : __Pyx_GIVEREF(__pyx_tuple__19);
62684 :
62685 : /* "scipy/linalg/_decomp_interpolative.pyx":1158
62686 : * albetas[:, :, 2:] *= np.pi
62687 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
62688 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1]) # <<<<<<<<<<<<<<
62689 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2])
62690 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
62691 : */
62692 3 : __pyx_tuple__20 = PyTuple_Pack(3, __pyx_slice__5, __pyx_slice__5, __pyx_int_1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1158, __pyx_L1_error)
62693 3 : __Pyx_GOTREF(__pyx_tuple__20);
62694 3 : __Pyx_GIVEREF(__pyx_tuple__20);
62695 :
62696 : /* "scipy/linalg/_decomp_interpolative.pyx":1159
62697 : * np.cos(albetas[:, :, 2], out=albetas[:, :, 0])
62698 : * np.sin(albetas[:, :, 2], out=albetas[:, :, 1])
62699 : * np.cos(albetas[:, :, 3], out=albetas[:, :, 2]) # <<<<<<<<<<<<<<
62700 : * np.sin(albetas[:, :, 3], out=albetas[:, :, 3])
62701 : *
62702 : */
62703 3 : __pyx_tuple__21 = PyTuple_Pack(3, __pyx_slice__5, __pyx_slice__5, __pyx_int_3); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1159, __pyx_L1_error)
62704 3 : __Pyx_GOTREF(__pyx_tuple__21);
62705 3 : __Pyx_GIVEREF(__pyx_tuple__21);
62706 :
62707 : /* "View.MemoryView":100
62708 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
62709 : * try:
62710 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
62711 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
62712 : * else:
62713 : */
62714 3 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 100, __pyx_L1_error)
62715 3 : __Pyx_GOTREF(__pyx_tuple__22);
62716 3 : __Pyx_GIVEREF(__pyx_tuple__22);
62717 3 : __pyx_tuple__23 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 100, __pyx_L1_error)
62718 3 : __Pyx_GOTREF(__pyx_tuple__23);
62719 3 : __Pyx_GIVEREF(__pyx_tuple__23);
62720 :
62721 : /* "View.MemoryView":101
62722 : * try:
62723 : * if __import__("sys").version_info >= (3, 3):
62724 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
62725 : * else:
62726 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
62727 : */
62728 3 : __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 101, __pyx_L1_error)
62729 3 : __Pyx_GOTREF(__pyx_tuple__24);
62730 3 : __Pyx_GIVEREF(__pyx_tuple__24);
62731 :
62732 : /* "View.MemoryView":103
62733 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
62734 : * else:
62735 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
62736 : * except:
62737 : *
62738 : */
62739 3 : __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 103, __pyx_L1_error)
62740 3 : __Pyx_GOTREF(__pyx_tuple__25);
62741 3 : __Pyx_GIVEREF(__pyx_tuple__25);
62742 :
62743 : /* "View.MemoryView":309
62744 : * return self.name
62745 : *
62746 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
62747 : * cdef strided = Enum("<strided and direct>") # default
62748 : * cdef indirect = Enum("<strided and indirect>")
62749 : */
62750 3 : __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 309, __pyx_L1_error)
62751 3 : __Pyx_GOTREF(__pyx_tuple__26);
62752 3 : __Pyx_GIVEREF(__pyx_tuple__26);
62753 :
62754 : /* "View.MemoryView":310
62755 : *
62756 : * cdef generic = Enum("<strided and direct or indirect>")
62757 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
62758 : * cdef indirect = Enum("<strided and indirect>")
62759 : *
62760 : */
62761 3 : __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 310, __pyx_L1_error)
62762 3 : __Pyx_GOTREF(__pyx_tuple__27);
62763 3 : __Pyx_GIVEREF(__pyx_tuple__27);
62764 :
62765 : /* "View.MemoryView":311
62766 : * cdef generic = Enum("<strided and direct or indirect>")
62767 : * cdef strided = Enum("<strided and direct>") # default
62768 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
62769 : *
62770 : *
62771 : */
62772 3 : __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 311, __pyx_L1_error)
62773 3 : __Pyx_GOTREF(__pyx_tuple__28);
62774 3 : __Pyx_GIVEREF(__pyx_tuple__28);
62775 :
62776 : /* "View.MemoryView":314
62777 : *
62778 : *
62779 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
62780 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
62781 : *
62782 : */
62783 3 : __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 314, __pyx_L1_error)
62784 3 : __Pyx_GOTREF(__pyx_tuple__29);
62785 3 : __Pyx_GIVEREF(__pyx_tuple__29);
62786 :
62787 : /* "View.MemoryView":315
62788 : *
62789 : * cdef contiguous = Enum("<contiguous and direct>")
62790 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
62791 : *
62792 : *
62793 : */
62794 3 : __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 315, __pyx_L1_error)
62795 3 : __Pyx_GOTREF(__pyx_tuple__30);
62796 3 : __Pyx_GIVEREF(__pyx_tuple__30);
62797 :
62798 : /* "(tree fragment)":1
62799 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
62800 : * cdef object __pyx_PickleError
62801 : * cdef object __pyx_result
62802 : */
62803 3 : __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 1, __pyx_L1_error)
62804 3 : __Pyx_GOTREF(__pyx_tuple__31);
62805 3 : __Pyx_GIVEREF(__pyx_tuple__31);
62806 3 : __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 1, __pyx_L1_error)
62807 :
62808 : /* "scipy/linalg/_decomp_interpolative.pyx":115
62809 : * from libc.math cimport hypot
62810 : *
62811 : * import scipy.linalg as la # <<<<<<<<<<<<<<
62812 : * from scipy.fft import rfft, fft
62813 : * from scipy.sparse.linalg import LinearOperator
62814 : */
62815 3 : __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_scipy, __pyx_n_s_linalg); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 115, __pyx_L1_error)
62816 3 : __Pyx_GOTREF(__pyx_tuple__33);
62817 3 : __Pyx_GIVEREF(__pyx_tuple__33);
62818 :
62819 : /* "scipy/linalg/_decomp_interpolative.pyx":135
62820 : *
62821 : *
62822 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
62823 : * cdef int n = A.shape[1], j = 0, intone = 1
62824 : * cdef cnp.float64_t snorm = 0.0
62825 : */
62826 3 : __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_rng, __pyx_n_s_its, __pyx_n_s_n, __pyx_n_s_j, __pyx_n_s_intone, __pyx_n_s_snorm, __pyx_n_s_v1, __pyx_n_s_v2, __pyx_n_s_u1, __pyx_n_s_u2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 135, __pyx_L1_error)
62827 3 : __Pyx_GOTREF(__pyx_tuple__34);
62828 3 : __Pyx_GIVEREF(__pyx_tuple__34);
62829 3 : __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_diffsnorm, 135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 135, __pyx_L1_error)
62830 :
62831 : /* "scipy/linalg/_decomp_interpolative.pyx":163
62832 : *
62833 : *
62834 : * def idd_estrank(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
62835 : * rng):
62836 : * cdef int m = a.shape[0], n = a.shape[1]
62837 : */
62838 3 : __pyx_tuple__36 = PyTuple_Pack(30, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_intone, __pyx_n_s_n2, __pyx_n_s_nsteps, __pyx_n_s_row, __pyx_n_s_r, __pyx_n_s_nstep, __pyx_n_s_cols, __pyx_n_s_k, __pyx_n_s_nulls, __pyx_n_s_h, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_albetas, __pyx_n_s_tau_arr, __pyx_n_s_subselect, __pyx_n_s_aa, __pyx_n_s_ff, __pyx_n_s_Fmemview, __pyx_n_s_giv2x2, __pyx_n_s_rta, __pyx_n_s_Fc, __pyx_n_s_F, __pyx_n_s_Fcopy, __pyx_n_s_sssmax, __pyx_n_s_kk); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 163, __pyx_L1_error)
62839 3 : __Pyx_GOTREF(__pyx_tuple__36);
62840 3 : __Pyx_GIVEREF(__pyx_tuple__36);
62841 3 : __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 30, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_estrank, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 163, __pyx_L1_error)
62842 :
62843 : /* "scipy/linalg/_decomp_interpolative.pyx":279
62844 : *
62845 : *
62846 : * def idd_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
62847 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
62848 : *
62849 : */
62850 3 : __pyx_tuple__38 = PyTuple_Pack(21, __pyx_n_s_A, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_kk, __pyx_n_s_r, __pyx_n_s_krank, __pyx_n_s_no_of_cols, __pyx_n_s_intone, __pyx_n_s_info, __pyx_n_s_tau, __pyx_n_s_y, __pyx_n_s_retarr, __pyx_n_s_ra, __pyx_n_s_reallocated_ra, __pyx_n_s_ret, __pyx_n_s_reallocated_ret, __pyx_n_s_enorm, __pyx_n_s_x); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 279, __pyx_L1_error)
62851 3 : __Pyx_GOTREF(__pyx_tuple__38);
62852 3 : __Pyx_GIVEREF(__pyx_tuple__38);
62853 3 : __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_findrank, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 279, __pyx_L1_error)
62854 :
62855 : /* "scipy/linalg/_decomp_interpolative.pyx":370
62856 : *
62857 : *
62858 : * def idd_id2svd( # <<<<<<<<<<<<<<
62859 : * cnp.ndarray[cnp.float64_t, mode='c', ndim=2] cols,
62860 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
62861 : */
62862 3 : __pyx_tuple__40 = PyTuple_Pack(22, __pyx_n_s_cols, __pyx_n_s_perms, __pyx_n_s_proj, __pyx_n_s_m, __pyx_n_s_krank, __pyx_n_s_n, __pyx_n_s_info, __pyx_n_s_ci, __pyx_n_s_C, __pyx_n_s_tau1, __pyx_n_s_tau2, __pyx_n_s_UU, __pyx_n_s_S, __pyx_n_s_V, __pyx_n_s_VV, __pyx_n_s_inds1, __pyx_n_s_inds2, __pyx_n_s_p, __pyx_n_s_r, __pyx_n_s_t, __pyx_n_s_r2, __pyx_n_s_r3); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 370, __pyx_L1_error)
62863 3 : __Pyx_GOTREF(__pyx_tuple__40);
62864 3 : __Pyx_GIVEREF(__pyx_tuple__40);
62865 3 : __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_id2svd, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 370, __pyx_L1_error)
62866 :
62867 : /* "scipy/linalg/_decomp_interpolative.pyx":448
62868 : *
62869 : *
62870 : * def idd_reconid(B, idx, proj): # <<<<<<<<<<<<<<
62871 : * cdef int m = B.shape[0], krank = B.shape[1]
62872 : * cdef int n = len(idx)
62873 : */
62874 3 : __pyx_tuple__42 = PyTuple_Pack(7, __pyx_n_s_B, __pyx_n_s_idx, __pyx_n_s_proj, __pyx_n_s_m, __pyx_n_s_krank, __pyx_n_s_n, __pyx_n_s_approx); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 448, __pyx_L1_error)
62875 3 : __Pyx_GOTREF(__pyx_tuple__42);
62876 3 : __Pyx_GIVEREF(__pyx_tuple__42);
62877 3 : __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_reconid, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 448, __pyx_L1_error)
62878 :
62879 : /* "scipy/linalg/_decomp_interpolative.pyx":459
62880 : *
62881 : *
62882 : * def idd_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
62883 : * cdef int n = A.shape[1]
62884 : * cdef int j = 0, intone = 1
62885 : */
62886 3 : __pyx_tuple__44 = PyTuple_Pack(9, __pyx_n_s_A, __pyx_n_s_rng, __pyx_n_s_its, __pyx_n_s_n, __pyx_n_s_j, __pyx_n_s_intone, __pyx_n_s_snorm, __pyx_n_s_v, __pyx_n_s_u); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 459, __pyx_L1_error)
62887 3 : __Pyx_GOTREF(__pyx_tuple__44);
62888 3 : __Pyx_GIVEREF(__pyx_tuple__44);
62889 3 : __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idd_snorm, 459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 459, __pyx_L1_error)
62890 :
62891 : /* "scipy/linalg/_decomp_interpolative.pyx":481
62892 : *
62893 : *
62894 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
62895 : * krank, proj = idd_estrank(a, eps, rng=rng)
62896 : * if krank != 0:
62897 : */
62898 3 : __pyx_tuple__46 = PyTuple_Pack(5, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_krank, __pyx_n_s_proj); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 481, __pyx_L1_error)
62899 3 : __Pyx_GOTREF(__pyx_tuple__46);
62900 3 : __Pyx_GIVEREF(__pyx_tuple__46);
62901 3 : __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_aid, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 481, __pyx_L1_error)
62902 :
62903 : /* "scipy/linalg/_decomp_interpolative.pyx":490
62904 : *
62905 : *
62906 : * def iddp_asvd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
62907 : * cdef int m = a.shape[0], n = a.shape[1]
62908 : * cdef int krank, info, ci
62909 : */
62910 3 : __pyx_tuple__48 = PyTuple_Pack(25, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_krank, __pyx_n_s_info, __pyx_n_s_ci, __pyx_n_s_C, __pyx_n_s_tau1, __pyx_n_s_tau2, __pyx_n_s_UU, __pyx_n_s_S, __pyx_n_s_V, __pyx_n_s_VV, __pyx_n_s_proj, __pyx_n_s_perms, __pyx_n_s_inds1, __pyx_n_s_inds2, __pyx_n_s_p, __pyx_n_s_col, __pyx_n_s_r, __pyx_n_s_t, __pyx_n_s_r2, __pyx_n_s_r3); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 490, __pyx_L1_error)
62911 3 : __Pyx_GOTREF(__pyx_tuple__48);
62912 3 : __Pyx_GIVEREF(__pyx_tuple__48);
62913 3 : __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_asvd, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 490, __pyx_L1_error)
62914 :
62915 : /* "scipy/linalg/_decomp_interpolative.pyx":554
62916 : *
62917 : *
62918 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
62919 : * cdef int n = a.shape[1], krank, tmp_int, p
62920 : * cdef cnp.float64_t one = 1
62921 : */
62922 3 : __pyx_tuple__51 = PyTuple_Pack(10, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_n, __pyx_n_s_krank, __pyx_n_s_tmp_int, __pyx_n_s_p, __pyx_n_s_one, __pyx_n_s__50, __pyx_n_s_inds, __pyx_n_s_perms); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 554, __pyx_L1_error)
62923 3 : __Pyx_GOTREF(__pyx_tuple__51);
62924 3 : __Pyx_GIVEREF(__pyx_tuple__51);
62925 3 : __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_id, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 554, __pyx_L1_error)
62926 :
62927 : /* "scipy/linalg/_decomp_interpolative.pyx":593
62928 : *
62929 : *
62930 : * def iddp_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
62931 : * """
62932 : * This is a minimal version of ?GEQP3 from LAPACK with an
62933 : */
62934 3 : __pyx_tuple__53 = PyTuple_Pack(18, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_col_norms, __pyx_n_s_k, __pyx_n_s_kpiv, __pyx_n_s_i, __pyx_n_s_tmp_int, __pyx_n_s_int_n, __pyx_n_s_tmp_sca, __pyx_n_s_taus, __pyx_n_s_ind, __pyx_n_s_taus_v, __pyx_n_s_feps, __pyx_n_s_ssmax, __pyx_n_s_ssmaxin, __pyx_n_s_nupdate); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 593, __pyx_L1_error)
62935 3 : __Pyx_GOTREF(__pyx_tuple__53);
62936 3 : __Pyx_GIVEREF(__pyx_tuple__53);
62937 3 : __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_qrpiv, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 593, __pyx_L1_error)
62938 :
62939 : /* "scipy/linalg/_decomp_interpolative.pyx":673
62940 : *
62941 : *
62942 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
62943 : * _, ret = idd_findrank(A, eps, rng=rng)
62944 : * return iddp_id(ret, eps)
62945 : */
62946 3 : __pyx_tuple__55 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s__50, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 673, __pyx_L1_error)
62947 3 : __Pyx_GOTREF(__pyx_tuple__55);
62948 3 : __Pyx_GIVEREF(__pyx_tuple__55);
62949 3 : __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_rid, 673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 673, __pyx_L1_error)
62950 :
62951 : /* "scipy/linalg/_decomp_interpolative.pyx":678
62952 : *
62953 : *
62954 : * def iddp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
62955 : * cdef int n = A.shape[1]
62956 : * cdef int krank, j
62957 : */
62958 3 : __pyx_tuple__57 = PyTuple_Pack(10, __pyx_n_s_A, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_n, __pyx_n_s_krank, __pyx_n_s_j, __pyx_n_s_perms, __pyx_n_s_proj, __pyx_n_s_col, __pyx_n_s_x); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 678, __pyx_L1_error)
62959 3 : __Pyx_GOTREF(__pyx_tuple__57);
62960 3 : __Pyx_GIVEREF(__pyx_tuple__57);
62961 3 : __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_rsvd, 678, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 678, __pyx_L1_error)
62962 :
62963 : /* "scipy/linalg/_decomp_interpolative.pyx":703
62964 : *
62965 : *
62966 : * def iddp_svd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
62967 : * """a is overwritten"""
62968 : * cdef int m = a.shape[0], krank, info
62969 : */
62970 3 : __pyx_tuple__59 = PyTuple_Pack(14, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_m, __pyx_n_s_krank, __pyx_n_s_info, __pyx_n_s_taus, __pyx_n_s_UU, __pyx_n_s_C, __pyx_n_s_inds, __pyx_n_s_r, __pyx_n_s_p, __pyx_n_s_U, __pyx_n_s_S, __pyx_n_s_V); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 703, __pyx_L1_error)
62971 3 : __Pyx_GOTREF(__pyx_tuple__59);
62972 3 : __Pyx_GIVEREF(__pyx_tuple__59);
62973 3 : __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddp_svd, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 703, __pyx_L1_error)
62974 :
62975 : /* "scipy/linalg/_decomp_interpolative.pyx":736
62976 : *
62977 : *
62978 : * def iddr_aid(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
62979 : * rng):
62980 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, L
62981 : */
62982 3 : __pyx_tuple__61 = PyTuple_Pack(40, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_n2, __pyx_n_s_nsteps, __pyx_n_s_row, __pyx_n_s_r, __pyx_n_s_nstep, __pyx_n_s_L, __pyx_n_s_h, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_albetas, __pyx_n_s_subselect, __pyx_n_s_aa, __pyx_n_s_giv2x2, __pyx_n_s_rta, __pyx_n_s_marker, __pyx_n_s_inds, __pyx_n_s_proj, __pyx_n_s_ind, __pyx_n_s_ind2, __pyx_n_s_k, __pyx_n_s_l2, __pyx_n_s_twopi, __pyx_n_s_twopii, __pyx_n_s_nblock, __pyx_n_s_fact, __pyx_n_s_wsave, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_idivm, __pyx_n_s_imodm, __pyx_n_s_F, __pyx_n_s_csum, __pyx_n_s_rsum, __pyx_n_s_perms, __pyx_n_s_x); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 736, __pyx_L1_error)
62983 3 : __Pyx_GOTREF(__pyx_tuple__61);
62984 3 : __Pyx_GIVEREF(__pyx_tuple__61);
62985 3 : __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 40, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_aid, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 736, __pyx_L1_error)
62986 :
62987 : /* "scipy/linalg/_decomp_interpolative.pyx":888
62988 : *
62989 : *
62990 : * def iddr_asvd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
62991 : * rng):
62992 : * cdef int m = a.shape[0], n = a.shape[1]
62993 : */
62994 3 : __pyx_tuple__63 = PyTuple_Pack(24, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_info, __pyx_n_s_ci, __pyx_n_s_C, __pyx_n_s_tau1, __pyx_n_s_tau2, __pyx_n_s_UU, __pyx_n_s_S, __pyx_n_s_V, __pyx_n_s_VV, __pyx_n_s_proj, __pyx_n_s_perms, __pyx_n_s_inds1, __pyx_n_s_inds2, __pyx_n_s_p, __pyx_n_s_col, __pyx_n_s_r, __pyx_n_s_t, __pyx_n_s_r2, __pyx_n_s_r3); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 888, __pyx_L1_error)
62995 3 : __Pyx_GOTREF(__pyx_tuple__63);
62996 3 : __Pyx_GIVEREF(__pyx_tuple__63);
62997 3 : __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_asvd, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 888, __pyx_L1_error)
62998 :
62999 : /* "scipy/linalg/_decomp_interpolative.pyx":951
63000 : *
63001 : *
63002 : * def iddr_id(cnp.ndarray[cnp.float64_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
63003 : * cdef int n = a.shape[1]
63004 : * cdef int tmp_int
63005 : */
63006 3 : __pyx_tuple__65 = PyTuple_Pack(9, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_n, __pyx_n_s_tmp_int, __pyx_n_s_one, __pyx_n_s_inds, __pyx_n_s_perms, __pyx_n_s__50, __pyx_n_s_p); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 951, __pyx_L1_error)
63007 3 : __Pyx_GOTREF(__pyx_tuple__65);
63008 3 : __Pyx_GIVEREF(__pyx_tuple__65);
63009 3 : __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_id, 951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 951, __pyx_L1_error)
63010 :
63011 : /* "scipy/linalg/_decomp_interpolative.pyx":977
63012 : *
63013 : *
63014 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int): # <<<<<<<<<<<<<<
63015 : * cdef int m = a.shape[0], n = a.shape[1]
63016 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
63017 : */
63018 3 : __pyx_tuple__67 = PyTuple_Pack(19, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_col_norms, __pyx_n_s_loop, __pyx_n_s_loops, __pyx_n_s_kpiv, __pyx_n_s_i, __pyx_n_s_tmp_int, __pyx_n_s_int_n, __pyx_n_s_tmp_sca, __pyx_n_s_taus, __pyx_n_s_ind, __pyx_n_s_taus_v, __pyx_n_s_feps, __pyx_n_s_ssmax, __pyx_n_s_ssmaxin, __pyx_n_s_nupdate); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 977, __pyx_L1_error)
63019 3 : __Pyx_GOTREF(__pyx_tuple__67);
63020 3 : __Pyx_GIVEREF(__pyx_tuple__67);
63021 3 : __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_qrpiv, 977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 977, __pyx_L1_error)
63022 :
63023 : /* "scipy/linalg/_decomp_interpolative.pyx":1047
63024 : *
63025 : *
63026 : * def iddr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
63027 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
63028 : * cdef int L = min(krank+2, min(m, n))
63029 : */
63030 3 : __pyx_tuple__69 = PyTuple_Pack(8, __pyx_n_s_A, __pyx_n_s_krank, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_L, __pyx_n_s_r); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 1047, __pyx_L1_error)
63031 3 : __Pyx_GOTREF(__pyx_tuple__69);
63032 3 : __Pyx_GIVEREF(__pyx_tuple__69);
63033 3 : __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_rid, 1047, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1047, __pyx_L1_error)
63034 :
63035 : /* "scipy/linalg/_decomp_interpolative.pyx":1059
63036 : *
63037 : *
63038 : * def iddr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
63039 : * cdef int n = A.shape[1], j
63040 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
63041 : */
63042 3 : __pyx_tuple__71 = PyTuple_Pack(9, __pyx_n_s_A, __pyx_n_s_krank, __pyx_n_s_rng, __pyx_n_s_n, __pyx_n_s_j, __pyx_n_s_perms, __pyx_n_s_proj, __pyx_n_s_col, __pyx_n_s_x); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1059, __pyx_L1_error)
63043 3 : __Pyx_GOTREF(__pyx_tuple__71);
63044 3 : __Pyx_GIVEREF(__pyx_tuple__71);
63045 3 : __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_rsvd, 1059, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1059, __pyx_L1_error)
63046 :
63047 : /* "scipy/linalg/_decomp_interpolative.pyx":1077
63048 : *
63049 : *
63050 : * def iddr_svd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank): # <<<<<<<<<<<<<<
63051 : * cdef int m = a.shape[0], info = 0
63052 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
63053 : */
63054 3 : __pyx_tuple__73 = PyTuple_Pack(13, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_m, __pyx_n_s_info, __pyx_n_s_taus, __pyx_n_s_UU, __pyx_n_s_C, __pyx_n_s_inds, __pyx_n_s_r, __pyx_n_s_p, __pyx_n_s_U, __pyx_n_s_S, __pyx_n_s_V); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1077, __pyx_L1_error)
63055 3 : __Pyx_GOTREF(__pyx_tuple__73);
63056 3 : __Pyx_GIVEREF(__pyx_tuple__73);
63057 3 : __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_iddr_svd, 1077, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1077, __pyx_L1_error)
63058 :
63059 : /* "scipy/linalg/_decomp_interpolative.pyx":1108
63060 : *
63061 : *
63062 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
63063 : * cdef int n = A.shape[1], j = 0, intone = 1
63064 : * cdef cnp.float64_t snorm = 0.0
63065 : */
63066 3 : __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_diffsnorm, 1108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 1108, __pyx_L1_error)
63067 :
63068 : /* "scipy/linalg/_decomp_interpolative.pyx":1136
63069 : *
63070 : *
63071 : * def idz_estrank(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
63072 : * rng):
63073 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, cols, k
63074 : */
63075 3 : __pyx_tuple__76 = PyTuple_Pack(26, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_n2, __pyx_n_s_nsteps, __pyx_n_s_row, __pyx_n_s_r, __pyx_n_s_nstep, __pyx_n_s_cols, __pyx_n_s_k, __pyx_n_s_h, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_albetas, __pyx_n_s_tau_arr, __pyx_n_s_subselect, __pyx_n_s_ff, __pyx_n_s_giv2x2, __pyx_n_s_rta, __pyx_n_s_F, __pyx_n_s_Fcopy, __pyx_n_s_sssmax, __pyx_n_s_nulls, __pyx_n_s_kk); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1136, __pyx_L1_error)
63076 3 : __Pyx_GOTREF(__pyx_tuple__76);
63077 3 : __Pyx_GIVEREF(__pyx_tuple__76);
63078 3 : __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_estrank, 1136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 1136, __pyx_L1_error)
63079 :
63080 : /* "scipy/linalg/_decomp_interpolative.pyx":1226
63081 : *
63082 : *
63083 : * def idz_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
63084 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
63085 : *
63086 : */
63087 3 : __pyx_tuple__78 = PyTuple_Pack(21, __pyx_n_s_A, __pyx_n_s_eps, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_kk, __pyx_n_s_r, __pyx_n_s_krank, __pyx_n_s_no_of_cols, __pyx_n_s_intone, __pyx_n_s_info, __pyx_n_s_tau, __pyx_n_s_y, __pyx_n_s_retarr, __pyx_n_s_x, __pyx_n_s_ra, __pyx_n_s_reallocated_ra, __pyx_n_s_ret, __pyx_n_s_reallocated_ret, __pyx_n_s_enorm); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1226, __pyx_L1_error)
63088 3 : __Pyx_GOTREF(__pyx_tuple__78);
63089 3 : __Pyx_GIVEREF(__pyx_tuple__78);
63090 3 : __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_findrank, 1226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 1226, __pyx_L1_error)
63091 :
63092 : /* "scipy/linalg/_decomp_interpolative.pyx":1320
63093 : *
63094 : *
63095 : * def idz_id2svd( # <<<<<<<<<<<<<<
63096 : * cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] cols,
63097 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
63098 : */
63099 3 : __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_id2svd, 1320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1320, __pyx_L1_error)
63100 :
63101 : /* "scipy/linalg/_decomp_interpolative.pyx":1384
63102 : *
63103 : *
63104 : * def idz_reconid(B, idx, proj): # <<<<<<<<<<<<<<
63105 : * cdef int m = B.shape[0], krank = B.shape[1]
63106 : * cdef int n = len(idx)
63107 : */
63108 3 : __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_reconid, 1384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 1384, __pyx_L1_error)
63109 :
63110 : /* "scipy/linalg/_decomp_interpolative.pyx":1395
63111 : *
63112 : *
63113 : * def idz_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
63114 : * cdef int n = A.shape[1]
63115 : * cdef int j = 0, intone = 1
63116 : */
63117 3 : __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idz_snorm, 1395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1395, __pyx_L1_error)
63118 :
63119 : /* "scipy/linalg/_decomp_interpolative.pyx":1417
63120 : *
63121 : *
63122 : * def idzp_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
63123 : * rng):
63124 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
63125 : */
63126 3 : __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_aid, 1417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1417, __pyx_L1_error)
63127 :
63128 : /* "scipy/linalg/_decomp_interpolative.pyx":1427
63129 : *
63130 : *
63131 : * def idzp_asvd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps, *, # <<<<<<<<<<<<<<
63132 : * rng):
63133 : * cdef int m = a.shape[0], n = a.shape[1]
63134 : */
63135 3 : __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_asvd, 1427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1427, __pyx_L1_error)
63136 :
63137 : /* "scipy/linalg/_decomp_interpolative.pyx":1494
63138 : *
63139 : *
63140 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
63141 : * cdef int n = a.shape[1], krank, tmp_int, p
63142 : * cdef double complex one = 1
63143 : */
63144 3 : __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_id, 1494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 1494, __pyx_L1_error)
63145 :
63146 : /* "scipy/linalg/_decomp_interpolative.pyx":1517
63147 : *
63148 : *
63149 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
63150 : * cdef int m = a.shape[0], n = a.shape[1]
63151 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
63152 : */
63153 3 : __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_qrpiv, 1517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 1517, __pyx_L1_error)
63154 :
63155 : /* "scipy/linalg/_decomp_interpolative.pyx":1595
63156 : *
63157 : *
63158 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
63159 : * _, ret = idz_findrank(A, eps, rng=rng)
63160 : * return idzp_id(ret, eps=eps)
63161 : */
63162 3 : __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_rid, 1595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1595, __pyx_L1_error)
63163 :
63164 : /* "scipy/linalg/_decomp_interpolative.pyx":1600
63165 : *
63166 : *
63167 : * def idzp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
63168 : * cdef int n = A.shape[1]
63169 : * cdef int krank, j
63170 : */
63171 3 : __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_rsvd, 1600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 1600, __pyx_L1_error)
63172 :
63173 : /* "scipy/linalg/_decomp_interpolative.pyx":1626
63174 : *
63175 : *
63176 : * def idzp_svd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
63177 : * cdef int m = a.shape[0], krank, info
63178 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
63179 : */
63180 3 : __pyx_tuple__89 = PyTuple_Pack(13, __pyx_n_s_a, __pyx_n_s_eps, __pyx_n_s_m, __pyx_n_s_krank, __pyx_n_s_info, __pyx_n_s_taus, __pyx_n_s_UU, __pyx_n_s_V, __pyx_n_s_r, __pyx_n_s_C, __pyx_n_s_S, __pyx_n_s_inds, __pyx_n_s_p); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1626, __pyx_L1_error)
63181 3 : __Pyx_GOTREF(__pyx_tuple__89);
63182 3 : __Pyx_GIVEREF(__pyx_tuple__89);
63183 3 : __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzp_svd, 1626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 1626, __pyx_L1_error)
63184 :
63185 : /* "scipy/linalg/_decomp_interpolative.pyx":1657
63186 : *
63187 : *
63188 : * def idzr_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
63189 : * rng):
63190 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
63191 : */
63192 3 : __pyx_tuple__91 = PyTuple_Pack(28, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_rng, __pyx_n_s_m, __pyx_n_s_n2, __pyx_n_s_L, __pyx_n_s_nblock, __pyx_n_s_nsteps, __pyx_n_s_mb, __pyx_n_s_twopi, __pyx_n_s_fact, __pyx_n_s_twopii, __pyx_n_s_ind, __pyx_n_s_subselect, __pyx_n_s_dm1, __pyx_n_s_dm2, __pyx_n_s_albetas, __pyx_n_s_rta, __pyx_n_s_giv2x2, __pyx_n_s_inds, __pyx_n_s_proj, __pyx_n_s_nstep, __pyx_n_s_row, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_wsave, __pyx_n_s_F, __pyx_n_s_V); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 1657, __pyx_L1_error)
63193 3 : __Pyx_GOTREF(__pyx_tuple__91);
63194 3 : __Pyx_GIVEREF(__pyx_tuple__91);
63195 3 : __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_aid, 1657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 1657, __pyx_L1_error)
63196 :
63197 : /* "scipy/linalg/_decomp_interpolative.pyx":1744
63198 : *
63199 : *
63200 : * def idzr_asvd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank, *, rng): # <<<<<<<<<<<<<<
63201 : * cdef int m = a.shape[0], n = a.shape[1]
63202 : * cdef int info, ci
63203 : */
63204 3 : __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_asvd, 1744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1744, __pyx_L1_error)
63205 :
63206 : /* "scipy/linalg/_decomp_interpolative.pyx":1808
63207 : *
63208 : *
63209 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
63210 : * cdef int n = a.shape[1], tmp_int, p
63211 : * cdef double complex one = 1.0
63212 : */
63213 3 : __pyx_tuple__94 = PyTuple_Pack(9, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_n, __pyx_n_s_tmp_int, __pyx_n_s_p, __pyx_n_s_one, __pyx_n_s_inds, __pyx_n_s_perms, __pyx_n_s__50); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1808, __pyx_L1_error)
63214 3 : __Pyx_GOTREF(__pyx_tuple__94);
63215 3 : __Pyx_GIVEREF(__pyx_tuple__94);
63216 3 : __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_id, 1808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 1808, __pyx_L1_error)
63217 :
63218 : /* "scipy/linalg/_decomp_interpolative.pyx":1831
63219 : *
63220 : *
63221 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
63222 : * cdef int m = a.shape[0], n = a.shape[1]
63223 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
63224 : */
63225 3 : __pyx_tuple__96 = PyTuple_Pack(18, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_loop, __pyx_n_s_loops, __pyx_n_s_kpiv, __pyx_n_s_i, __pyx_n_s_tmp_int, __pyx_n_s_col_norms, __pyx_n_s_tmp_sca, __pyx_n_s_taus, __pyx_n_s_ind, __pyx_n_s_taus_v, __pyx_n_s_feps, __pyx_n_s_ssmax, __pyx_n_s_ssmaxin, __pyx_n_s_nupdate); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1831, __pyx_L1_error)
63226 3 : __Pyx_GOTREF(__pyx_tuple__96);
63227 3 : __Pyx_GIVEREF(__pyx_tuple__96);
63228 3 : __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_qrpiv, 1831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 1831, __pyx_L1_error)
63229 :
63230 : /* "scipy/linalg/_decomp_interpolative.pyx":1901
63231 : *
63232 : *
63233 : * def idzr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
63234 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
63235 : * cdef int L = min(krank+2, min(m, n))
63236 : */
63237 3 : __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_rid, 1901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1901, __pyx_L1_error)
63238 :
63239 : /* "scipy/linalg/_decomp_interpolative.pyx":1913
63240 : *
63241 : *
63242 : * def idzr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
63243 : * cdef int n = A.shape[1], j
63244 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
63245 : */
63246 3 : __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 1, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_rsvd, 1913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 1913, __pyx_L1_error)
63247 :
63248 : /* "scipy/linalg/_decomp_interpolative.pyx":1931
63249 : *
63250 : *
63251 : * def idzr_svd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
63252 : * cdef int m = a.shape[0], n = a.shape[1], info = 0
63253 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
63254 : */
63255 3 : __pyx_tuple__100 = PyTuple_Pack(13, __pyx_n_s_a, __pyx_n_s_krank, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_info, __pyx_n_s_taus, __pyx_n_s_inds, __pyx_n_s_UU, __pyx_n_s_C, __pyx_n_s_r, __pyx_n_s_p, __pyx_n_s_S, __pyx_n_s_V); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1931, __pyx_L1_error)
63256 3 : __Pyx_GOTREF(__pyx_tuple__100);
63257 3 : __Pyx_GIVEREF(__pyx_tuple__100);
63258 3 : __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_idzr_svd, 1931, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 1931, __pyx_L1_error)
63259 : __Pyx_RefNannyFinishContext();
63260 : return 0;
63261 : __pyx_L1_error:;
63262 : __Pyx_RefNannyFinishContext();
63263 : return -1;
63264 : }
63265 : /* #### Code section: init_constants ### */
63266 :
63267 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
63268 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
63269 3 : __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
63270 3 : __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
63271 3 : __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
63272 3 : __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
63273 3 : __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
63274 3 : __pyx_float_neg_1_ = PyFloat_FromDouble(-1.); if (unlikely(!__pyx_float_neg_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
63275 3 : __pyx_float_neg_1_0 = PyFloat_FromDouble(-1.0); if (unlikely(!__pyx_float_neg_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
63276 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
63277 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
63278 3 : __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
63279 3 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
63280 3 : __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
63281 3 : __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
63282 3 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
63283 3 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
63284 3 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
63285 3 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
63286 : return 0;
63287 : __pyx_L1_error:;
63288 : return -1;
63289 : }
63290 : /* #### Code section: init_globals ### */
63291 :
63292 3 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
63293 : /* AssertionsEnabled.init */
63294 3 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
63295 :
63296 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
63297 :
63298 : return 0;
63299 0 : __pyx_L1_error:;
63300 0 : return -1;
63301 : }
63302 : /* #### Code section: init_module ### */
63303 :
63304 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
63305 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
63306 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
63307 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
63308 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
63309 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
63310 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
63311 :
63312 3 : static int __Pyx_modinit_global_init_code(void) {
63313 : __Pyx_RefNannyDeclarations
63314 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
63315 : /*--- Global init code ---*/
63316 3 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
63317 3 : generic = Py_None; Py_INCREF(Py_None);
63318 3 : strided = Py_None; Py_INCREF(Py_None);
63319 3 : indirect = Py_None; Py_INCREF(Py_None);
63320 3 : contiguous = Py_None; Py_INCREF(Py_None);
63321 3 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
63322 3 : __Pyx_RefNannyFinishContext();
63323 3 : return 0;
63324 : }
63325 :
63326 : static int __Pyx_modinit_variable_export_code(void) {
63327 : __Pyx_RefNannyDeclarations
63328 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
63329 : /*--- Variable export code ---*/
63330 : __Pyx_RefNannyFinishContext();
63331 : return 0;
63332 : }
63333 :
63334 : static int __Pyx_modinit_function_export_code(void) {
63335 : __Pyx_RefNannyDeclarations
63336 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
63337 : /*--- Function export code ---*/
63338 : __Pyx_RefNannyFinishContext();
63339 : return 0;
63340 : }
63341 :
63342 3 : static int __Pyx_modinit_type_init_code(void) {
63343 : __Pyx_RefNannyDeclarations
63344 3 : PyObject *__pyx_t_1 = NULL;
63345 3 : int __pyx_lineno = 0;
63346 3 : const char *__pyx_filename = NULL;
63347 3 : int __pyx_clineno = 0;
63348 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
63349 : /*--- Type init code ---*/
63350 3 : __pyx_vtabptr_array = &__pyx_vtable_array;
63351 3 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
63352 : #if CYTHON_USE_TYPE_SPECS
63353 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
63354 : #if !CYTHON_COMPILING_IN_LIMITED_API
63355 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
63356 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
63357 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
63358 : }
63359 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
63360 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
63361 : #elif defined(_MSC_VER)
63362 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
63363 : #else
63364 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
63365 : #endif
63366 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
63367 : #else
63368 3 : __pyx_array_type = &__pyx_type___pyx_array;
63369 : #endif
63370 : #if !CYTHON_COMPILING_IN_LIMITED_API
63371 : #endif
63372 : #if !CYTHON_USE_TYPE_SPECS
63373 3 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
63374 : #endif
63375 : #if PY_MAJOR_VERSION < 3
63376 : __pyx_array_type->tp_print = 0;
63377 : #endif
63378 3 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
63379 : #if !CYTHON_COMPILING_IN_LIMITED_API
63380 3 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
63381 : #endif
63382 : #if !CYTHON_COMPILING_IN_LIMITED_API
63383 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
63384 : #endif
63385 : #if CYTHON_USE_TYPE_SPECS
63386 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
63387 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
63388 : #else
63389 3 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
63390 : #endif
63391 : #if !CYTHON_COMPILING_IN_LIMITED_API
63392 : #endif
63393 : #if !CYTHON_USE_TYPE_SPECS
63394 3 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
63395 : #endif
63396 : #if PY_MAJOR_VERSION < 3
63397 : __pyx_MemviewEnum_type->tp_print = 0;
63398 : #endif
63399 : #if !CYTHON_COMPILING_IN_LIMITED_API
63400 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
63401 3 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
63402 : }
63403 : #endif
63404 : #if !CYTHON_COMPILING_IN_LIMITED_API
63405 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
63406 : #endif
63407 3 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
63408 3 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
63409 3 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
63410 3 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
63411 3 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
63412 3 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
63413 3 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
63414 3 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
63415 3 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
63416 : #if CYTHON_USE_TYPE_SPECS
63417 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
63418 : #if !CYTHON_COMPILING_IN_LIMITED_API
63419 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
63420 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
63421 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
63422 : }
63423 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
63424 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
63425 : #elif defined(_MSC_VER)
63426 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
63427 : #else
63428 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
63429 : #endif
63430 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
63431 : #else
63432 3 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
63433 : #endif
63434 : #if !CYTHON_COMPILING_IN_LIMITED_API
63435 : #endif
63436 : #if !CYTHON_USE_TYPE_SPECS
63437 3 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
63438 : #endif
63439 : #if PY_MAJOR_VERSION < 3
63440 : __pyx_memoryview_type->tp_print = 0;
63441 : #endif
63442 : #if !CYTHON_COMPILING_IN_LIMITED_API
63443 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
63444 3 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
63445 : }
63446 : #endif
63447 3 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
63448 : #if !CYTHON_COMPILING_IN_LIMITED_API
63449 3 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
63450 : #endif
63451 : #if !CYTHON_COMPILING_IN_LIMITED_API
63452 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
63453 : #endif
63454 3 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
63455 3 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
63456 3 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
63457 3 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
63458 3 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
63459 : #if CYTHON_USE_TYPE_SPECS
63460 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
63461 : __Pyx_GOTREF(__pyx_t_1);
63462 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
63463 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
63464 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
63465 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
63466 : #else
63467 3 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
63468 : #endif
63469 : #if !CYTHON_COMPILING_IN_LIMITED_API
63470 3 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
63471 : #endif
63472 : #if !CYTHON_USE_TYPE_SPECS
63473 3 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
63474 : #endif
63475 : #if PY_MAJOR_VERSION < 3
63476 : __pyx_memoryviewslice_type->tp_print = 0;
63477 : #endif
63478 : #if !CYTHON_COMPILING_IN_LIMITED_API
63479 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
63480 3 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
63481 : }
63482 : #endif
63483 3 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
63484 : #if !CYTHON_COMPILING_IN_LIMITED_API
63485 3 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
63486 : #endif
63487 : #if !CYTHON_COMPILING_IN_LIMITED_API
63488 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
63489 : #endif
63490 : __Pyx_RefNannyFinishContext();
63491 : return 0;
63492 0 : __pyx_L1_error:;
63493 0 : __Pyx_XDECREF(__pyx_t_1);
63494 0 : __Pyx_RefNannyFinishContext();
63495 0 : return -1;
63496 : }
63497 :
63498 3 : static int __Pyx_modinit_type_import_code(void) {
63499 : __Pyx_RefNannyDeclarations
63500 3 : PyObject *__pyx_t_1 = NULL;
63501 3 : int __pyx_lineno = 0;
63502 3 : const char *__pyx_filename = NULL;
63503 3 : int __pyx_clineno = 0;
63504 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
63505 : /*--- Type import code ---*/
63506 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
63507 3 : __Pyx_GOTREF(__pyx_t_1);
63508 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
63509 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
63510 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
63511 : #elif CYTHON_COMPILING_IN_LIMITED_API
63512 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
63513 : #else
63514 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
63515 : #endif
63516 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
63517 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63518 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
63519 3 : __Pyx_GOTREF(__pyx_t_1);
63520 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
63521 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
63522 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
63523 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
63524 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
63525 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
63526 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
63527 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
63528 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
63529 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
63530 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
63531 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
63532 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
63533 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
63534 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
63535 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63536 : __Pyx_RefNannyFinishContext();
63537 : return 0;
63538 0 : __pyx_L1_error:;
63539 0 : __Pyx_XDECREF(__pyx_t_1);
63540 0 : __Pyx_RefNannyFinishContext();
63541 0 : return -1;
63542 : }
63543 :
63544 : static int __Pyx_modinit_variable_import_code(void) {
63545 : __Pyx_RefNannyDeclarations
63546 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
63547 : /*--- Variable import code ---*/
63548 : __Pyx_RefNannyFinishContext();
63549 : return 0;
63550 : }
63551 :
63552 3 : static int __Pyx_modinit_function_import_code(void) {
63553 : __Pyx_RefNannyDeclarations
63554 3 : PyObject *__pyx_t_1 = NULL;
63555 3 : int __pyx_lineno = 0;
63556 3 : const char *__pyx_filename = NULL;
63557 3 : int __pyx_clineno = 0;
63558 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
63559 : /*--- Function import code ---*/
63560 3 : __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_lapack"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
63561 3 : __Pyx_GOTREF(__pyx_t_1);
63562 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dlarfgp", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dlarfgp, "void (int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63563 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dorm2r", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dorm2r, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63564 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zlarfgp", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zlarfgp, "void (int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63565 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zunm2r", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zunm2r, "void (char *, char *, int *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63566 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63567 3 : __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_blas"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
63568 3 : __Pyx_GOTREF(__pyx_t_1);
63569 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dnrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dnrm2, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63570 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dtrsm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dtrsm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63571 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dznrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dznrm2, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63572 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "ztrsm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_ztrsm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63573 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63574 : __Pyx_RefNannyFinishContext();
63575 : return 0;
63576 0 : __pyx_L1_error:;
63577 0 : __Pyx_XDECREF(__pyx_t_1);
63578 0 : __Pyx_RefNannyFinishContext();
63579 0 : return -1;
63580 : }
63581 :
63582 :
63583 : #if PY_MAJOR_VERSION >= 3
63584 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63585 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
63586 : static int __pyx_pymod_exec__decomp_interpolative(PyObject* module); /*proto*/
63587 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
63588 : {Py_mod_create, (void*)__pyx_pymod_create},
63589 : {Py_mod_exec, (void*)__pyx_pymod_exec__decomp_interpolative},
63590 : {0, NULL}
63591 : };
63592 : #endif
63593 :
63594 : #ifdef __cplusplus
63595 : namespace {
63596 : struct PyModuleDef __pyx_moduledef =
63597 : #else
63598 : static struct PyModuleDef __pyx_moduledef =
63599 : #endif
63600 : {
63601 : PyModuleDef_HEAD_INIT,
63602 : "_decomp_interpolative",
63603 : __pyx_k_This_file_is_a_Cython_rewrite_o, /* m_doc */
63604 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63605 : 0, /* m_size */
63606 : #elif CYTHON_USE_MODULE_STATE
63607 : sizeof(__pyx_mstate), /* m_size */
63608 : #else
63609 : -1, /* m_size */
63610 : #endif
63611 : __pyx_methods /* m_methods */,
63612 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63613 : __pyx_moduledef_slots, /* m_slots */
63614 : #else
63615 : NULL, /* m_reload */
63616 : #endif
63617 : #if CYTHON_USE_MODULE_STATE
63618 : __pyx_m_traverse, /* m_traverse */
63619 : __pyx_m_clear, /* m_clear */
63620 : NULL /* m_free */
63621 : #else
63622 : NULL, /* m_traverse */
63623 : NULL, /* m_clear */
63624 : NULL /* m_free */
63625 : #endif
63626 : };
63627 : #ifdef __cplusplus
63628 : } /* anonymous namespace */
63629 : #endif
63630 : #endif
63631 :
63632 : #ifndef CYTHON_NO_PYINIT_EXPORT
63633 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
63634 : #elif PY_MAJOR_VERSION < 3
63635 : #ifdef __cplusplus
63636 : #define __Pyx_PyMODINIT_FUNC extern "C" void
63637 : #else
63638 : #define __Pyx_PyMODINIT_FUNC void
63639 : #endif
63640 : #else
63641 : #ifdef __cplusplus
63642 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
63643 : #else
63644 : #define __Pyx_PyMODINIT_FUNC PyObject *
63645 : #endif
63646 : #endif
63647 :
63648 :
63649 : #if PY_MAJOR_VERSION < 3
63650 : __Pyx_PyMODINIT_FUNC init_decomp_interpolative(void) CYTHON_SMALL_CODE; /*proto*/
63651 : __Pyx_PyMODINIT_FUNC init_decomp_interpolative(void)
63652 : #else
63653 : __Pyx_PyMODINIT_FUNC PyInit__decomp_interpolative(void) CYTHON_SMALL_CODE; /*proto*/
63654 3 : __Pyx_PyMODINIT_FUNC PyInit__decomp_interpolative(void)
63655 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63656 : {
63657 3 : return PyModuleDef_Init(&__pyx_moduledef);
63658 : }
63659 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
63660 : #if PY_VERSION_HEX >= 0x030700A1
63661 3 : static PY_INT64_T main_interpreter_id = -1;
63662 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
63663 3 : if (main_interpreter_id == -1) {
63664 3 : main_interpreter_id = current_id;
63665 6 : return (unlikely(current_id == -1)) ? -1 : 0;
63666 0 : } else if (unlikely(main_interpreter_id != current_id))
63667 : #else
63668 : static PyInterpreterState *main_interpreter = NULL;
63669 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
63670 : if (!main_interpreter) {
63671 : main_interpreter = current_interpreter;
63672 : } else if (unlikely(main_interpreter != current_interpreter))
63673 : #endif
63674 : {
63675 0 : PyErr_SetString(
63676 : PyExc_ImportError,
63677 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
63678 0 : return -1;
63679 : }
63680 : return 0;
63681 : }
63682 : #if CYTHON_COMPILING_IN_LIMITED_API
63683 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
63684 : #else
63685 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
63686 : #endif
63687 : {
63688 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
63689 12 : int result = 0;
63690 12 : if (likely(value)) {
63691 12 : if (allow_none || value != Py_None) {
63692 : #if CYTHON_COMPILING_IN_LIMITED_API
63693 : result = PyModule_AddObject(module, to_name, value);
63694 : #else
63695 9 : result = PyDict_SetItemString(moddict, to_name, value);
63696 : #endif
63697 : }
63698 12 : Py_DECREF(value);
63699 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
63700 0 : PyErr_Clear();
63701 : } else {
63702 : result = -1;
63703 : }
63704 12 : return result;
63705 : }
63706 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
63707 3 : PyObject *module = NULL, *moddict, *modname;
63708 3 : CYTHON_UNUSED_VAR(def);
63709 3 : if (__Pyx_check_single_interpreter())
63710 : return NULL;
63711 3 : if (__pyx_m)
63712 0 : return __Pyx_NewRef(__pyx_m);
63713 3 : modname = PyObject_GetAttrString(spec, "name");
63714 3 : if (unlikely(!modname)) goto bad;
63715 3 : module = PyModule_NewObject(modname);
63716 3 : Py_DECREF(modname);
63717 3 : if (unlikely(!module)) goto bad;
63718 : #if CYTHON_COMPILING_IN_LIMITED_API
63719 : moddict = module;
63720 : #else
63721 3 : moddict = PyModule_GetDict(module);
63722 3 : if (unlikely(!moddict)) goto bad;
63723 : #endif
63724 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
63725 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
63726 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
63727 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
63728 : return module;
63729 0 : bad:
63730 0 : Py_XDECREF(module);
63731 0 : return NULL;
63732 : }
63733 :
63734 :
63735 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__decomp_interpolative(PyObject *__pyx_pyinit_module)
63736 : #endif
63737 : #endif
63738 : {
63739 3 : int stringtab_initialized = 0;
63740 : #if CYTHON_USE_MODULE_STATE
63741 : int pystate_addmodule_run = 0;
63742 : #endif
63743 3 : PyObject *__pyx_t_1 = NULL;
63744 3 : PyObject *__pyx_t_2 = NULL;
63745 3 : PyObject *__pyx_t_3 = NULL;
63746 3 : PyObject *__pyx_t_4 = NULL;
63747 3 : PyObject *__pyx_t_5 = NULL;
63748 3 : int __pyx_t_6;
63749 3 : PyObject *__pyx_t_7 = NULL;
63750 3 : static PyThread_type_lock __pyx_t_8[8];
63751 3 : int __pyx_t_9;
63752 3 : int __pyx_lineno = 0;
63753 3 : const char *__pyx_filename = NULL;
63754 3 : int __pyx_clineno = 0;
63755 : __Pyx_RefNannyDeclarations
63756 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63757 3 : if (__pyx_m) {
63758 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
63759 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_decomp_interpolative' has already been imported. Re-initialisation is not supported.");
63760 0 : return -1;
63761 : }
63762 : #elif PY_MAJOR_VERSION >= 3
63763 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
63764 : #endif
63765 : /*--- Module creation code ---*/
63766 : #if CYTHON_PEP489_MULTI_PHASE_INIT
63767 3 : __pyx_m = __pyx_pyinit_module;
63768 3 : Py_INCREF(__pyx_m);
63769 : #else
63770 : #if PY_MAJOR_VERSION < 3
63771 : __pyx_m = Py_InitModule4("_decomp_interpolative", __pyx_methods, __pyx_k_This_file_is_a_Cython_rewrite_o, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
63772 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
63773 : #elif CYTHON_USE_MODULE_STATE
63774 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
63775 : {
63776 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
63777 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_decomp_interpolative" pseudovariable */
63778 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
63779 : pystate_addmodule_run = 1;
63780 : }
63781 : #else
63782 : __pyx_m = PyModule_Create(&__pyx_moduledef);
63783 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
63784 : #endif
63785 : #endif
63786 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
63787 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
63788 3 : Py_INCREF(__pyx_d);
63789 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
63790 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
63791 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63792 : #if CYTHON_REFNANNY
63793 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
63794 : if (!__Pyx_RefNanny) {
63795 : PyErr_Clear();
63796 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
63797 : if (!__Pyx_RefNanny)
63798 : Py_FatalError("failed to import 'refnanny' module");
63799 : }
63800 : #endif
63801 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__decomp_interpolative(void)", 0);
63802 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63803 : #ifdef __Pxy_PyFrame_Initialize_Offsets
63804 : __Pxy_PyFrame_Initialize_Offsets();
63805 : #endif
63806 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
63807 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
63808 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
63809 : #ifdef __Pyx_CyFunction_USED
63810 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63811 : #endif
63812 : #ifdef __Pyx_FusedFunction_USED
63813 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63814 : #endif
63815 : #ifdef __Pyx_Coroutine_USED
63816 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63817 : #endif
63818 : #ifdef __Pyx_Generator_USED
63819 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63820 : #endif
63821 : #ifdef __Pyx_AsyncGen_USED
63822 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63823 : #endif
63824 : #ifdef __Pyx_StopAsyncIteration_USED
63825 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63826 : #endif
63827 : /*--- Library function declarations ---*/
63828 : /*--- Threads initialization code ---*/
63829 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
63830 : PyEval_InitThreads();
63831 : #endif
63832 : /*--- Initialize various global constants etc. ---*/
63833 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63834 3 : stringtab_initialized = 1;
63835 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63836 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
63837 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63838 : #endif
63839 3 : if (__pyx_module_is_main_scipy__linalg___decomp_interpolative) {
63840 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63841 : }
63842 : #if PY_MAJOR_VERSION >= 3
63843 : {
63844 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
63845 3 : if (!PyDict_GetItemString(modules, "scipy.linalg._decomp_interpolative")) {
63846 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.linalg._decomp_interpolative", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
63847 : }
63848 : }
63849 : #endif
63850 : /*--- Builtin init code ---*/
63851 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63852 : /*--- Constants init code ---*/
63853 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63854 : /*--- Global type/function init code ---*/
63855 3 : (void)__Pyx_modinit_global_init_code();
63856 3 : (void)__Pyx_modinit_variable_export_code();
63857 3 : (void)__Pyx_modinit_function_export_code();
63858 3 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
63859 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
63860 3 : (void)__Pyx_modinit_variable_import_code();
63861 3 : if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
63862 : /*--- Execution code ---*/
63863 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
63864 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
63865 : #endif
63866 :
63867 : /* "View.MemoryView":99
63868 : *
63869 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
63870 : * try: # <<<<<<<<<<<<<<
63871 : * if __import__("sys").version_info >= (3, 3):
63872 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
63873 : */
63874 : {
63875 3 : __Pyx_PyThreadState_declare
63876 3 : __Pyx_PyThreadState_assign
63877 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
63878 3 : __Pyx_XGOTREF(__pyx_t_1);
63879 3 : __Pyx_XGOTREF(__pyx_t_2);
63880 3 : __Pyx_XGOTREF(__pyx_t_3);
63881 : /*try:*/ {
63882 :
63883 : /* "View.MemoryView":100
63884 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
63885 : * try:
63886 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
63887 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
63888 : * else:
63889 : */
63890 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
63891 3 : __Pyx_GOTREF(__pyx_t_4);
63892 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
63893 3 : __Pyx_GOTREF(__pyx_t_5);
63894 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
63895 3 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__23, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
63896 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
63897 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
63898 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
63899 3 : if (__pyx_t_6) {
63900 :
63901 : /* "View.MemoryView":101
63902 : * try:
63903 : * if __import__("sys").version_info >= (3, 3):
63904 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
63905 : * else:
63906 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
63907 : */
63908 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
63909 3 : __Pyx_GOTREF(__pyx_t_4);
63910 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
63911 3 : __Pyx_GOTREF(__pyx_t_5);
63912 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
63913 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
63914 3 : __Pyx_GOTREF(__pyx_t_4);
63915 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
63916 3 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
63917 3 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
63918 3 : __Pyx_GIVEREF(__pyx_t_4);
63919 3 : __pyx_t_4 = 0;
63920 :
63921 : /* "View.MemoryView":100
63922 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
63923 : * try:
63924 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
63925 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
63926 : * else:
63927 : */
63928 3 : goto __pyx_L8;
63929 : }
63930 :
63931 : /* "View.MemoryView":103
63932 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
63933 : * else:
63934 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
63935 : * except:
63936 : *
63937 : */
63938 : /*else*/ {
63939 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
63940 0 : __Pyx_GOTREF(__pyx_t_4);
63941 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
63942 0 : __Pyx_GOTREF(__pyx_t_5);
63943 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
63944 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
63945 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
63946 0 : __Pyx_GIVEREF(__pyx_t_5);
63947 0 : __pyx_t_5 = 0;
63948 : }
63949 3 : __pyx_L8:;
63950 :
63951 : /* "View.MemoryView":99
63952 : *
63953 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
63954 : * try: # <<<<<<<<<<<<<<
63955 : * if __import__("sys").version_info >= (3, 3):
63956 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
63957 : */
63958 : }
63959 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
63960 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
63961 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
63962 3 : goto __pyx_L7_try_end;
63963 0 : __pyx_L2_error:;
63964 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
63965 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
63966 :
63967 : /* "View.MemoryView":104
63968 : * else:
63969 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
63970 : * except: # <<<<<<<<<<<<<<
63971 : *
63972 : * __pyx_collections_abc_Sequence = None
63973 : */
63974 : /*except:*/ {
63975 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
63976 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
63977 0 : __Pyx_XGOTREF(__pyx_t_5);
63978 0 : __Pyx_XGOTREF(__pyx_t_4);
63979 0 : __Pyx_XGOTREF(__pyx_t_7);
63980 :
63981 : /* "View.MemoryView":106
63982 : * except:
63983 : *
63984 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
63985 : *
63986 : *
63987 : */
63988 0 : __Pyx_INCREF(Py_None);
63989 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
63990 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
63991 0 : __Pyx_GIVEREF(Py_None);
63992 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
63993 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
63994 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
63995 0 : goto __pyx_L3_exception_handled;
63996 : }
63997 :
63998 : /* "View.MemoryView":99
63999 : *
64000 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
64001 : * try: # <<<<<<<<<<<<<<
64002 : * if __import__("sys").version_info >= (3, 3):
64003 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
64004 : */
64005 0 : __pyx_L4_except_error:;
64006 0 : __Pyx_XGIVEREF(__pyx_t_1);
64007 0 : __Pyx_XGIVEREF(__pyx_t_2);
64008 0 : __Pyx_XGIVEREF(__pyx_t_3);
64009 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
64010 0 : goto __pyx_L1_error;
64011 0 : __pyx_L3_exception_handled:;
64012 0 : __Pyx_XGIVEREF(__pyx_t_1);
64013 0 : __Pyx_XGIVEREF(__pyx_t_2);
64014 0 : __Pyx_XGIVEREF(__pyx_t_3);
64015 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
64016 3 : __pyx_L7_try_end:;
64017 : }
64018 :
64019 : /* "View.MemoryView":241
64020 : *
64021 : *
64022 : * try: # <<<<<<<<<<<<<<
64023 : * count = __pyx_collections_abc_Sequence.count
64024 : * index = __pyx_collections_abc_Sequence.index
64025 : */
64026 : {
64027 3 : __Pyx_PyThreadState_declare
64028 3 : __Pyx_PyThreadState_assign
64029 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
64030 3 : __Pyx_XGOTREF(__pyx_t_3);
64031 3 : __Pyx_XGOTREF(__pyx_t_2);
64032 3 : __Pyx_XGOTREF(__pyx_t_1);
64033 : /*try:*/ {
64034 :
64035 : /* "View.MemoryView":242
64036 : *
64037 : * try:
64038 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
64039 : * index = __pyx_collections_abc_Sequence.index
64040 : * except:
64041 : */
64042 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
64043 3 : __Pyx_GOTREF(__pyx_t_7);
64044 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
64045 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64046 3 : PyType_Modified(__pyx_array_type);
64047 :
64048 : /* "View.MemoryView":243
64049 : * try:
64050 : * count = __pyx_collections_abc_Sequence.count
64051 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
64052 : * except:
64053 : * pass
64054 : */
64055 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
64056 3 : __Pyx_GOTREF(__pyx_t_7);
64057 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
64058 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64059 3 : PyType_Modified(__pyx_array_type);
64060 :
64061 : /* "View.MemoryView":241
64062 : *
64063 : *
64064 : * try: # <<<<<<<<<<<<<<
64065 : * count = __pyx_collections_abc_Sequence.count
64066 : * index = __pyx_collections_abc_Sequence.index
64067 : */
64068 : }
64069 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
64070 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
64071 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
64072 3 : goto __pyx_L16_try_end;
64073 0 : __pyx_L11_error:;
64074 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
64075 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
64076 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
64077 :
64078 : /* "View.MemoryView":244
64079 : * count = __pyx_collections_abc_Sequence.count
64080 : * index = __pyx_collections_abc_Sequence.index
64081 : * except: # <<<<<<<<<<<<<<
64082 : * pass
64083 : *
64084 : */
64085 : /*except:*/ {
64086 0 : __Pyx_ErrRestore(0,0,0);
64087 0 : goto __pyx_L12_exception_handled;
64088 : }
64089 0 : __pyx_L12_exception_handled:;
64090 0 : __Pyx_XGIVEREF(__pyx_t_3);
64091 0 : __Pyx_XGIVEREF(__pyx_t_2);
64092 0 : __Pyx_XGIVEREF(__pyx_t_1);
64093 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
64094 3 : __pyx_L16_try_end:;
64095 : }
64096 :
64097 : /* "View.MemoryView":309
64098 : * return self.name
64099 : *
64100 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
64101 : * cdef strided = Enum("<strided and direct>") # default
64102 : * cdef indirect = Enum("<strided and indirect>")
64103 : */
64104 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
64105 3 : __Pyx_GOTREF(__pyx_t_7);
64106 3 : __Pyx_XGOTREF(generic);
64107 3 : __Pyx_DECREF_SET(generic, __pyx_t_7);
64108 3 : __Pyx_GIVEREF(__pyx_t_7);
64109 3 : __pyx_t_7 = 0;
64110 :
64111 : /* "View.MemoryView":310
64112 : *
64113 : * cdef generic = Enum("<strided and direct or indirect>")
64114 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
64115 : * cdef indirect = Enum("<strided and indirect>")
64116 : *
64117 : */
64118 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
64119 3 : __Pyx_GOTREF(__pyx_t_7);
64120 3 : __Pyx_XGOTREF(strided);
64121 3 : __Pyx_DECREF_SET(strided, __pyx_t_7);
64122 3 : __Pyx_GIVEREF(__pyx_t_7);
64123 3 : __pyx_t_7 = 0;
64124 :
64125 : /* "View.MemoryView":311
64126 : * cdef generic = Enum("<strided and direct or indirect>")
64127 : * cdef strided = Enum("<strided and direct>") # default
64128 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
64129 : *
64130 : *
64131 : */
64132 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
64133 3 : __Pyx_GOTREF(__pyx_t_7);
64134 3 : __Pyx_XGOTREF(indirect);
64135 3 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
64136 3 : __Pyx_GIVEREF(__pyx_t_7);
64137 3 : __pyx_t_7 = 0;
64138 :
64139 : /* "View.MemoryView":314
64140 : *
64141 : *
64142 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
64143 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
64144 : *
64145 : */
64146 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
64147 3 : __Pyx_GOTREF(__pyx_t_7);
64148 3 : __Pyx_XGOTREF(contiguous);
64149 3 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
64150 3 : __Pyx_GIVEREF(__pyx_t_7);
64151 3 : __pyx_t_7 = 0;
64152 :
64153 : /* "View.MemoryView":315
64154 : *
64155 : * cdef contiguous = Enum("<contiguous and direct>")
64156 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
64157 : *
64158 : *
64159 : */
64160 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
64161 3 : __Pyx_GOTREF(__pyx_t_7);
64162 3 : __Pyx_XGOTREF(indirect_contiguous);
64163 3 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
64164 3 : __Pyx_GIVEREF(__pyx_t_7);
64165 3 : __pyx_t_7 = 0;
64166 :
64167 : /* "View.MemoryView":323
64168 : *
64169 : *
64170 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
64171 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
64172 : * PyThread_allocate_lock(),
64173 : */
64174 3 : __pyx_memoryview_thread_locks_used = 0;
64175 :
64176 : /* "View.MemoryView":324
64177 : *
64178 : * cdef int __pyx_memoryview_thread_locks_used = 0
64179 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
64180 : * PyThread_allocate_lock(),
64181 : * PyThread_allocate_lock(),
64182 : */
64183 3 : __pyx_t_8[0] = PyThread_allocate_lock();
64184 3 : __pyx_t_8[1] = PyThread_allocate_lock();
64185 3 : __pyx_t_8[2] = PyThread_allocate_lock();
64186 3 : __pyx_t_8[3] = PyThread_allocate_lock();
64187 3 : __pyx_t_8[4] = PyThread_allocate_lock();
64188 3 : __pyx_t_8[5] = PyThread_allocate_lock();
64189 3 : __pyx_t_8[6] = PyThread_allocate_lock();
64190 3 : __pyx_t_8[7] = PyThread_allocate_lock();
64191 3 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
64192 :
64193 : /* "View.MemoryView":982
64194 : *
64195 : *
64196 : * try: # <<<<<<<<<<<<<<
64197 : * count = __pyx_collections_abc_Sequence.count
64198 : * index = __pyx_collections_abc_Sequence.index
64199 : */
64200 : {
64201 3 : __Pyx_PyThreadState_declare
64202 3 : __Pyx_PyThreadState_assign
64203 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
64204 3 : __Pyx_XGOTREF(__pyx_t_1);
64205 3 : __Pyx_XGOTREF(__pyx_t_2);
64206 3 : __Pyx_XGOTREF(__pyx_t_3);
64207 : /*try:*/ {
64208 :
64209 : /* "View.MemoryView":983
64210 : *
64211 : * try:
64212 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
64213 : * index = __pyx_collections_abc_Sequence.index
64214 : * except:
64215 : */
64216 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
64217 3 : __Pyx_GOTREF(__pyx_t_7);
64218 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
64219 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64220 3 : PyType_Modified(__pyx_memoryviewslice_type);
64221 :
64222 : /* "View.MemoryView":984
64223 : * try:
64224 : * count = __pyx_collections_abc_Sequence.count
64225 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
64226 : * except:
64227 : * pass
64228 : */
64229 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
64230 3 : __Pyx_GOTREF(__pyx_t_7);
64231 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
64232 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64233 3 : PyType_Modified(__pyx_memoryviewslice_type);
64234 :
64235 : /* "View.MemoryView":982
64236 : *
64237 : *
64238 : * try: # <<<<<<<<<<<<<<
64239 : * count = __pyx_collections_abc_Sequence.count
64240 : * index = __pyx_collections_abc_Sequence.index
64241 : */
64242 : }
64243 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
64244 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
64245 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
64246 3 : goto __pyx_L22_try_end;
64247 0 : __pyx_L17_error:;
64248 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
64249 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
64250 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
64251 :
64252 : /* "View.MemoryView":985
64253 : * count = __pyx_collections_abc_Sequence.count
64254 : * index = __pyx_collections_abc_Sequence.index
64255 : * except: # <<<<<<<<<<<<<<
64256 : * pass
64257 : *
64258 : */
64259 : /*except:*/ {
64260 0 : __Pyx_ErrRestore(0,0,0);
64261 0 : goto __pyx_L18_exception_handled;
64262 : }
64263 0 : __pyx_L18_exception_handled:;
64264 0 : __Pyx_XGIVEREF(__pyx_t_1);
64265 0 : __Pyx_XGIVEREF(__pyx_t_2);
64266 0 : __Pyx_XGIVEREF(__pyx_t_3);
64267 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
64268 3 : __pyx_L22_try_end:;
64269 : }
64270 :
64271 : /* "View.MemoryView":988
64272 : * pass
64273 : *
64274 : * try: # <<<<<<<<<<<<<<
64275 : * if __pyx_collections_abc_Sequence:
64276 : *
64277 : */
64278 : {
64279 3 : __Pyx_PyThreadState_declare
64280 3 : __Pyx_PyThreadState_assign
64281 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
64282 3 : __Pyx_XGOTREF(__pyx_t_3);
64283 3 : __Pyx_XGOTREF(__pyx_t_2);
64284 3 : __Pyx_XGOTREF(__pyx_t_1);
64285 : /*try:*/ {
64286 :
64287 : /* "View.MemoryView":989
64288 : *
64289 : * try:
64290 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
64291 : *
64292 : *
64293 : */
64294 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
64295 3 : if (__pyx_t_6) {
64296 :
64297 : /* "View.MemoryView":993
64298 : *
64299 : *
64300 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
64301 : * __pyx_collections_abc_Sequence.register(array)
64302 : * except:
64303 : */
64304 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
64305 3 : __Pyx_GOTREF(__pyx_t_7);
64306 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
64307 3 : __Pyx_GOTREF(__pyx_t_4);
64308 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64309 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64310 :
64311 : /* "View.MemoryView":994
64312 : *
64313 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
64314 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
64315 : * except:
64316 : * pass # ignore failure, it's a minor issue
64317 : */
64318 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
64319 3 : __Pyx_GOTREF(__pyx_t_4);
64320 3 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
64321 3 : __Pyx_GOTREF(__pyx_t_7);
64322 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64323 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64324 :
64325 : /* "View.MemoryView":989
64326 : *
64327 : * try:
64328 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
64329 : *
64330 : *
64331 : */
64332 : }
64333 :
64334 : /* "View.MemoryView":988
64335 : * pass
64336 : *
64337 : * try: # <<<<<<<<<<<<<<
64338 : * if __pyx_collections_abc_Sequence:
64339 : *
64340 : */
64341 : }
64342 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
64343 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
64344 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
64345 3 : goto __pyx_L28_try_end;
64346 0 : __pyx_L23_error:;
64347 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
64348 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
64349 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
64350 :
64351 : /* "View.MemoryView":995
64352 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
64353 : * __pyx_collections_abc_Sequence.register(array)
64354 : * except: # <<<<<<<<<<<<<<
64355 : * pass # ignore failure, it's a minor issue
64356 : *
64357 : */
64358 : /*except:*/ {
64359 0 : __Pyx_ErrRestore(0,0,0);
64360 0 : goto __pyx_L24_exception_handled;
64361 : }
64362 0 : __pyx_L24_exception_handled:;
64363 0 : __Pyx_XGIVEREF(__pyx_t_3);
64364 0 : __Pyx_XGIVEREF(__pyx_t_2);
64365 0 : __Pyx_XGIVEREF(__pyx_t_1);
64366 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
64367 3 : __pyx_L28_try_end:;
64368 : }
64369 :
64370 : /* "(tree fragment)":1
64371 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
64372 : * cdef object __pyx_PickleError
64373 : * cdef object __pyx_result
64374 : */
64375 3 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
64376 3 : __Pyx_GOTREF(__pyx_t_7);
64377 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
64378 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64379 :
64380 : /* "scipy/linalg/_decomp_interpolative.pyx":107
64381 : * """
64382 : *
64383 : * import numpy as np # <<<<<<<<<<<<<<
64384 : * from numpy.typing import NDArray
64385 : * cimport numpy as cnp
64386 : */
64387 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
64388 3 : __Pyx_GOTREF(__pyx_t_7);
64389 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
64390 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64391 :
64392 : /* "scipy/linalg/_decomp_interpolative.pyx":108
64393 : *
64394 : * import numpy as np
64395 : * from numpy.typing import NDArray # <<<<<<<<<<<<<<
64396 : * cimport numpy as cnp
64397 : * cnp.import_array()
64398 : */
64399 3 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
64400 3 : __Pyx_GOTREF(__pyx_t_7);
64401 3 : __Pyx_INCREF(__pyx_n_s_NDArray);
64402 3 : __Pyx_GIVEREF(__pyx_n_s_NDArray);
64403 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_NDArray)) __PYX_ERR(0, 108, __pyx_L1_error);
64404 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_numpy_typing, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
64405 3 : __Pyx_GOTREF(__pyx_t_4);
64406 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64407 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_NDArray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
64408 3 : __Pyx_GOTREF(__pyx_t_7);
64409 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_NDArray, __pyx_t_7) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
64410 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64411 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64412 :
64413 : /* "scipy/linalg/_decomp_interpolative.pyx":110
64414 : * from numpy.typing import NDArray
64415 : * cimport numpy as cnp
64416 : * cnp.import_array() # <<<<<<<<<<<<<<
64417 : *
64418 : * from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc
64419 : */
64420 3 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 110, __pyx_L1_error)
64421 :
64422 : /* "scipy/linalg/_decomp_interpolative.pyx":115
64423 : * from libc.math cimport hypot
64424 : *
64425 : * import scipy.linalg as la # <<<<<<<<<<<<<<
64426 : * from scipy.fft import rfft, fft
64427 : * from scipy.sparse.linalg import LinearOperator
64428 : */
64429 3 : __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_n_s_scipy_linalg, __pyx_tuple__33); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
64430 3 : __Pyx_GOTREF(__pyx_t_4);
64431 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_la, __pyx_t_4) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
64432 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64433 :
64434 : /* "scipy/linalg/_decomp_interpolative.pyx":116
64435 : *
64436 : * import scipy.linalg as la
64437 : * from scipy.fft import rfft, fft # <<<<<<<<<<<<<<
64438 : * from scipy.sparse.linalg import LinearOperator
64439 : *
64440 : */
64441 3 : __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
64442 3 : __Pyx_GOTREF(__pyx_t_4);
64443 3 : __Pyx_INCREF(__pyx_n_s_rfft);
64444 3 : __Pyx_GIVEREF(__pyx_n_s_rfft);
64445 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_rfft)) __PYX_ERR(0, 116, __pyx_L1_error);
64446 3 : __Pyx_INCREF(__pyx_n_s_fft);
64447 3 : __Pyx_GIVEREF(__pyx_n_s_fft);
64448 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_fft)) __PYX_ERR(0, 116, __pyx_L1_error);
64449 3 : __pyx_t_7 = __Pyx_Import(__pyx_n_s_scipy_fft, __pyx_t_4, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error)
64450 3 : __Pyx_GOTREF(__pyx_t_7);
64451 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64452 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_rfft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
64453 3 : __Pyx_GOTREF(__pyx_t_4);
64454 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_rfft, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
64455 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64456 3 : __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_fft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
64457 3 : __Pyx_GOTREF(__pyx_t_4);
64458 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_fft, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
64459 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64460 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64461 :
64462 : /* "scipy/linalg/_decomp_interpolative.pyx":117
64463 : * import scipy.linalg as la
64464 : * from scipy.fft import rfft, fft
64465 : * from scipy.sparse.linalg import LinearOperator # <<<<<<<<<<<<<<
64466 : *
64467 : * from scipy.linalg.cython_lapack cimport dlarfgp, dorm2r, zunm2r, zlarfgp
64468 : */
64469 3 : __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error)
64470 3 : __Pyx_GOTREF(__pyx_t_7);
64471 3 : __Pyx_INCREF(__pyx_n_s_LinearOperator);
64472 3 : __Pyx_GIVEREF(__pyx_n_s_LinearOperator);
64473 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_LinearOperator)) __PYX_ERR(0, 117, __pyx_L1_error);
64474 3 : __pyx_t_4 = __Pyx_Import(__pyx_n_s_scipy_sparse_linalg, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
64475 3 : __Pyx_GOTREF(__pyx_t_4);
64476 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64477 3 : __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_LinearOperator); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error)
64478 3 : __Pyx_GOTREF(__pyx_t_7);
64479 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinearOperator, __pyx_t_7) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
64480 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64481 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64482 :
64483 : /* "scipy/linalg/_decomp_interpolative.pyx":123
64484 : *
64485 : *
64486 : * __all__ = ['idd_estrank', 'idd_ldiv', 'idd_poweroftwo', 'idd_reconid', 'iddp_aid', # <<<<<<<<<<<<<<
64487 : * 'iddp_asvd', 'iddp_id', 'iddp_qrpiv', 'iddp_svd', 'iddr_aid', 'iddr_asvd',
64488 : * 'iddr_id', 'iddr_qrpiv', 'iddr_svd', 'idz_estrank', 'idz_reconid',
64489 : */
64490 3 : __pyx_t_4 = PyList_New(41); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
64491 3 : __Pyx_GOTREF(__pyx_t_4);
64492 3 : __Pyx_INCREF(__pyx_n_u_idd_estrank);
64493 3 : __Pyx_GIVEREF(__pyx_n_u_idd_estrank);
64494 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_idd_estrank)) __PYX_ERR(0, 123, __pyx_L1_error);
64495 3 : __Pyx_INCREF(__pyx_n_u_idd_ldiv);
64496 3 : __Pyx_GIVEREF(__pyx_n_u_idd_ldiv);
64497 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_idd_ldiv)) __PYX_ERR(0, 123, __pyx_L1_error);
64498 3 : __Pyx_INCREF(__pyx_n_u_idd_poweroftwo);
64499 3 : __Pyx_GIVEREF(__pyx_n_u_idd_poweroftwo);
64500 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_idd_poweroftwo)) __PYX_ERR(0, 123, __pyx_L1_error);
64501 3 : __Pyx_INCREF(__pyx_n_u_idd_reconid);
64502 3 : __Pyx_GIVEREF(__pyx_n_u_idd_reconid);
64503 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_n_u_idd_reconid)) __PYX_ERR(0, 123, __pyx_L1_error);
64504 3 : __Pyx_INCREF(__pyx_n_u_iddp_aid);
64505 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_aid);
64506 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 4, __pyx_n_u_iddp_aid)) __PYX_ERR(0, 123, __pyx_L1_error);
64507 3 : __Pyx_INCREF(__pyx_n_u_iddp_asvd);
64508 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_asvd);
64509 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 5, __pyx_n_u_iddp_asvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64510 3 : __Pyx_INCREF(__pyx_n_u_iddp_id);
64511 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_id);
64512 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 6, __pyx_n_u_iddp_id)) __PYX_ERR(0, 123, __pyx_L1_error);
64513 3 : __Pyx_INCREF(__pyx_n_u_iddp_qrpiv);
64514 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_qrpiv);
64515 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 7, __pyx_n_u_iddp_qrpiv)) __PYX_ERR(0, 123, __pyx_L1_error);
64516 3 : __Pyx_INCREF(__pyx_n_u_iddp_svd);
64517 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_svd);
64518 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 8, __pyx_n_u_iddp_svd)) __PYX_ERR(0, 123, __pyx_L1_error);
64519 3 : __Pyx_INCREF(__pyx_n_u_iddr_aid);
64520 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_aid);
64521 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 9, __pyx_n_u_iddr_aid)) __PYX_ERR(0, 123, __pyx_L1_error);
64522 3 : __Pyx_INCREF(__pyx_n_u_iddr_asvd);
64523 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_asvd);
64524 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 10, __pyx_n_u_iddr_asvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64525 3 : __Pyx_INCREF(__pyx_n_u_iddr_id);
64526 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_id);
64527 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 11, __pyx_n_u_iddr_id)) __PYX_ERR(0, 123, __pyx_L1_error);
64528 3 : __Pyx_INCREF(__pyx_n_u_iddr_qrpiv);
64529 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_qrpiv);
64530 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 12, __pyx_n_u_iddr_qrpiv)) __PYX_ERR(0, 123, __pyx_L1_error);
64531 3 : __Pyx_INCREF(__pyx_n_u_iddr_svd);
64532 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_svd);
64533 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 13, __pyx_n_u_iddr_svd)) __PYX_ERR(0, 123, __pyx_L1_error);
64534 3 : __Pyx_INCREF(__pyx_n_u_idz_estrank);
64535 3 : __Pyx_GIVEREF(__pyx_n_u_idz_estrank);
64536 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 14, __pyx_n_u_idz_estrank)) __PYX_ERR(0, 123, __pyx_L1_error);
64537 3 : __Pyx_INCREF(__pyx_n_u_idz_reconid);
64538 3 : __Pyx_GIVEREF(__pyx_n_u_idz_reconid);
64539 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 15, __pyx_n_u_idz_reconid)) __PYX_ERR(0, 123, __pyx_L1_error);
64540 3 : __Pyx_INCREF(__pyx_n_u_idzp_aid);
64541 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_aid);
64542 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 16, __pyx_n_u_idzp_aid)) __PYX_ERR(0, 123, __pyx_L1_error);
64543 3 : __Pyx_INCREF(__pyx_n_u_idzp_asvd);
64544 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_asvd);
64545 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 17, __pyx_n_u_idzp_asvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64546 3 : __Pyx_INCREF(__pyx_n_u_idzp_id);
64547 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_id);
64548 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 18, __pyx_n_u_idzp_id)) __PYX_ERR(0, 123, __pyx_L1_error);
64549 3 : __Pyx_INCREF(__pyx_n_u_idzp_qrpiv);
64550 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_qrpiv);
64551 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 19, __pyx_n_u_idzp_qrpiv)) __PYX_ERR(0, 123, __pyx_L1_error);
64552 3 : __Pyx_INCREF(__pyx_n_u_idzp_svd);
64553 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_svd);
64554 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 20, __pyx_n_u_idzp_svd)) __PYX_ERR(0, 123, __pyx_L1_error);
64555 3 : __Pyx_INCREF(__pyx_n_u_idzr_aid);
64556 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_aid);
64557 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 21, __pyx_n_u_idzr_aid)) __PYX_ERR(0, 123, __pyx_L1_error);
64558 3 : __Pyx_INCREF(__pyx_n_u_idzr_asvd);
64559 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_asvd);
64560 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 22, __pyx_n_u_idzr_asvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64561 3 : __Pyx_INCREF(__pyx_n_u_idzr_id);
64562 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_id);
64563 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 23, __pyx_n_u_idzr_id)) __PYX_ERR(0, 123, __pyx_L1_error);
64564 3 : __Pyx_INCREF(__pyx_n_u_idzr_qrpiv);
64565 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_qrpiv);
64566 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 24, __pyx_n_u_idzr_qrpiv)) __PYX_ERR(0, 123, __pyx_L1_error);
64567 3 : __Pyx_INCREF(__pyx_n_u_idzr_svd);
64568 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_svd);
64569 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 25, __pyx_n_u_idzr_svd)) __PYX_ERR(0, 123, __pyx_L1_error);
64570 3 : __Pyx_INCREF(__pyx_n_u_idd_id2svd);
64571 3 : __Pyx_GIVEREF(__pyx_n_u_idd_id2svd);
64572 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 26, __pyx_n_u_idd_id2svd)) __PYX_ERR(0, 123, __pyx_L1_error);
64573 3 : __Pyx_INCREF(__pyx_n_u_idz_id2svdidd_findrank);
64574 3 : __Pyx_GIVEREF(__pyx_n_u_idz_id2svdidd_findrank);
64575 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 27, __pyx_n_u_idz_id2svdidd_findrank)) __PYX_ERR(0, 123, __pyx_L1_error);
64576 3 : __Pyx_INCREF(__pyx_n_u_iddp_rid);
64577 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_rid);
64578 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 28, __pyx_n_u_iddp_rid)) __PYX_ERR(0, 123, __pyx_L1_error);
64579 3 : __Pyx_INCREF(__pyx_n_u_iddp_rsvd);
64580 3 : __Pyx_GIVEREF(__pyx_n_u_iddp_rsvd);
64581 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 29, __pyx_n_u_iddp_rsvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64582 3 : __Pyx_INCREF(__pyx_n_u_iddr_rid);
64583 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_rid);
64584 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 30, __pyx_n_u_iddr_rid)) __PYX_ERR(0, 123, __pyx_L1_error);
64585 3 : __Pyx_INCREF(__pyx_n_u_iddr_rsvd);
64586 3 : __Pyx_GIVEREF(__pyx_n_u_iddr_rsvd);
64587 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 31, __pyx_n_u_iddr_rsvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64588 3 : __Pyx_INCREF(__pyx_n_u_idz_findrank);
64589 3 : __Pyx_GIVEREF(__pyx_n_u_idz_findrank);
64590 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 32, __pyx_n_u_idz_findrank)) __PYX_ERR(0, 123, __pyx_L1_error);
64591 3 : __Pyx_INCREF(__pyx_n_u_idzp_rid);
64592 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_rid);
64593 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 33, __pyx_n_u_idzp_rid)) __PYX_ERR(0, 123, __pyx_L1_error);
64594 3 : __Pyx_INCREF(__pyx_n_u_idzp_rsvd);
64595 3 : __Pyx_GIVEREF(__pyx_n_u_idzp_rsvd);
64596 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 34, __pyx_n_u_idzp_rsvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64597 3 : __Pyx_INCREF(__pyx_n_u_idzr_rid);
64598 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_rid);
64599 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 35, __pyx_n_u_idzr_rid)) __PYX_ERR(0, 123, __pyx_L1_error);
64600 3 : __Pyx_INCREF(__pyx_n_u_idzr_rsvd);
64601 3 : __Pyx_GIVEREF(__pyx_n_u_idzr_rsvd);
64602 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 36, __pyx_n_u_idzr_rsvd)) __PYX_ERR(0, 123, __pyx_L1_error);
64603 3 : __Pyx_INCREF(__pyx_n_u_idd_snorm);
64604 3 : __Pyx_GIVEREF(__pyx_n_u_idd_snorm);
64605 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 37, __pyx_n_u_idd_snorm)) __PYX_ERR(0, 123, __pyx_L1_error);
64606 3 : __Pyx_INCREF(__pyx_n_u_idz_snorm);
64607 3 : __Pyx_GIVEREF(__pyx_n_u_idz_snorm);
64608 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 38, __pyx_n_u_idz_snorm)) __PYX_ERR(0, 123, __pyx_L1_error);
64609 3 : __Pyx_INCREF(__pyx_n_u_idd_diffsnorm);
64610 3 : __Pyx_GIVEREF(__pyx_n_u_idd_diffsnorm);
64611 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 39, __pyx_n_u_idd_diffsnorm)) __PYX_ERR(0, 123, __pyx_L1_error);
64612 3 : __Pyx_INCREF(__pyx_n_u_idz_diffsnorm);
64613 3 : __Pyx_GIVEREF(__pyx_n_u_idz_diffsnorm);
64614 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 40, __pyx_n_u_idz_diffsnorm)) __PYX_ERR(0, 123, __pyx_L1_error);
64615 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_4) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
64616 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64617 :
64618 : /* "scipy/linalg/_decomp_interpolative.pyx":135
64619 : *
64620 : *
64621 : * def idd_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
64622 : * cdef int n = A.shape[1], j = 0, intone = 1
64623 : * cdef cnp.float64_t snorm = 0.0
64624 : */
64625 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
64626 3 : __Pyx_GOTREF(__pyx_t_4);
64627 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
64628 3 : __Pyx_GOTREF(__pyx_t_7);
64629 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_its, __pyx_t_7) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
64630 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64631 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
64632 3 : __Pyx_GOTREF(__pyx_t_7);
64633 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
64634 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_B, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
64635 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_1idd_diffsnorm, 0, __pyx_n_s_idd_diffsnorm, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error)
64636 3 : __Pyx_GOTREF(__pyx_t_5);
64637 6 : __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4);
64638 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7);
64639 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64640 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64641 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_diffsnorm, __pyx_t_5) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
64642 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64643 :
64644 : /* "scipy/linalg/_decomp_interpolative.pyx":163
64645 : *
64646 : *
64647 : * def idd_estrank(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
64648 : * rng):
64649 : * cdef int m = a.shape[0], n = a.shape[1]
64650 : */
64651 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
64652 3 : __Pyx_GOTREF(__pyx_t_5);
64653 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
64654 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
64655 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_3idd_estrank, 0, __pyx_n_s_idd_estrank, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
64656 3 : __Pyx_GOTREF(__pyx_t_7);
64657 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5);
64658 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64659 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_estrank, __pyx_t_7) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
64660 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64661 :
64662 : /* "scipy/linalg/_decomp_interpolative.pyx":279
64663 : *
64664 : *
64665 : * def idd_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
64666 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
64667 : *
64668 : */
64669 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error)
64670 3 : __Pyx_GOTREF(__pyx_t_7);
64671 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
64672 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_5idd_findrank, 0, __pyx_n_s_idd_findrank, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
64673 3 : __Pyx_GOTREF(__pyx_t_5);
64674 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7);
64675 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64676 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_findrank, __pyx_t_5) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
64677 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64678 :
64679 : /* "scipy/linalg/_decomp_interpolative.pyx":370
64680 : *
64681 : *
64682 : * def idd_id2svd( # <<<<<<<<<<<<<<
64683 : * cnp.ndarray[cnp.float64_t, mode='c', ndim=2] cols,
64684 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
64685 : */
64686 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_7idd_id2svd, 0, __pyx_n_s_idd_id2svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
64687 3 : __Pyx_GOTREF(__pyx_t_5);
64688 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_id2svd, __pyx_t_5) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
64689 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64690 :
64691 : /* "scipy/linalg/_decomp_interpolative.pyx":448
64692 : *
64693 : *
64694 : * def idd_reconid(B, idx, proj): # <<<<<<<<<<<<<<
64695 : * cdef int m = B.shape[0], krank = B.shape[1]
64696 : * cdef int n = len(idx)
64697 : */
64698 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_9idd_reconid, 0, __pyx_n_s_idd_reconid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error)
64699 3 : __Pyx_GOTREF(__pyx_t_5);
64700 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_reconid, __pyx_t_5) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
64701 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64702 :
64703 : /* "scipy/linalg/_decomp_interpolative.pyx":459
64704 : *
64705 : *
64706 : * def idd_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
64707 : * cdef int n = A.shape[1]
64708 : * cdef int j = 0, intone = 1
64709 : */
64710 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
64711 3 : __Pyx_GOTREF(__pyx_t_5);
64712 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 459, __pyx_L1_error)
64713 3 : __Pyx_GOTREF(__pyx_t_7);
64714 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_its, __pyx_t_7) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
64715 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64716 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 459, __pyx_L1_error)
64717 3 : __Pyx_GOTREF(__pyx_t_7);
64718 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
64719 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_11idd_snorm, 0, __pyx_n_s_idd_snorm, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
64720 3 : __Pyx_GOTREF(__pyx_t_4);
64721 6 : __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5);
64722 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64723 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64724 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64725 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idd_snorm, __pyx_t_4) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
64726 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64727 :
64728 : /* "scipy/linalg/_decomp_interpolative.pyx":481
64729 : *
64730 : *
64731 : * def iddp_aid(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
64732 : * krank, proj = idd_estrank(a, eps, rng=rng)
64733 : * if krank != 0:
64734 : */
64735 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
64736 3 : __Pyx_GOTREF(__pyx_t_4);
64737 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 481, __pyx_L1_error)
64738 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 481, __pyx_L1_error)
64739 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_13iddp_aid, 0, __pyx_n_s_iddp_aid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error)
64740 3 : __Pyx_GOTREF(__pyx_t_7);
64741 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64742 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64743 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_aid, __pyx_t_7) < 0) __PYX_ERR(0, 481, __pyx_L1_error)
64744 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64745 :
64746 : /* "scipy/linalg/_decomp_interpolative.pyx":490
64747 : *
64748 : *
64749 : * def iddp_asvd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float, *, rng): # <<<<<<<<<<<<<<
64750 : * cdef int m = a.shape[0], n = a.shape[1]
64751 : * cdef int krank, info, ci
64752 : */
64753 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
64754 3 : __Pyx_GOTREF(__pyx_t_7);
64755 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
64756 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
64757 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_15iddp_asvd, 0, __pyx_n_s_iddp_asvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error)
64758 3 : __Pyx_GOTREF(__pyx_t_4);
64759 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64760 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64761 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_asvd, __pyx_t_4) < 0) __PYX_ERR(0, 490, __pyx_L1_error)
64762 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64763 :
64764 : /* "scipy/linalg/_decomp_interpolative.pyx":554
64765 : *
64766 : *
64767 : * def iddp_id(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
64768 : * cdef int n = a.shape[1], krank, tmp_int, p
64769 : * cdef cnp.float64_t one = 1
64770 : */
64771 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
64772 3 : __Pyx_GOTREF(__pyx_t_4);
64773 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
64774 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
64775 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_17iddp_id, 0, __pyx_n_s_iddp_id, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error)
64776 3 : __Pyx_GOTREF(__pyx_t_7);
64777 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64778 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64779 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_id, __pyx_t_7) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
64780 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64781 :
64782 : /* "scipy/linalg/_decomp_interpolative.pyx":593
64783 : *
64784 : *
64785 : * def iddp_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
64786 : * """
64787 : * This is a minimal version of ?GEQP3 from LAPACK with an
64788 : */
64789 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_19iddp_qrpiv, 0, __pyx_n_s_iddp_qrpiv, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error)
64790 3 : __Pyx_GOTREF(__pyx_t_7);
64791 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_qrpiv, __pyx_t_7) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
64792 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64793 :
64794 : /* "scipy/linalg/_decomp_interpolative.pyx":673
64795 : *
64796 : *
64797 : * def iddp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
64798 : * _, ret = idd_findrank(A, eps, rng=rng)
64799 : * return iddp_id(ret, eps)
64800 : */
64801 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L1_error)
64802 3 : __Pyx_GOTREF(__pyx_t_7);
64803 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
64804 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_21iddp_rid, 0, __pyx_n_s_iddp_rid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error)
64805 3 : __Pyx_GOTREF(__pyx_t_4);
64806 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64807 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64808 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_rid, __pyx_t_4) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
64809 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64810 :
64811 : /* "scipy/linalg/_decomp_interpolative.pyx":678
64812 : *
64813 : *
64814 : * def iddp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
64815 : * cdef int n = A.shape[1]
64816 : * cdef int krank, j
64817 : */
64818 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
64819 3 : __Pyx_GOTREF(__pyx_t_4);
64820 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 678, __pyx_L1_error)
64821 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_23iddp_rsvd, 0, __pyx_n_s_iddp_rsvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 678, __pyx_L1_error)
64822 3 : __Pyx_GOTREF(__pyx_t_7);
64823 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64824 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64825 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_rsvd, __pyx_t_7) < 0) __PYX_ERR(0, 678, __pyx_L1_error)
64826 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64827 :
64828 : /* "scipy/linalg/_decomp_interpolative.pyx":703
64829 : *
64830 : *
64831 : * def iddp_svd(cnp.ndarray[cnp.float64_t, ndim=2] a: NDArray, eps: float): # <<<<<<<<<<<<<<
64832 : * """a is overwritten"""
64833 : * cdef int m = a.shape[0], krank, info
64834 : */
64835 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L1_error)
64836 3 : __Pyx_GOTREF(__pyx_t_7);
64837 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
64838 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
64839 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_25iddp_svd, 0, __pyx_n_s_iddp_svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
64840 3 : __Pyx_GOTREF(__pyx_t_4);
64841 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64842 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64843 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddp_svd, __pyx_t_4) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
64844 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64845 :
64846 : /* "scipy/linalg/_decomp_interpolative.pyx":736
64847 : *
64848 : *
64849 : * def iddr_aid(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
64850 : * rng):
64851 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, L
64852 : */
64853 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
64854 3 : __Pyx_GOTREF(__pyx_t_4);
64855 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
64856 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_27iddr_aid, 0, __pyx_n_s_iddr_aid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error)
64857 3 : __Pyx_GOTREF(__pyx_t_7);
64858 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64859 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64860 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_aid, __pyx_t_7) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
64861 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64862 :
64863 : /* "scipy/linalg/_decomp_interpolative.pyx":888
64864 : *
64865 : *
64866 : * def iddr_asvd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
64867 : * rng):
64868 : * cdef int m = a.shape[0], n = a.shape[1]
64869 : */
64870 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
64871 3 : __Pyx_GOTREF(__pyx_t_7);
64872 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
64873 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_29iddr_asvd, 0, __pyx_n_s_iddr_asvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
64874 3 : __Pyx_GOTREF(__pyx_t_4);
64875 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64876 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64877 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_asvd, __pyx_t_4) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
64878 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64879 :
64880 : /* "scipy/linalg/_decomp_interpolative.pyx":951
64881 : *
64882 : *
64883 : * def iddr_id(cnp.ndarray[cnp.float64_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
64884 : * cdef int n = a.shape[1]
64885 : * cdef int tmp_int
64886 : */
64887 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_31iddr_id, 0, __pyx_n_s_iddr_id, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 951, __pyx_L1_error)
64888 3 : __Pyx_GOTREF(__pyx_t_4);
64889 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_id, __pyx_t_4) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
64890 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64891 :
64892 : /* "scipy/linalg/_decomp_interpolative.pyx":977
64893 : *
64894 : *
64895 : * def iddr_qrpiv(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, krank: int): # <<<<<<<<<<<<<<
64896 : * cdef int m = a.shape[0], n = a.shape[1]
64897 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
64898 : */
64899 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
64900 3 : __Pyx_GOTREF(__pyx_t_4);
64901 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
64902 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_krank, __pyx_n_s_int) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
64903 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_33iddr_qrpiv, 0, __pyx_n_s_iddr_qrpiv, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
64904 3 : __Pyx_GOTREF(__pyx_t_7);
64905 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64906 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64907 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_qrpiv, __pyx_t_7) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
64908 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64909 :
64910 : /* "scipy/linalg/_decomp_interpolative.pyx":1047
64911 : *
64912 : *
64913 : * def iddr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
64914 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
64915 : * cdef int L = min(krank+2, min(m, n))
64916 : */
64917 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1047, __pyx_L1_error)
64918 3 : __Pyx_GOTREF(__pyx_t_7);
64919 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1047, __pyx_L1_error)
64920 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_35iddr_rid, 0, __pyx_n_s_iddr_rid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error)
64921 3 : __Pyx_GOTREF(__pyx_t_4);
64922 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64923 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64924 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_rid, __pyx_t_4) < 0) __PYX_ERR(0, 1047, __pyx_L1_error)
64925 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64926 :
64927 : /* "scipy/linalg/_decomp_interpolative.pyx":1059
64928 : *
64929 : *
64930 : * def iddr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
64931 : * cdef int n = A.shape[1], j
64932 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
64933 : */
64934 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error)
64935 3 : __Pyx_GOTREF(__pyx_t_4);
64936 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
64937 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_37iddr_rsvd, 0, __pyx_n_s_iddr_rsvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error)
64938 3 : __Pyx_GOTREF(__pyx_t_7);
64939 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
64940 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64941 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_rsvd, __pyx_t_7) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
64942 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64943 :
64944 : /* "scipy/linalg/_decomp_interpolative.pyx":1077
64945 : *
64946 : *
64947 : * def iddr_svd(cnp.ndarray[cnp.float64_t, mode="c", ndim=2] a: NDArray, int krank): # <<<<<<<<<<<<<<
64948 : * cdef int m = a.shape[0], info = 0
64949 : * cdef cnp.ndarray[cnp.float64_t, mode='c', ndim=1] taus
64950 : */
64951 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1077, __pyx_L1_error)
64952 3 : __Pyx_GOTREF(__pyx_t_7);
64953 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 1077, __pyx_L1_error)
64954 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_39iddr_svd, 0, __pyx_n_s_iddr_svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1077, __pyx_L1_error)
64955 3 : __Pyx_GOTREF(__pyx_t_4);
64956 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
64957 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64958 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_iddr_svd, __pyx_t_4) < 0) __PYX_ERR(0, 1077, __pyx_L1_error)
64959 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64960 :
64961 : /* "scipy/linalg/_decomp_interpolative.pyx":1108
64962 : *
64963 : *
64964 : * def idz_diffsnorm(A: LinearOperator, B: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
64965 : * cdef int n = A.shape[1], j = 0, intone = 1
64966 : * cdef cnp.float64_t snorm = 0.0
64967 : */
64968 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
64969 3 : __Pyx_GOTREF(__pyx_t_4);
64970 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L1_error)
64971 3 : __Pyx_GOTREF(__pyx_t_7);
64972 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_its, __pyx_t_7) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
64973 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64974 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1108, __pyx_L1_error)
64975 3 : __Pyx_GOTREF(__pyx_t_7);
64976 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
64977 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_B, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
64978 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_41idz_diffsnorm, 0, __pyx_n_s_idz_diffsnorm, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1108, __pyx_L1_error)
64979 3 : __Pyx_GOTREF(__pyx_t_5);
64980 6 : __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_5, __pyx_t_4);
64981 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7);
64982 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64983 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64984 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_diffsnorm, __pyx_t_5) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
64985 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64986 :
64987 : /* "scipy/linalg/_decomp_interpolative.pyx":1136
64988 : *
64989 : *
64990 : * def idz_estrank(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
64991 : * rng):
64992 : * cdef int m = a.shape[0], n = a.shape[1], n2, nsteps = 3, row, r, nstep, cols, k
64993 : */
64994 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L1_error)
64995 3 : __Pyx_GOTREF(__pyx_t_5);
64996 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
64997 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
64998 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_43idz_estrank, 0, __pyx_n_s_idz_estrank, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1136, __pyx_L1_error)
64999 3 : __Pyx_GOTREF(__pyx_t_7);
65000 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5);
65001 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65002 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_estrank, __pyx_t_7) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)
65003 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65004 :
65005 : /* "scipy/linalg/_decomp_interpolative.pyx":1226
65006 : *
65007 : *
65008 : * def idz_findrank(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
65009 : * # Estimate the rank of A by repeatedly using A.rmatvec(random vec)
65010 : *
65011 : */
65012 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error)
65013 3 : __Pyx_GOTREF(__pyx_t_7);
65014 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1226, __pyx_L1_error)
65015 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_45idz_findrank, 0, __pyx_n_s_idz_findrank, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1226, __pyx_L1_error)
65016 3 : __Pyx_GOTREF(__pyx_t_5);
65017 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7);
65018 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65019 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_findrank, __pyx_t_5) < 0) __PYX_ERR(0, 1226, __pyx_L1_error)
65020 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65021 :
65022 : /* "scipy/linalg/_decomp_interpolative.pyx":1320
65023 : *
65024 : *
65025 : * def idz_id2svd( # <<<<<<<<<<<<<<
65026 : * cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] cols,
65027 : * cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms,
65028 : */
65029 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_47idz_id2svd, 0, __pyx_n_s_idz_id2svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
65030 3 : __Pyx_GOTREF(__pyx_t_5);
65031 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_id2svd, __pyx_t_5) < 0) __PYX_ERR(0, 1320, __pyx_L1_error)
65032 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65033 :
65034 : /* "scipy/linalg/_decomp_interpolative.pyx":1384
65035 : *
65036 : *
65037 : * def idz_reconid(B, idx, proj): # <<<<<<<<<<<<<<
65038 : * cdef int m = B.shape[0], krank = B.shape[1]
65039 : * cdef int n = len(idx)
65040 : */
65041 3 : __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_49idz_reconid, 0, __pyx_n_s_idz_reconid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1384, __pyx_L1_error)
65042 3 : __Pyx_GOTREF(__pyx_t_5);
65043 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_reconid, __pyx_t_5) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
65044 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65045 :
65046 : /* "scipy/linalg/_decomp_interpolative.pyx":1395
65047 : *
65048 : *
65049 : * def idz_snorm(A: LinearOperator, *, rng, int its=20): # <<<<<<<<<<<<<<
65050 : * cdef int n = A.shape[1]
65051 : * cdef int j = 0, intone = 1
65052 : */
65053 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1395, __pyx_L1_error)
65054 3 : __Pyx_GOTREF(__pyx_t_5);
65055 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1395, __pyx_L1_error)
65056 3 : __Pyx_GOTREF(__pyx_t_7);
65057 3 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_its, __pyx_t_7) < 0) __PYX_ERR(0, 1395, __pyx_L1_error)
65058 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65059 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1395, __pyx_L1_error)
65060 3 : __Pyx_GOTREF(__pyx_t_7);
65061 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1395, __pyx_L1_error)
65062 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_51idz_snorm, 0, __pyx_n_s_idz_snorm, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1395, __pyx_L1_error)
65063 3 : __Pyx_GOTREF(__pyx_t_4);
65064 6 : __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_5);
65065 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
65066 6 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65067 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65068 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idz_snorm, __pyx_t_4) < 0) __PYX_ERR(0, 1395, __pyx_L1_error)
65069 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65070 :
65071 : /* "scipy/linalg/_decomp_interpolative.pyx":1417
65072 : *
65073 : *
65074 : * def idzp_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, eps: float, *, # <<<<<<<<<<<<<<
65075 : * rng):
65076 : * krank, proj = idz_estrank(a, eps=eps, rng=rng)
65077 : */
65078 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error)
65079 3 : __Pyx_GOTREF(__pyx_t_4);
65080 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
65081 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_eps, __pyx_n_s_float) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
65082 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_53idzp_aid, 0, __pyx_n_s_idzp_aid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1417, __pyx_L1_error)
65083 3 : __Pyx_GOTREF(__pyx_t_7);
65084 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
65085 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65086 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_aid, __pyx_t_7) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
65087 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65088 :
65089 : /* "scipy/linalg/_decomp_interpolative.pyx":1427
65090 : *
65091 : *
65092 : * def idzp_asvd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps, *, # <<<<<<<<<<<<<<
65093 : * rng):
65094 : * cdef int m = a.shape[0], n = a.shape[1]
65095 : */
65096 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_55idzp_asvd, 0, __pyx_n_s_idzp_asvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1427, __pyx_L1_error)
65097 3 : __Pyx_GOTREF(__pyx_t_7);
65098 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_asvd, __pyx_t_7) < 0) __PYX_ERR(0, 1427, __pyx_L1_error)
65099 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65100 :
65101 : /* "scipy/linalg/_decomp_interpolative.pyx":1494
65102 : *
65103 : *
65104 : * def idzp_id(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
65105 : * cdef int n = a.shape[1], krank, tmp_int, p
65106 : * cdef double complex one = 1
65107 : */
65108 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_57idzp_id, 0, __pyx_n_s_idzp_id, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1494, __pyx_L1_error)
65109 3 : __Pyx_GOTREF(__pyx_t_7);
65110 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_id, __pyx_t_7) < 0) __PYX_ERR(0, 1494, __pyx_L1_error)
65111 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65112 :
65113 : /* "scipy/linalg/_decomp_interpolative.pyx":1517
65114 : *
65115 : *
65116 : * def idzp_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
65117 : * cdef int m = a.shape[0], n = a.shape[1]
65118 : * cdef cnp.ndarray col_norms = cnp.PyArray_ZEROS(1, [n], cnp.NPY_FLOAT64, 0)
65119 : */
65120 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_59idzp_qrpiv, 0, __pyx_n_s_idzp_qrpiv, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1517, __pyx_L1_error)
65121 3 : __Pyx_GOTREF(__pyx_t_7);
65122 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_qrpiv, __pyx_t_7) < 0) __PYX_ERR(0, 1517, __pyx_L1_error)
65123 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65124 :
65125 : /* "scipy/linalg/_decomp_interpolative.pyx":1595
65126 : *
65127 : *
65128 : * def idzp_rid(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
65129 : * _, ret = idz_findrank(A, eps, rng=rng)
65130 : * return idzp_id(ret, eps=eps)
65131 : */
65132 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1595, __pyx_L1_error)
65133 3 : __Pyx_GOTREF(__pyx_t_7);
65134 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1595, __pyx_L1_error)
65135 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_61idzp_rid, 0, __pyx_n_s_idzp_rid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1595, __pyx_L1_error)
65136 3 : __Pyx_GOTREF(__pyx_t_4);
65137 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
65138 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65139 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_rid, __pyx_t_4) < 0) __PYX_ERR(0, 1595, __pyx_L1_error)
65140 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65141 :
65142 : /* "scipy/linalg/_decomp_interpolative.pyx":1600
65143 : *
65144 : *
65145 : * def idzp_rsvd(A: LinearOperator, cnp.float64_t eps, *, rng): # <<<<<<<<<<<<<<
65146 : * cdef int n = A.shape[1]
65147 : * cdef int krank, j
65148 : */
65149 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1600, __pyx_L1_error)
65150 3 : __Pyx_GOTREF(__pyx_t_4);
65151 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1600, __pyx_L1_error)
65152 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_63idzp_rsvd, 0, __pyx_n_s_idzp_rsvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1600, __pyx_L1_error)
65153 3 : __Pyx_GOTREF(__pyx_t_7);
65154 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
65155 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65156 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_rsvd, __pyx_t_7) < 0) __PYX_ERR(0, 1600, __pyx_L1_error)
65157 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65158 :
65159 : /* "scipy/linalg/_decomp_interpolative.pyx":1626
65160 : *
65161 : *
65162 : * def idzp_svd(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a, cnp.float64_t eps): # <<<<<<<<<<<<<<
65163 : * cdef int m = a.shape[0], krank, info
65164 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
65165 : */
65166 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_65idzp_svd, 0, __pyx_n_s_idzp_svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1626, __pyx_L1_error)
65167 3 : __Pyx_GOTREF(__pyx_t_7);
65168 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzp_svd, __pyx_t_7) < 0) __PYX_ERR(0, 1626, __pyx_L1_error)
65169 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65170 :
65171 : /* "scipy/linalg/_decomp_interpolative.pyx":1657
65172 : *
65173 : *
65174 : * def idzr_aid(cnp.ndarray[cnp.complex128_t, mode='c', ndim=2] a: NDArray, int krank, *, # <<<<<<<<<<<<<<
65175 : * rng):
65176 : * cdef int m = a.shape[0], n2, L, nblock, nsteps = 3, mb
65177 : */
65178 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1657, __pyx_L1_error)
65179 3 : __Pyx_GOTREF(__pyx_t_7);
65180 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_a, __pyx_n_s_NDArray) < 0) __PYX_ERR(0, 1657, __pyx_L1_error)
65181 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_67idzr_aid, 0, __pyx_n_s_idzr_aid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1657, __pyx_L1_error)
65182 3 : __Pyx_GOTREF(__pyx_t_4);
65183 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
65184 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65185 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_aid, __pyx_t_4) < 0) __PYX_ERR(0, 1657, __pyx_L1_error)
65186 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65187 :
65188 : /* "scipy/linalg/_decomp_interpolative.pyx":1744
65189 : *
65190 : *
65191 : * def idzr_asvd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank, *, rng): # <<<<<<<<<<<<<<
65192 : * cdef int m = a.shape[0], n = a.shape[1]
65193 : * cdef int info, ci
65194 : */
65195 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_69idzr_asvd, 0, __pyx_n_s_idzr_asvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __pyx_L1_error)
65196 3 : __Pyx_GOTREF(__pyx_t_4);
65197 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_asvd, __pyx_t_4) < 0) __PYX_ERR(0, 1744, __pyx_L1_error)
65198 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65199 :
65200 : /* "scipy/linalg/_decomp_interpolative.pyx":1808
65201 : *
65202 : *
65203 : * def idzr_id(cnp.ndarray[cnp.complex128_t, ndim=2] a, int krank): # <<<<<<<<<<<<<<
65204 : * cdef int n = a.shape[1], tmp_int, p
65205 : * cdef double complex one = 1.0
65206 : */
65207 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_71idzr_id, 0, __pyx_n_s_idzr_id, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error)
65208 3 : __Pyx_GOTREF(__pyx_t_4);
65209 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_id, __pyx_t_4) < 0) __PYX_ERR(0, 1808, __pyx_L1_error)
65210 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65211 :
65212 : /* "scipy/linalg/_decomp_interpolative.pyx":1831
65213 : *
65214 : *
65215 : * def idzr_qrpiv(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
65216 : * cdef int m = a.shape[0], n = a.shape[1]
65217 : * cdef int loop = 0, loops, kpiv = 0, i = 0, tmp_int = 0
65218 : */
65219 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_73idzr_qrpiv, 0, __pyx_n_s_idzr_qrpiv, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1831, __pyx_L1_error)
65220 3 : __Pyx_GOTREF(__pyx_t_4);
65221 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_qrpiv, __pyx_t_4) < 0) __PYX_ERR(0, 1831, __pyx_L1_error)
65222 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65223 :
65224 : /* "scipy/linalg/_decomp_interpolative.pyx":1901
65225 : *
65226 : *
65227 : * def idzr_rid(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
65228 : * cdef int m = A.shape[0], n = A.shape[1], k = 0
65229 : * cdef int L = min(krank+2, min(m, n))
65230 : */
65231 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L1_error)
65232 3 : __Pyx_GOTREF(__pyx_t_4);
65233 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1901, __pyx_L1_error)
65234 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_75idzr_rid, 0, __pyx_n_s_idzr_rid, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1901, __pyx_L1_error)
65235 3 : __Pyx_GOTREF(__pyx_t_7);
65236 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4);
65237 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65238 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_rid, __pyx_t_7) < 0) __PYX_ERR(0, 1901, __pyx_L1_error)
65239 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65240 :
65241 : /* "scipy/linalg/_decomp_interpolative.pyx":1913
65242 : *
65243 : *
65244 : * def idzr_rsvd(A: LinearOperator, int krank, *, rng): # <<<<<<<<<<<<<<
65245 : * cdef int n = A.shape[1], j
65246 : * cdef cnp.ndarray[cnp.int64_t, mode='c', ndim=1] perms
65247 : */
65248 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1913, __pyx_L1_error)
65249 3 : __Pyx_GOTREF(__pyx_t_7);
65250 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_A, __pyx_n_s_LinearOperator) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
65251 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_77idzr_rsvd, 0, __pyx_n_s_idzr_rsvd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1913, __pyx_L1_error)
65252 3 : __Pyx_GOTREF(__pyx_t_4);
65253 6 : __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7);
65254 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
65255 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_rsvd, __pyx_t_4) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
65256 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65257 :
65258 : /* "scipy/linalg/_decomp_interpolative.pyx":1931
65259 : *
65260 : *
65261 : * def idzr_svd(cnp.ndarray[cnp.complex128_t, mode="c", ndim=2] a, int krank): # <<<<<<<<<<<<<<
65262 : * cdef int m = a.shape[0], n = a.shape[1], info = 0
65263 : * cdef cnp.ndarray[cnp.complex128_t, mode='c', ndim=1] taus
65264 : */
65265 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_21_decomp_interpolative_79idzr_svd, 0, __pyx_n_s_idzr_svd, NULL, __pyx_n_s_scipy_linalg__decomp_interpolati, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1931, __pyx_L1_error)
65266 3 : __Pyx_GOTREF(__pyx_t_4);
65267 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_idzr_svd, __pyx_t_4) < 0) __PYX_ERR(0, 1931, __pyx_L1_error)
65268 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65269 :
65270 : /* "scipy/linalg/_decomp_interpolative.pyx":1
65271 : * # cython: boundscheck=False # <<<<<<<<<<<<<<
65272 : * # cython: initializedcheck=False
65273 : * # cython: wraparound=False
65274 : */
65275 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
65276 3 : __Pyx_GOTREF(__pyx_t_4);
65277 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
65278 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
65279 :
65280 : /*--- Wrapped vars code ---*/
65281 :
65282 3 : goto __pyx_L0;
65283 0 : __pyx_L1_error:;
65284 0 : __Pyx_XDECREF(__pyx_t_4);
65285 0 : __Pyx_XDECREF(__pyx_t_5);
65286 0 : __Pyx_XDECREF(__pyx_t_7);
65287 0 : if (__pyx_m) {
65288 0 : if (__pyx_d && stringtab_initialized) {
65289 0 : __Pyx_AddTraceback("init scipy.linalg._decomp_interpolative", __pyx_clineno, __pyx_lineno, __pyx_filename);
65290 : }
65291 : #if !CYTHON_USE_MODULE_STATE
65292 0 : Py_CLEAR(__pyx_m);
65293 : #else
65294 : Py_DECREF(__pyx_m);
65295 : if (pystate_addmodule_run) {
65296 : PyObject *tp, *value, *tb;
65297 : PyErr_Fetch(&tp, &value, &tb);
65298 : PyState_RemoveModule(&__pyx_moduledef);
65299 : PyErr_Restore(tp, value, tb);
65300 : }
65301 : #endif
65302 0 : } else if (!PyErr_Occurred()) {
65303 0 : PyErr_SetString(PyExc_ImportError, "init scipy.linalg._decomp_interpolative");
65304 : }
65305 0 : __pyx_L0:;
65306 3 : __Pyx_RefNannyFinishContext();
65307 : #if CYTHON_PEP489_MULTI_PHASE_INIT
65308 3 : return (__pyx_m != NULL) ? 0 : -1;
65309 : #elif PY_MAJOR_VERSION >= 3
65310 : return __pyx_m;
65311 : #else
65312 : return;
65313 : #endif
65314 : }
65315 : /* #### Code section: cleanup_globals ### */
65316 : /* #### Code section: cleanup_module ### */
65317 : /* #### Code section: main_method ### */
65318 : /* #### Code section: utility_code_pragmas ### */
65319 : #ifdef _MSC_VER
65320 : #pragma warning( push )
65321 : /* Warning 4127: conditional expression is constant
65322 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
65323 : * compile-time, so this warning is not useful
65324 : */
65325 : #pragma warning( disable : 4127 )
65326 : #endif
65327 :
65328 :
65329 :
65330 : /* #### Code section: utility_code_def ### */
65331 :
65332 : /* --- Runtime support code --- */
65333 : /* Refnanny */
65334 : #if CYTHON_REFNANNY
65335 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
65336 : PyObject *m = NULL, *p = NULL;
65337 : void *r = NULL;
65338 : m = PyImport_ImportModule(modname);
65339 : if (!m) goto end;
65340 : p = PyObject_GetAttrString(m, "RefNannyAPI");
65341 : if (!p) goto end;
65342 : r = PyLong_AsVoidPtr(p);
65343 : end:
65344 : Py_XDECREF(p);
65345 : Py_XDECREF(m);
65346 : return (__Pyx_RefNannyAPIStruct *)r;
65347 : }
65348 : #endif
65349 :
65350 : /* PyErrExceptionMatches */
65351 : #if CYTHON_FAST_THREAD_STATE
65352 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
65353 0 : Py_ssize_t i, n;
65354 0 : n = PyTuple_GET_SIZE(tuple);
65355 : #if PY_MAJOR_VERSION >= 3
65356 0 : for (i=0; i<n; i++) {
65357 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
65358 : }
65359 : #endif
65360 0 : for (i=0; i<n; i++) {
65361 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
65362 : }
65363 : return 0;
65364 : }
65365 9 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
65366 9 : int result;
65367 9 : PyObject *exc_type;
65368 : #if PY_VERSION_HEX >= 0x030C00A6
65369 9 : PyObject *current_exception = tstate->current_exception;
65370 9 : if (unlikely(!current_exception)) return 0;
65371 9 : exc_type = (PyObject*) Py_TYPE(current_exception);
65372 9 : if (exc_type == err) return 1;
65373 : #else
65374 : exc_type = tstate->curexc_type;
65375 : if (exc_type == err) return 1;
65376 : if (unlikely(!exc_type)) return 0;
65377 : #endif
65378 : #if CYTHON_AVOID_BORROWED_REFS
65379 : Py_INCREF(exc_type);
65380 : #endif
65381 0 : if (unlikely(PyTuple_Check(err))) {
65382 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
65383 : } else {
65384 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
65385 : }
65386 : #if CYTHON_AVOID_BORROWED_REFS
65387 : Py_DECREF(exc_type);
65388 : #endif
65389 : return result;
65390 : }
65391 : #endif
65392 :
65393 : /* PyErrFetchRestore */
65394 : #if CYTHON_FAST_THREAD_STATE
65395 9 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
65396 : #if PY_VERSION_HEX >= 0x030C00A6
65397 9 : PyObject *tmp_value;
65398 9 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
65399 9 : if (value) {
65400 : #if CYTHON_COMPILING_IN_CPYTHON
65401 0 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
65402 : #endif
65403 0 : PyException_SetTraceback(value, tb);
65404 : }
65405 9 : tmp_value = tstate->current_exception;
65406 9 : tstate->current_exception = value;
65407 9 : Py_XDECREF(tmp_value);
65408 9 : Py_XDECREF(type);
65409 9 : Py_XDECREF(tb);
65410 : #else
65411 : PyObject *tmp_type, *tmp_value, *tmp_tb;
65412 : tmp_type = tstate->curexc_type;
65413 : tmp_value = tstate->curexc_value;
65414 : tmp_tb = tstate->curexc_traceback;
65415 : tstate->curexc_type = type;
65416 : tstate->curexc_value = value;
65417 : tstate->curexc_traceback = tb;
65418 : Py_XDECREF(tmp_type);
65419 : Py_XDECREF(tmp_value);
65420 : Py_XDECREF(tmp_tb);
65421 : #endif
65422 9 : }
65423 0 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
65424 : #if PY_VERSION_HEX >= 0x030C00A6
65425 0 : PyObject* exc_value;
65426 0 : exc_value = tstate->current_exception;
65427 0 : tstate->current_exception = 0;
65428 0 : *value = exc_value;
65429 0 : *type = NULL;
65430 0 : *tb = NULL;
65431 0 : if (exc_value) {
65432 0 : *type = (PyObject*) Py_TYPE(exc_value);
65433 0 : Py_INCREF(*type);
65434 : #if CYTHON_COMPILING_IN_CPYTHON
65435 0 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
65436 0 : Py_XINCREF(*tb);
65437 : #else
65438 : *tb = PyException_GetTraceback(exc_value);
65439 : #endif
65440 : }
65441 : #else
65442 : *type = tstate->curexc_type;
65443 : *value = tstate->curexc_value;
65444 : *tb = tstate->curexc_traceback;
65445 : tstate->curexc_type = 0;
65446 : tstate->curexc_value = 0;
65447 : tstate->curexc_traceback = 0;
65448 : #endif
65449 0 : }
65450 : #endif
65451 :
65452 : /* PyObjectGetAttrStr */
65453 : #if CYTHON_USE_TYPE_SLOTS
65454 13388 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
65455 13388 : PyTypeObject* tp = Py_TYPE(obj);
65456 13388 : if (likely(tp->tp_getattro))
65457 13388 : return tp->tp_getattro(obj, attr_name);
65458 : #if PY_MAJOR_VERSION < 3
65459 : if (likely(tp->tp_getattr))
65460 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
65461 : #endif
65462 0 : return PyObject_GetAttr(obj, attr_name);
65463 : }
65464 : #endif
65465 :
65466 : /* PyObjectGetAttrStrNoError */
65467 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
65468 9 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
65469 9 : __Pyx_PyThreadState_declare
65470 9 : __Pyx_PyThreadState_assign
65471 9 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
65472 9 : __Pyx_PyErr_Clear();
65473 9 : }
65474 : #endif
65475 87 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
65476 87 : PyObject *result;
65477 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
65478 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
65479 : return result;
65480 : #else
65481 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
65482 87 : PyTypeObject* tp = Py_TYPE(obj);
65483 87 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
65484 12 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
65485 : }
65486 : #endif
65487 75 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
65488 75 : if (unlikely(!result)) {
65489 9 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
65490 : }
65491 : return result;
65492 : #endif
65493 : }
65494 :
65495 : /* GetBuiltinName */
65496 33 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
65497 33 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
65498 33 : if (unlikely(!result) && !PyErr_Occurred()) {
65499 0 : PyErr_Format(PyExc_NameError,
65500 : #if PY_MAJOR_VERSION >= 3
65501 : "name '%U' is not defined", name);
65502 : #else
65503 : "name '%.200s' is not defined", PyString_AS_STRING(name));
65504 : #endif
65505 : }
65506 33 : return result;
65507 : }
65508 :
65509 : /* TupleAndListFromArray */
65510 : #if CYTHON_COMPILING_IN_CPYTHON
65511 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
65512 : PyObject *v;
65513 : Py_ssize_t i;
65514 : for (i = 0; i < length; i++) {
65515 : v = dest[i] = src[i];
65516 : Py_INCREF(v);
65517 : }
65518 : }
65519 : static CYTHON_INLINE PyObject *
65520 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
65521 : {
65522 : PyObject *res;
65523 : if (n <= 0) {
65524 : Py_INCREF(__pyx_empty_tuple);
65525 : return __pyx_empty_tuple;
65526 : }
65527 : res = PyTuple_New(n);
65528 : if (unlikely(res == NULL)) return NULL;
65529 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
65530 : return res;
65531 : }
65532 : static CYTHON_INLINE PyObject *
65533 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
65534 : {
65535 : PyObject *res;
65536 : if (n <= 0) {
65537 : return PyList_New(0);
65538 : }
65539 : res = PyList_New(n);
65540 : if (unlikely(res == NULL)) return NULL;
65541 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
65542 : return res;
65543 : }
65544 : #endif
65545 :
65546 : /* BytesEquals */
65547 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
65548 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
65549 : return PyObject_RichCompareBool(s1, s2, equals);
65550 : #else
65551 : if (s1 == s2) {
65552 : return (equals == Py_EQ);
65553 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
65554 : const char *ps1, *ps2;
65555 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
65556 : if (length != PyBytes_GET_SIZE(s2))
65557 : return (equals == Py_NE);
65558 : ps1 = PyBytes_AS_STRING(s1);
65559 : ps2 = PyBytes_AS_STRING(s2);
65560 : if (ps1[0] != ps2[0]) {
65561 : return (equals == Py_NE);
65562 : } else if (length == 1) {
65563 : return (equals == Py_EQ);
65564 : } else {
65565 : int result;
65566 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
65567 : Py_hash_t hash1, hash2;
65568 : hash1 = ((PyBytesObject*)s1)->ob_shash;
65569 : hash2 = ((PyBytesObject*)s2)->ob_shash;
65570 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
65571 : return (equals == Py_NE);
65572 : }
65573 : #endif
65574 : result = memcmp(ps1, ps2, (size_t)length);
65575 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
65576 : }
65577 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
65578 : return (equals == Py_NE);
65579 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
65580 : return (equals == Py_NE);
65581 : } else {
65582 : int result;
65583 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
65584 : if (!py_result)
65585 : return -1;
65586 : result = __Pyx_PyObject_IsTrue(py_result);
65587 : Py_DECREF(py_result);
65588 : return result;
65589 : }
65590 : #endif
65591 : }
65592 :
65593 : /* UnicodeEquals */
65594 0 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
65595 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
65596 : return PyObject_RichCompareBool(s1, s2, equals);
65597 : #else
65598 : #if PY_MAJOR_VERSION < 3
65599 : PyObject* owned_ref = NULL;
65600 : #endif
65601 0 : int s1_is_unicode, s2_is_unicode;
65602 0 : if (s1 == s2) {
65603 0 : goto return_eq;
65604 : }
65605 0 : s1_is_unicode = PyUnicode_CheckExact(s1);
65606 0 : s2_is_unicode = PyUnicode_CheckExact(s2);
65607 : #if PY_MAJOR_VERSION < 3
65608 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
65609 : owned_ref = PyUnicode_FromObject(s2);
65610 : if (unlikely(!owned_ref))
65611 : return -1;
65612 : s2 = owned_ref;
65613 : s2_is_unicode = 1;
65614 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
65615 : owned_ref = PyUnicode_FromObject(s1);
65616 : if (unlikely(!owned_ref))
65617 : return -1;
65618 : s1 = owned_ref;
65619 : s1_is_unicode = 1;
65620 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
65621 : return __Pyx_PyBytes_Equals(s1, s2, equals);
65622 : }
65623 : #endif
65624 0 : if (s1_is_unicode & s2_is_unicode) {
65625 0 : Py_ssize_t length;
65626 0 : int kind;
65627 0 : void *data1, *data2;
65628 0 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
65629 : return -1;
65630 0 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
65631 0 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
65632 0 : goto return_ne;
65633 : }
65634 : #if CYTHON_USE_UNICODE_INTERNALS
65635 : {
65636 0 : Py_hash_t hash1, hash2;
65637 : #if CYTHON_PEP393_ENABLED
65638 0 : hash1 = ((PyASCIIObject*)s1)->hash;
65639 0 : hash2 = ((PyASCIIObject*)s2)->hash;
65640 : #else
65641 : hash1 = ((PyUnicodeObject*)s1)->hash;
65642 : hash2 = ((PyUnicodeObject*)s2)->hash;
65643 : #endif
65644 0 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
65645 0 : goto return_ne;
65646 : }
65647 : }
65648 : #endif
65649 0 : kind = __Pyx_PyUnicode_KIND(s1);
65650 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
65651 0 : goto return_ne;
65652 : }
65653 0 : data1 = __Pyx_PyUnicode_DATA(s1);
65654 0 : data2 = __Pyx_PyUnicode_DATA(s2);
65655 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
65656 0 : goto return_ne;
65657 0 : } else if (length == 1) {
65658 0 : goto return_eq;
65659 : } else {
65660 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
65661 : #if PY_MAJOR_VERSION < 3
65662 : Py_XDECREF(owned_ref);
65663 : #endif
65664 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
65665 : }
65666 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
65667 0 : goto return_ne;
65668 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
65669 0 : goto return_ne;
65670 : } else {
65671 0 : int result;
65672 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
65673 : #if PY_MAJOR_VERSION < 3
65674 : Py_XDECREF(owned_ref);
65675 : #endif
65676 0 : if (!py_result)
65677 : return -1;
65678 0 : result = __Pyx_PyObject_IsTrue(py_result);
65679 0 : Py_DECREF(py_result);
65680 0 : return result;
65681 : }
65682 0 : return_eq:
65683 : #if PY_MAJOR_VERSION < 3
65684 : Py_XDECREF(owned_ref);
65685 : #endif
65686 0 : return (equals == Py_EQ);
65687 0 : return_ne:
65688 : #if PY_MAJOR_VERSION < 3
65689 : Py_XDECREF(owned_ref);
65690 : #endif
65691 0 : return (equals == Py_NE);
65692 : #endif
65693 : }
65694 :
65695 : /* fastcall */
65696 : #if CYTHON_METH_FASTCALL
65697 112 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
65698 : {
65699 112 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
65700 137 : for (i = 0; i < n; i++)
65701 : {
65702 137 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
65703 : }
65704 0 : for (i = 0; i < n; i++)
65705 : {
65706 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
65707 0 : if (unlikely(eq != 0)) {
65708 0 : if (unlikely(eq < 0)) return NULL;
65709 0 : return kwvalues[i];
65710 : }
65711 : }
65712 : return NULL;
65713 : }
65714 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
65715 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
65716 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
65717 : PyObject *dict;
65718 : dict = PyDict_New();
65719 : if (unlikely(!dict))
65720 : return NULL;
65721 : for (i=0; i<nkwargs; i++) {
65722 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
65723 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
65724 : goto bad;
65725 : }
65726 : return dict;
65727 : bad:
65728 : Py_DECREF(dict);
65729 : return NULL;
65730 : }
65731 : #endif
65732 : #endif
65733 :
65734 : /* RaiseArgTupleInvalid */
65735 0 : static void __Pyx_RaiseArgtupleInvalid(
65736 : const char* func_name,
65737 : int exact,
65738 : Py_ssize_t num_min,
65739 : Py_ssize_t num_max,
65740 : Py_ssize_t num_found)
65741 : {
65742 0 : Py_ssize_t num_expected;
65743 0 : const char *more_or_less;
65744 0 : if (num_found < num_min) {
65745 : num_expected = num_min;
65746 : more_or_less = "at least";
65747 : } else {
65748 0 : num_expected = num_max;
65749 0 : more_or_less = "at most";
65750 : }
65751 0 : if (exact) {
65752 0 : more_or_less = "exactly";
65753 : }
65754 0 : PyErr_Format(PyExc_TypeError,
65755 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
65756 : func_name, more_or_less, num_expected,
65757 : (num_expected == 1) ? "" : "s", num_found);
65758 0 : }
65759 :
65760 : /* RaiseDoubleKeywords */
65761 0 : static void __Pyx_RaiseDoubleKeywordsError(
65762 : const char* func_name,
65763 : PyObject* kw_name)
65764 : {
65765 0 : PyErr_Format(PyExc_TypeError,
65766 : #if PY_MAJOR_VERSION >= 3
65767 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
65768 : #else
65769 : "%s() got multiple values for keyword argument '%s'", func_name,
65770 : PyString_AsString(kw_name));
65771 : #endif
65772 : }
65773 :
65774 : /* ParseKeywords */
65775 0 : static int __Pyx_ParseOptionalKeywords(
65776 : PyObject *kwds,
65777 : PyObject *const *kwvalues,
65778 : PyObject **argnames[],
65779 : PyObject *kwds2,
65780 : PyObject *values[],
65781 : Py_ssize_t num_pos_args,
65782 : const char* function_name)
65783 : {
65784 0 : PyObject *key = 0, *value = 0;
65785 0 : Py_ssize_t pos = 0;
65786 0 : PyObject*** name;
65787 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
65788 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
65789 0 : while (1) {
65790 0 : Py_XDECREF(key); key = NULL;
65791 0 : Py_XDECREF(value); value = NULL;
65792 0 : if (kwds_is_tuple) {
65793 0 : Py_ssize_t size;
65794 : #if CYTHON_ASSUME_SAFE_MACROS
65795 0 : size = PyTuple_GET_SIZE(kwds);
65796 : #else
65797 : size = PyTuple_Size(kwds);
65798 : if (size < 0) goto bad;
65799 : #endif
65800 0 : if (pos >= size) break;
65801 : #if CYTHON_AVOID_BORROWED_REFS
65802 : key = __Pyx_PySequence_ITEM(kwds, pos);
65803 : if (!key) goto bad;
65804 : #elif CYTHON_ASSUME_SAFE_MACROS
65805 0 : key = PyTuple_GET_ITEM(kwds, pos);
65806 : #else
65807 : key = PyTuple_GetItem(kwds, pos);
65808 : if (!key) goto bad;
65809 : #endif
65810 0 : value = kwvalues[pos];
65811 0 : pos++;
65812 : }
65813 : else
65814 : {
65815 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
65816 : #if CYTHON_AVOID_BORROWED_REFS
65817 : Py_INCREF(key);
65818 : #endif
65819 : }
65820 0 : name = first_kw_arg;
65821 0 : while (*name && (**name != key)) name++;
65822 0 : if (*name) {
65823 0 : values[name-argnames] = value;
65824 : #if CYTHON_AVOID_BORROWED_REFS
65825 : Py_INCREF(value);
65826 : Py_DECREF(key);
65827 : #endif
65828 0 : key = NULL;
65829 0 : value = NULL;
65830 0 : continue;
65831 : }
65832 : #if !CYTHON_AVOID_BORROWED_REFS
65833 0 : Py_INCREF(key);
65834 : #endif
65835 0 : Py_INCREF(value);
65836 0 : name = first_kw_arg;
65837 : #if PY_MAJOR_VERSION < 3
65838 : if (likely(PyString_Check(key))) {
65839 : while (*name) {
65840 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
65841 : && _PyString_Eq(**name, key)) {
65842 : values[name-argnames] = value;
65843 : #if CYTHON_AVOID_BORROWED_REFS
65844 : value = NULL;
65845 : #endif
65846 : break;
65847 : }
65848 : name++;
65849 : }
65850 : if (*name) continue;
65851 : else {
65852 : PyObject*** argname = argnames;
65853 : while (argname != first_kw_arg) {
65854 : if ((**argname == key) || (
65855 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
65856 : && _PyString_Eq(**argname, key))) {
65857 : goto arg_passed_twice;
65858 : }
65859 : argname++;
65860 : }
65861 : }
65862 : } else
65863 : #endif
65864 0 : if (likely(PyUnicode_Check(key))) {
65865 0 : while (*name) {
65866 0 : int cmp = (
65867 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
65868 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
65869 : #endif
65870 0 : PyUnicode_Compare(**name, key)
65871 : );
65872 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
65873 0 : if (cmp == 0) {
65874 0 : values[name-argnames] = value;
65875 : #if CYTHON_AVOID_BORROWED_REFS
65876 : value = NULL;
65877 : #endif
65878 0 : break;
65879 : }
65880 0 : name++;
65881 : }
65882 0 : if (*name) continue;
65883 : else {
65884 : PyObject*** argname = argnames;
65885 0 : while (argname != first_kw_arg) {
65886 0 : int cmp = (**argname == key) ? 0 :
65887 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
65888 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
65889 : #endif
65890 0 : PyUnicode_Compare(**argname, key);
65891 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
65892 0 : if (cmp == 0) goto arg_passed_twice;
65893 0 : argname++;
65894 : }
65895 : }
65896 : } else
65897 0 : goto invalid_keyword_type;
65898 0 : if (kwds2) {
65899 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
65900 : } else {
65901 0 : goto invalid_keyword;
65902 : }
65903 : }
65904 0 : Py_XDECREF(key);
65905 0 : Py_XDECREF(value);
65906 0 : return 0;
65907 0 : arg_passed_twice:
65908 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
65909 0 : goto bad;
65910 0 : invalid_keyword_type:
65911 0 : PyErr_Format(PyExc_TypeError,
65912 : "%.200s() keywords must be strings", function_name);
65913 0 : goto bad;
65914 0 : invalid_keyword:
65915 : #if PY_MAJOR_VERSION < 3
65916 : PyErr_Format(PyExc_TypeError,
65917 : "%.200s() got an unexpected keyword argument '%.200s'",
65918 : function_name, PyString_AsString(key));
65919 : #else
65920 0 : PyErr_Format(PyExc_TypeError,
65921 : "%s() got an unexpected keyword argument '%U'",
65922 : function_name, key);
65923 : #endif
65924 0 : bad:
65925 0 : Py_XDECREF(key);
65926 0 : Py_XDECREF(value);
65927 0 : return -1;
65928 : }
65929 :
65930 : /* ArgTypeTest */
65931 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
65932 : {
65933 0 : __Pyx_TypeName type_name;
65934 0 : __Pyx_TypeName obj_type_name;
65935 0 : if (unlikely(!type)) {
65936 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
65937 0 : return 0;
65938 : }
65939 0 : else if (exact) {
65940 : #if PY_MAJOR_VERSION == 2
65941 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
65942 : #endif
65943 : }
65944 : else {
65945 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
65946 : }
65947 0 : type_name = __Pyx_PyType_GetName(type);
65948 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
65949 0 : PyErr_Format(PyExc_TypeError,
65950 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
65951 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
65952 0 : __Pyx_DECREF_TypeName(type_name);
65953 0 : __Pyx_DECREF_TypeName(obj_type_name);
65954 0 : return 0;
65955 : }
65956 :
65957 : /* RaiseException */
65958 : #if PY_MAJOR_VERSION < 3
65959 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
65960 : __Pyx_PyThreadState_declare
65961 : CYTHON_UNUSED_VAR(cause);
65962 : Py_XINCREF(type);
65963 : if (!value || value == Py_None)
65964 : value = NULL;
65965 : else
65966 : Py_INCREF(value);
65967 : if (!tb || tb == Py_None)
65968 : tb = NULL;
65969 : else {
65970 : Py_INCREF(tb);
65971 : if (!PyTraceBack_Check(tb)) {
65972 : PyErr_SetString(PyExc_TypeError,
65973 : "raise: arg 3 must be a traceback or None");
65974 : goto raise_error;
65975 : }
65976 : }
65977 : if (PyType_Check(type)) {
65978 : #if CYTHON_COMPILING_IN_PYPY
65979 : if (!value) {
65980 : Py_INCREF(Py_None);
65981 : value = Py_None;
65982 : }
65983 : #endif
65984 : PyErr_NormalizeException(&type, &value, &tb);
65985 : } else {
65986 : if (value) {
65987 : PyErr_SetString(PyExc_TypeError,
65988 : "instance exception may not have a separate value");
65989 : goto raise_error;
65990 : }
65991 : value = type;
65992 : type = (PyObject*) Py_TYPE(type);
65993 : Py_INCREF(type);
65994 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
65995 : PyErr_SetString(PyExc_TypeError,
65996 : "raise: exception class must be a subclass of BaseException");
65997 : goto raise_error;
65998 : }
65999 : }
66000 : __Pyx_PyThreadState_assign
66001 : __Pyx_ErrRestore(type, value, tb);
66002 : return;
66003 : raise_error:
66004 : Py_XDECREF(value);
66005 : Py_XDECREF(type);
66006 : Py_XDECREF(tb);
66007 : return;
66008 : }
66009 : #else
66010 0 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
66011 0 : PyObject* owned_instance = NULL;
66012 0 : if (tb == Py_None) {
66013 : tb = 0;
66014 0 : } else if (tb && !PyTraceBack_Check(tb)) {
66015 0 : PyErr_SetString(PyExc_TypeError,
66016 : "raise: arg 3 must be a traceback or None");
66017 0 : goto bad;
66018 : }
66019 0 : if (value == Py_None)
66020 0 : value = 0;
66021 0 : if (PyExceptionInstance_Check(type)) {
66022 0 : if (value) {
66023 0 : PyErr_SetString(PyExc_TypeError,
66024 : "instance exception may not have a separate value");
66025 0 : goto bad;
66026 : }
66027 : value = type;
66028 : type = (PyObject*) Py_TYPE(value);
66029 0 : } else if (PyExceptionClass_Check(type)) {
66030 0 : PyObject *instance_class = NULL;
66031 0 : if (value && PyExceptionInstance_Check(value)) {
66032 0 : instance_class = (PyObject*) Py_TYPE(value);
66033 0 : if (instance_class != type) {
66034 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
66035 0 : if (!is_subclass) {
66036 : instance_class = NULL;
66037 0 : } else if (unlikely(is_subclass == -1)) {
66038 0 : goto bad;
66039 : } else {
66040 : type = instance_class;
66041 : }
66042 : }
66043 : }
66044 : if (!instance_class) {
66045 0 : PyObject *args;
66046 0 : if (!value)
66047 0 : args = PyTuple_New(0);
66048 0 : else if (PyTuple_Check(value)) {
66049 0 : Py_INCREF(value);
66050 0 : args = value;
66051 : } else
66052 0 : args = PyTuple_Pack(1, value);
66053 0 : if (!args)
66054 0 : goto bad;
66055 0 : owned_instance = PyObject_Call(type, args, NULL);
66056 0 : Py_DECREF(args);
66057 0 : if (!owned_instance)
66058 0 : goto bad;
66059 0 : value = owned_instance;
66060 0 : if (!PyExceptionInstance_Check(value)) {
66061 0 : PyErr_Format(PyExc_TypeError,
66062 : "calling %R should have returned an instance of "
66063 : "BaseException, not %R",
66064 : type, Py_TYPE(value));
66065 0 : goto bad;
66066 : }
66067 : }
66068 : } else {
66069 0 : PyErr_SetString(PyExc_TypeError,
66070 : "raise: exception class must be a subclass of BaseException");
66071 0 : goto bad;
66072 : }
66073 0 : if (cause) {
66074 0 : PyObject *fixed_cause;
66075 0 : if (cause == Py_None) {
66076 : fixed_cause = NULL;
66077 0 : } else if (PyExceptionClass_Check(cause)) {
66078 0 : fixed_cause = PyObject_CallObject(cause, NULL);
66079 0 : if (fixed_cause == NULL)
66080 0 : goto bad;
66081 0 : } else if (PyExceptionInstance_Check(cause)) {
66082 0 : fixed_cause = cause;
66083 0 : Py_INCREF(fixed_cause);
66084 : } else {
66085 0 : PyErr_SetString(PyExc_TypeError,
66086 : "exception causes must derive from "
66087 : "BaseException");
66088 0 : goto bad;
66089 : }
66090 0 : PyException_SetCause(value, fixed_cause);
66091 : }
66092 0 : PyErr_SetObject(type, value);
66093 0 : if (tb) {
66094 : #if PY_VERSION_HEX >= 0x030C00A6
66095 0 : PyException_SetTraceback(value, tb);
66096 : #elif CYTHON_FAST_THREAD_STATE
66097 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
66098 : PyObject* tmp_tb = tstate->curexc_traceback;
66099 : if (tb != tmp_tb) {
66100 : Py_INCREF(tb);
66101 : tstate->curexc_traceback = tb;
66102 : Py_XDECREF(tmp_tb);
66103 : }
66104 : #else
66105 : PyObject *tmp_type, *tmp_value, *tmp_tb;
66106 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
66107 : Py_INCREF(tb);
66108 : PyErr_Restore(tmp_type, tmp_value, tb);
66109 : Py_XDECREF(tmp_tb);
66110 : #endif
66111 : }
66112 0 : bad:
66113 0 : Py_XDECREF(owned_instance);
66114 0 : return;
66115 : }
66116 : #endif
66117 :
66118 : /* PyFunctionFastCall */
66119 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
66120 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
66121 : PyObject *globals) {
66122 : PyFrameObject *f;
66123 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
66124 : PyObject **fastlocals;
66125 : Py_ssize_t i;
66126 : PyObject *result;
66127 : assert(globals != NULL);
66128 : /* XXX Perhaps we should create a specialized
66129 : PyFrame_New() that doesn't take locals, but does
66130 : take builtins without sanity checking them.
66131 : */
66132 : assert(tstate != NULL);
66133 : f = PyFrame_New(tstate, co, globals, NULL);
66134 : if (f == NULL) {
66135 : return NULL;
66136 : }
66137 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
66138 : for (i = 0; i < na; i++) {
66139 : Py_INCREF(*args);
66140 : fastlocals[i] = *args++;
66141 : }
66142 : result = PyEval_EvalFrameEx(f,0);
66143 : ++tstate->recursion_depth;
66144 : Py_DECREF(f);
66145 : --tstate->recursion_depth;
66146 : return result;
66147 : }
66148 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
66149 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
66150 : PyObject *globals = PyFunction_GET_GLOBALS(func);
66151 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
66152 : PyObject *closure;
66153 : #if PY_MAJOR_VERSION >= 3
66154 : PyObject *kwdefs;
66155 : #endif
66156 : PyObject *kwtuple, **k;
66157 : PyObject **d;
66158 : Py_ssize_t nd;
66159 : Py_ssize_t nk;
66160 : PyObject *result;
66161 : assert(kwargs == NULL || PyDict_Check(kwargs));
66162 : nk = kwargs ? PyDict_Size(kwargs) : 0;
66163 : #if PY_MAJOR_VERSION < 3
66164 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
66165 : return NULL;
66166 : }
66167 : #else
66168 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
66169 : return NULL;
66170 : }
66171 : #endif
66172 : if (
66173 : #if PY_MAJOR_VERSION >= 3
66174 : co->co_kwonlyargcount == 0 &&
66175 : #endif
66176 : likely(kwargs == NULL || nk == 0) &&
66177 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
66178 : if (argdefs == NULL && co->co_argcount == nargs) {
66179 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
66180 : goto done;
66181 : }
66182 : else if (nargs == 0 && argdefs != NULL
66183 : && co->co_argcount == Py_SIZE(argdefs)) {
66184 : /* function called with no arguments, but all parameters have
66185 : a default value: use default values as arguments .*/
66186 : args = &PyTuple_GET_ITEM(argdefs, 0);
66187 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
66188 : goto done;
66189 : }
66190 : }
66191 : if (kwargs != NULL) {
66192 : Py_ssize_t pos, i;
66193 : kwtuple = PyTuple_New(2 * nk);
66194 : if (kwtuple == NULL) {
66195 : result = NULL;
66196 : goto done;
66197 : }
66198 : k = &PyTuple_GET_ITEM(kwtuple, 0);
66199 : pos = i = 0;
66200 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
66201 : Py_INCREF(k[i]);
66202 : Py_INCREF(k[i+1]);
66203 : i += 2;
66204 : }
66205 : nk = i / 2;
66206 : }
66207 : else {
66208 : kwtuple = NULL;
66209 : k = NULL;
66210 : }
66211 : closure = PyFunction_GET_CLOSURE(func);
66212 : #if PY_MAJOR_VERSION >= 3
66213 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
66214 : #endif
66215 : if (argdefs != NULL) {
66216 : d = &PyTuple_GET_ITEM(argdefs, 0);
66217 : nd = Py_SIZE(argdefs);
66218 : }
66219 : else {
66220 : d = NULL;
66221 : nd = 0;
66222 : }
66223 : #if PY_MAJOR_VERSION >= 3
66224 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
66225 : args, (int)nargs,
66226 : k, (int)nk,
66227 : d, (int)nd, kwdefs, closure);
66228 : #else
66229 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
66230 : args, (int)nargs,
66231 : k, (int)nk,
66232 : d, (int)nd, closure);
66233 : #endif
66234 : Py_XDECREF(kwtuple);
66235 : done:
66236 : Py_LeaveRecursiveCall();
66237 : return result;
66238 : }
66239 : #endif
66240 :
66241 : /* PyObjectCall */
66242 : #if CYTHON_COMPILING_IN_CPYTHON
66243 8015 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
66244 8015 : PyObject *result;
66245 8015 : ternaryfunc call = Py_TYPE(func)->tp_call;
66246 8015 : if (unlikely(!call))
66247 0 : return PyObject_Call(func, arg, kw);
66248 : #if PY_MAJOR_VERSION < 3
66249 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
66250 : return NULL;
66251 : #else
66252 8015 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
66253 : return NULL;
66254 : #endif
66255 8015 : result = (*call)(func, arg, kw);
66256 8015 : Py_LeaveRecursiveCall();
66257 8015 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
66258 0 : PyErr_SetString(
66259 : PyExc_SystemError,
66260 : "NULL result without error in PyObject_Call");
66261 : }
66262 : return result;
66263 : }
66264 : #endif
66265 :
66266 : /* PyObjectCallMethO */
66267 : #if CYTHON_COMPILING_IN_CPYTHON
66268 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
66269 0 : PyObject *self, *result;
66270 0 : PyCFunction cfunc;
66271 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
66272 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
66273 : #if PY_MAJOR_VERSION < 3
66274 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
66275 : return NULL;
66276 : #else
66277 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
66278 : return NULL;
66279 : #endif
66280 0 : result = cfunc(self, arg);
66281 0 : Py_LeaveRecursiveCall();
66282 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
66283 0 : PyErr_SetString(
66284 : PyExc_SystemError,
66285 : "NULL result without error in PyObject_Call");
66286 : }
66287 : return result;
66288 : }
66289 : #endif
66290 :
66291 : /* PyObjectFastCall */
66292 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
66293 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
66294 : PyObject *argstuple;
66295 : PyObject *result = 0;
66296 : size_t i;
66297 : argstuple = PyTuple_New((Py_ssize_t)nargs);
66298 : if (unlikely(!argstuple)) return NULL;
66299 : for (i = 0; i < nargs; i++) {
66300 : Py_INCREF(args[i]);
66301 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
66302 : }
66303 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
66304 : bad:
66305 : Py_DECREF(argstuple);
66306 : return result;
66307 : }
66308 : #endif
66309 6870 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
66310 6870 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
66311 : #if CYTHON_COMPILING_IN_CPYTHON
66312 6870 : if (nargs == 0 && kwargs == NULL) {
66313 2090 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
66314 0 : return __Pyx_PyObject_CallMethO(func, NULL);
66315 : }
66316 4780 : else if (nargs == 1 && kwargs == NULL) {
66317 2922 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
66318 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
66319 : }
66320 : #endif
66321 : #if PY_VERSION_HEX < 0x030800B1
66322 : #if CYTHON_FAST_PYCCALL
66323 : if (PyCFunction_Check(func)) {
66324 : if (kwargs) {
66325 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
66326 : } else {
66327 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
66328 : }
66329 : }
66330 : #if PY_VERSION_HEX >= 0x030700A1
66331 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
66332 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
66333 : }
66334 : #endif
66335 : #endif
66336 : #if CYTHON_FAST_PYCALL
66337 : if (PyFunction_Check(func)) {
66338 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
66339 : }
66340 : #endif
66341 : #endif
66342 6870 : if (kwargs == NULL) {
66343 : #if CYTHON_VECTORCALL
66344 : #if PY_VERSION_HEX < 0x03090000
66345 : vectorcallfunc f = _PyVectorcall_Function(func);
66346 : #else
66347 6870 : vectorcallfunc f = PyVectorcall_Function(func);
66348 : #endif
66349 6870 : if (f) {
66350 4922 : return f(func, args, (size_t)nargs, NULL);
66351 : }
66352 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
66353 : if (__Pyx_CyFunction_CheckExact(func)) {
66354 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
66355 : if (f) return f(func, args, (size_t)nargs, NULL);
66356 : }
66357 : #endif
66358 : }
66359 1948 : if (nargs == 0) {
66360 1948 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
66361 : }
66362 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
66363 0 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
66364 : #else
66365 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
66366 : #endif
66367 : }
66368 :
66369 : /* RaiseUnexpectedTypeError */
66370 : static int
66371 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
66372 : {
66373 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
66374 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
66375 : expected, obj_type_name);
66376 0 : __Pyx_DECREF_TypeName(obj_type_name);
66377 0 : return 0;
66378 : }
66379 :
66380 : /* CIntToDigits */
66381 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
66382 : "00010203040506070809"
66383 : "10111213141516171819"
66384 : "20212223242526272829"
66385 : "30313233343536373839"
66386 : "40414243444546474849"
66387 : "50515253545556575859"
66388 : "60616263646566676869"
66389 : "70717273747576777879"
66390 : "80818283848586878889"
66391 : "90919293949596979899"
66392 : };
66393 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
66394 : "0001020304050607"
66395 : "1011121314151617"
66396 : "2021222324252627"
66397 : "3031323334353637"
66398 : "4041424344454647"
66399 : "5051525354555657"
66400 : "6061626364656667"
66401 : "7071727374757677"
66402 : };
66403 : static const char DIGITS_HEX[2*16+1] = {
66404 : "0123456789abcdef"
66405 : "0123456789ABCDEF"
66406 : };
66407 :
66408 : /* BuildPyUnicode */
66409 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
66410 : int prepend_sign, char padding_char) {
66411 0 : PyObject *uval;
66412 0 : Py_ssize_t uoffset = ulength - clength;
66413 : #if CYTHON_USE_UNICODE_INTERNALS
66414 0 : Py_ssize_t i;
66415 : #if CYTHON_PEP393_ENABLED
66416 0 : void *udata;
66417 0 : uval = PyUnicode_New(ulength, 127);
66418 0 : if (unlikely(!uval)) return NULL;
66419 0 : udata = PyUnicode_DATA(uval);
66420 : #else
66421 : Py_UNICODE *udata;
66422 : uval = PyUnicode_FromUnicode(NULL, ulength);
66423 : if (unlikely(!uval)) return NULL;
66424 : udata = PyUnicode_AS_UNICODE(uval);
66425 : #endif
66426 0 : if (uoffset > 0) {
66427 0 : i = 0;
66428 0 : if (prepend_sign) {
66429 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
66430 0 : i++;
66431 : }
66432 0 : for (; i < uoffset; i++) {
66433 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
66434 : }
66435 : }
66436 0 : for (i=0; i < clength; i++) {
66437 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
66438 : }
66439 : #else
66440 : {
66441 : PyObject *sign = NULL, *padding = NULL;
66442 : uval = NULL;
66443 : if (uoffset > 0) {
66444 : prepend_sign = !!prepend_sign;
66445 : if (uoffset > prepend_sign) {
66446 : padding = PyUnicode_FromOrdinal(padding_char);
66447 : if (likely(padding) && uoffset > prepend_sign + 1) {
66448 : PyObject *tmp;
66449 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
66450 : if (unlikely(!repeat)) goto done_or_error;
66451 : tmp = PyNumber_Multiply(padding, repeat);
66452 : Py_DECREF(repeat);
66453 : Py_DECREF(padding);
66454 : padding = tmp;
66455 : }
66456 : if (unlikely(!padding)) goto done_or_error;
66457 : }
66458 : if (prepend_sign) {
66459 : sign = PyUnicode_FromOrdinal('-');
66460 : if (unlikely(!sign)) goto done_or_error;
66461 : }
66462 : }
66463 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
66464 : if (likely(uval) && padding) {
66465 : PyObject *tmp = PyNumber_Add(padding, uval);
66466 : Py_DECREF(uval);
66467 : uval = tmp;
66468 : }
66469 : if (likely(uval) && sign) {
66470 : PyObject *tmp = PyNumber_Add(sign, uval);
66471 : Py_DECREF(uval);
66472 : uval = tmp;
66473 : }
66474 : done_or_error:
66475 : Py_XDECREF(padding);
66476 : Py_XDECREF(sign);
66477 : }
66478 : #endif
66479 : return uval;
66480 : }
66481 :
66482 : /* CIntToPyUnicode */
66483 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
66484 0 : char digits[sizeof(int)*3+2];
66485 0 : char *dpos, *end = digits + sizeof(int)*3+2;
66486 0 : const char *hex_digits = DIGITS_HEX;
66487 0 : Py_ssize_t length, ulength;
66488 0 : int prepend_sign, last_one_off;
66489 0 : int remaining;
66490 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
66491 : #pragma GCC diagnostic push
66492 : #pragma GCC diagnostic ignored "-Wconversion"
66493 : #endif
66494 0 : const int neg_one = (int) -1, const_zero = (int) 0;
66495 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
66496 : #pragma GCC diagnostic pop
66497 : #endif
66498 0 : const int is_unsigned = neg_one > const_zero;
66499 0 : if (format_char == 'X') {
66500 0 : hex_digits += 16;
66501 0 : format_char = 'x';
66502 : }
66503 0 : remaining = value;
66504 0 : last_one_off = 0;
66505 0 : dpos = end;
66506 0 : do {
66507 0 : int digit_pos;
66508 0 : switch (format_char) {
66509 0 : case 'o':
66510 0 : digit_pos = abs((int)(remaining % (8*8)));
66511 0 : remaining = (int) (remaining / (8*8));
66512 0 : dpos -= 2;
66513 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
66514 0 : last_one_off = (digit_pos < 8);
66515 0 : break;
66516 0 : case 'd':
66517 0 : digit_pos = abs((int)(remaining % (10*10)));
66518 0 : remaining = (int) (remaining / (10*10));
66519 0 : dpos -= 2;
66520 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
66521 0 : last_one_off = (digit_pos < 10);
66522 0 : break;
66523 0 : case 'x':
66524 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
66525 0 : remaining = (int) (remaining / 16);
66526 0 : break;
66527 : default:
66528 : assert(0);
66529 : break;
66530 : }
66531 0 : } while (unlikely(remaining != 0));
66532 0 : assert(!last_one_off || *dpos == '0');
66533 0 : dpos += last_one_off;
66534 0 : length = end - dpos;
66535 0 : ulength = length;
66536 0 : prepend_sign = 0;
66537 0 : if (!is_unsigned && value <= neg_one) {
66538 0 : if (padding_char == ' ' || width <= length + 1) {
66539 0 : *(--dpos) = '-';
66540 0 : ++length;
66541 : } else {
66542 : prepend_sign = 1;
66543 : }
66544 0 : ++ulength;
66545 : }
66546 0 : if (width > ulength) {
66547 : ulength = width;
66548 : }
66549 0 : if (ulength == 1) {
66550 0 : return PyUnicode_FromOrdinal(*dpos);
66551 : }
66552 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
66553 : }
66554 :
66555 : /* CIntToPyUnicode */
66556 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
66557 0 : char digits[sizeof(Py_ssize_t)*3+2];
66558 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
66559 0 : const char *hex_digits = DIGITS_HEX;
66560 0 : Py_ssize_t length, ulength;
66561 0 : int prepend_sign, last_one_off;
66562 0 : Py_ssize_t remaining;
66563 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
66564 : #pragma GCC diagnostic push
66565 : #pragma GCC diagnostic ignored "-Wconversion"
66566 : #endif
66567 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
66568 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
66569 : #pragma GCC diagnostic pop
66570 : #endif
66571 0 : const int is_unsigned = neg_one > const_zero;
66572 0 : if (format_char == 'X') {
66573 0 : hex_digits += 16;
66574 0 : format_char = 'x';
66575 : }
66576 0 : remaining = value;
66577 0 : last_one_off = 0;
66578 0 : dpos = end;
66579 0 : do {
66580 0 : int digit_pos;
66581 0 : switch (format_char) {
66582 0 : case 'o':
66583 0 : digit_pos = abs((int)(remaining % (8*8)));
66584 0 : remaining = (Py_ssize_t) (remaining / (8*8));
66585 0 : dpos -= 2;
66586 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
66587 0 : last_one_off = (digit_pos < 8);
66588 0 : break;
66589 0 : case 'd':
66590 0 : digit_pos = abs((int)(remaining % (10*10)));
66591 0 : remaining = (Py_ssize_t) (remaining / (10*10));
66592 0 : dpos -= 2;
66593 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
66594 0 : last_one_off = (digit_pos < 10);
66595 0 : break;
66596 0 : case 'x':
66597 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
66598 0 : remaining = (Py_ssize_t) (remaining / 16);
66599 0 : break;
66600 : default:
66601 : assert(0);
66602 : break;
66603 : }
66604 0 : } while (unlikely(remaining != 0));
66605 0 : assert(!last_one_off || *dpos == '0');
66606 0 : dpos += last_one_off;
66607 0 : length = end - dpos;
66608 0 : ulength = length;
66609 0 : prepend_sign = 0;
66610 0 : if (!is_unsigned && value <= neg_one) {
66611 0 : if (padding_char == ' ' || width <= length + 1) {
66612 0 : *(--dpos) = '-';
66613 0 : ++length;
66614 : } else {
66615 : prepend_sign = 1;
66616 : }
66617 0 : ++ulength;
66618 : }
66619 0 : if (width > ulength) {
66620 : ulength = width;
66621 : }
66622 0 : if (ulength == 1) {
66623 0 : return PyUnicode_FromOrdinal(*dpos);
66624 : }
66625 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
66626 : }
66627 :
66628 : /* JoinPyUnicode */
66629 0 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
66630 : Py_UCS4 max_char) {
66631 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
66632 0 : PyObject *result_uval;
66633 0 : int result_ukind, kind_shift;
66634 0 : Py_ssize_t i, char_pos;
66635 0 : void *result_udata;
66636 0 : CYTHON_MAYBE_UNUSED_VAR(max_char);
66637 : #if CYTHON_PEP393_ENABLED
66638 0 : result_uval = PyUnicode_New(result_ulength, max_char);
66639 0 : if (unlikely(!result_uval)) return NULL;
66640 0 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
66641 0 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
66642 0 : result_udata = PyUnicode_DATA(result_uval);
66643 : #else
66644 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
66645 : if (unlikely(!result_uval)) return NULL;
66646 : result_ukind = sizeof(Py_UNICODE);
66647 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
66648 : result_udata = PyUnicode_AS_UNICODE(result_uval);
66649 : #endif
66650 0 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
66651 0 : char_pos = 0;
66652 0 : for (i=0; i < value_count; i++) {
66653 0 : int ukind;
66654 0 : Py_ssize_t ulength;
66655 0 : void *udata;
66656 0 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
66657 0 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
66658 : goto bad;
66659 0 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
66660 0 : if (unlikely(!ulength))
66661 0 : continue;
66662 0 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
66663 0 : goto overflow;
66664 0 : ukind = __Pyx_PyUnicode_KIND(uval);
66665 0 : udata = __Pyx_PyUnicode_DATA(uval);
66666 0 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
66667 0 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
66668 : } else {
66669 : #if PY_VERSION_HEX >= 0x030d0000
66670 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
66671 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
66672 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
66673 : #else
66674 : Py_ssize_t j;
66675 : for (j=0; j < ulength; j++) {
66676 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
66677 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
66678 : }
66679 : #endif
66680 : }
66681 0 : char_pos += ulength;
66682 : }
66683 : return result_uval;
66684 0 : overflow:
66685 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
66686 0 : bad:
66687 0 : Py_DECREF(result_uval);
66688 : return NULL;
66689 : #else
66690 : CYTHON_UNUSED_VAR(max_char);
66691 : CYTHON_UNUSED_VAR(result_ulength);
66692 : CYTHON_UNUSED_VAR(value_count);
66693 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
66694 : #endif
66695 : }
66696 :
66697 : /* GetAttr */
66698 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
66699 : #if CYTHON_USE_TYPE_SLOTS
66700 : #if PY_MAJOR_VERSION >= 3
66701 0 : if (likely(PyUnicode_Check(n)))
66702 : #else
66703 : if (likely(PyString_Check(n)))
66704 : #endif
66705 0 : return __Pyx_PyObject_GetAttrStr(o, n);
66706 : #endif
66707 0 : return PyObject_GetAttr(o, n);
66708 : }
66709 :
66710 : /* GetItemInt */
66711 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
66712 0 : PyObject *r;
66713 0 : if (unlikely(!j)) return NULL;
66714 0 : r = PyObject_GetItem(o, j);
66715 0 : Py_DECREF(j);
66716 : return r;
66717 : }
66718 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
66719 : CYTHON_NCP_UNUSED int wraparound,
66720 : CYTHON_NCP_UNUSED int boundscheck) {
66721 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
66722 : Py_ssize_t wrapped_i = i;
66723 : if (wraparound & unlikely(i < 0)) {
66724 : wrapped_i += PyList_GET_SIZE(o);
66725 : }
66726 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
66727 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
66728 : Py_INCREF(r);
66729 : return r;
66730 : }
66731 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
66732 : #else
66733 : return PySequence_GetItem(o, i);
66734 : #endif
66735 : }
66736 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
66737 : CYTHON_NCP_UNUSED int wraparound,
66738 : CYTHON_NCP_UNUSED int boundscheck) {
66739 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
66740 0 : Py_ssize_t wrapped_i = i;
66741 0 : if (wraparound & unlikely(i < 0)) {
66742 0 : wrapped_i += PyTuple_GET_SIZE(o);
66743 : }
66744 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
66745 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
66746 0 : Py_INCREF(r);
66747 0 : return r;
66748 : }
66749 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
66750 : #else
66751 : return PySequence_GetItem(o, i);
66752 : #endif
66753 : }
66754 3315 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
66755 : CYTHON_NCP_UNUSED int wraparound,
66756 : CYTHON_NCP_UNUSED int boundscheck) {
66757 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
66758 3315 : if (is_list || PyList_CheckExact(o)) {
66759 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
66760 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
66761 0 : PyObject *r = PyList_GET_ITEM(o, n);
66762 0 : Py_INCREF(r);
66763 0 : return r;
66764 : }
66765 : }
66766 3315 : else if (PyTuple_CheckExact(o)) {
66767 56 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
66768 56 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
66769 56 : PyObject *r = PyTuple_GET_ITEM(o, n);
66770 56 : Py_INCREF(r);
66771 56 : return r;
66772 : }
66773 : } else {
66774 3259 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
66775 3259 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
66776 3259 : if (mm && mm->mp_subscript) {
66777 3259 : PyObject *r, *key = PyInt_FromSsize_t(i);
66778 3259 : if (unlikely(!key)) return NULL;
66779 3259 : r = mm->mp_subscript(o, key);
66780 3259 : Py_DECREF(key);
66781 3259 : return r;
66782 : }
66783 0 : if (likely(sm && sm->sq_item)) {
66784 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
66785 0 : Py_ssize_t l = sm->sq_length(o);
66786 0 : if (likely(l >= 0)) {
66787 0 : i += l;
66788 : } else {
66789 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
66790 : return NULL;
66791 0 : PyErr_Clear();
66792 : }
66793 : }
66794 0 : return sm->sq_item(o, i);
66795 : }
66796 : }
66797 : #else
66798 : if (is_list || !PyMapping_Check(o)) {
66799 : return PySequence_GetItem(o, i);
66800 : }
66801 : #endif
66802 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
66803 : }
66804 :
66805 : /* PyObjectCallOneArg */
66806 6 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
66807 6 : PyObject *args[2] = {NULL, arg};
66808 6 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
66809 : }
66810 :
66811 : /* ObjectGetItem */
66812 : #if CYTHON_USE_TYPE_SLOTS
66813 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
66814 0 : PyObject *runerr = NULL;
66815 0 : Py_ssize_t key_value;
66816 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
66817 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
66818 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
66819 : }
66820 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
66821 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
66822 0 : PyErr_Clear();
66823 0 : PyErr_Format(PyExc_IndexError,
66824 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
66825 : __Pyx_DECREF_TypeName(index_type_name);
66826 : }
66827 : return NULL;
66828 : }
66829 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
66830 0 : __Pyx_TypeName obj_type_name;
66831 0 : if (likely(PyType_Check(obj))) {
66832 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
66833 0 : if (!meth) {
66834 0 : PyErr_Clear();
66835 : } else {
66836 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
66837 0 : Py_DECREF(meth);
66838 0 : return result;
66839 : }
66840 : }
66841 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
66842 0 : PyErr_Format(PyExc_TypeError,
66843 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
66844 0 : __Pyx_DECREF_TypeName(obj_type_name);
66845 0 : return NULL;
66846 : }
66847 28816 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
66848 28816 : PyTypeObject *tp = Py_TYPE(obj);
66849 28816 : PyMappingMethods *mm = tp->tp_as_mapping;
66850 28816 : PySequenceMethods *sm = tp->tp_as_sequence;
66851 28816 : if (likely(mm && mm->mp_subscript)) {
66852 28816 : return mm->mp_subscript(obj, key);
66853 : }
66854 0 : if (likely(sm && sm->sq_item)) {
66855 0 : return __Pyx_PyObject_GetIndex(obj, key);
66856 : }
66857 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
66858 : }
66859 : #endif
66860 :
66861 : /* KeywordStringCheck */
66862 0 : static int __Pyx_CheckKeywordStrings(
66863 : PyObject *kw,
66864 : const char* function_name,
66865 : int kw_allowed)
66866 : {
66867 0 : PyObject* key = 0;
66868 0 : Py_ssize_t pos = 0;
66869 : #if CYTHON_COMPILING_IN_PYPY
66870 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
66871 : goto invalid_keyword;
66872 : return 1;
66873 : #else
66874 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
66875 0 : Py_ssize_t kwsize;
66876 : #if CYTHON_ASSUME_SAFE_MACROS
66877 0 : kwsize = PyTuple_GET_SIZE(kw);
66878 : #else
66879 : kwsize = PyTuple_Size(kw);
66880 : if (kwsize < 0) return 0;
66881 : #endif
66882 0 : if (unlikely(kwsize == 0))
66883 : return 1;
66884 0 : if (!kw_allowed) {
66885 : #if CYTHON_ASSUME_SAFE_MACROS
66886 0 : key = PyTuple_GET_ITEM(kw, 0);
66887 : #else
66888 : key = PyTuple_GetItem(kw, pos);
66889 : if (!key) return 0;
66890 : #endif
66891 0 : goto invalid_keyword;
66892 : }
66893 : #if PY_VERSION_HEX < 0x03090000
66894 : for (pos = 0; pos < kwsize; pos++) {
66895 : #if CYTHON_ASSUME_SAFE_MACROS
66896 : key = PyTuple_GET_ITEM(kw, pos);
66897 : #else
66898 : key = PyTuple_GetItem(kw, pos);
66899 : if (!key) return 0;
66900 : #endif
66901 : if (unlikely(!PyUnicode_Check(key)))
66902 : goto invalid_keyword_type;
66903 : }
66904 : #endif
66905 : return 1;
66906 : }
66907 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
66908 : #if PY_MAJOR_VERSION < 3
66909 : if (unlikely(!PyString_Check(key)))
66910 : #endif
66911 0 : if (unlikely(!PyUnicode_Check(key)))
66912 0 : goto invalid_keyword_type;
66913 : }
66914 0 : if (!kw_allowed && unlikely(key))
66915 0 : goto invalid_keyword;
66916 : return 1;
66917 0 : invalid_keyword_type:
66918 0 : PyErr_Format(PyExc_TypeError,
66919 : "%.200s() keywords must be strings", function_name);
66920 0 : return 0;
66921 : #endif
66922 0 : invalid_keyword:
66923 : #if PY_MAJOR_VERSION < 3
66924 : PyErr_Format(PyExc_TypeError,
66925 : "%.200s() got an unexpected keyword argument '%.200s'",
66926 : function_name, PyString_AsString(key));
66927 : #else
66928 0 : PyErr_Format(PyExc_TypeError,
66929 : "%s() got an unexpected keyword argument '%U'",
66930 : function_name, key);
66931 : #endif
66932 0 : return 0;
66933 : }
66934 :
66935 : /* DivInt[Py_ssize_t] */
66936 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
66937 0 : Py_ssize_t q = a / b;
66938 0 : Py_ssize_t r = a - q*b;
66939 0 : q -= ((r != 0) & ((r ^ b) < 0));
66940 0 : return q;
66941 : }
66942 :
66943 : /* GetAttr3 */
66944 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
66945 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
66946 0 : __Pyx_PyThreadState_declare
66947 0 : __Pyx_PyThreadState_assign
66948 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
66949 : return NULL;
66950 0 : __Pyx_PyErr_Clear();
66951 0 : Py_INCREF(d);
66952 : return d;
66953 : }
66954 : #endif
66955 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
66956 0 : PyObject *r;
66957 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
66958 : int res = PyObject_GetOptionalAttr(o, n, &r);
66959 : return (res != 0) ? r : __Pyx_NewRef(d);
66960 : #else
66961 : #if CYTHON_USE_TYPE_SLOTS
66962 0 : if (likely(PyString_Check(n))) {
66963 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
66964 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
66965 0 : r = __Pyx_NewRef(d);
66966 : }
66967 0 : return r;
66968 : }
66969 : #endif
66970 0 : r = PyObject_GetAttr(o, n);
66971 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
66972 : #endif
66973 : }
66974 :
66975 : /* PyDictVersioning */
66976 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
66977 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
66978 : PyObject *dict = Py_TYPE(obj)->tp_dict;
66979 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
66980 : }
66981 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
66982 : PyObject **dictptr = NULL;
66983 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
66984 : if (offset) {
66985 : #if CYTHON_COMPILING_IN_CPYTHON
66986 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
66987 : #else
66988 : dictptr = _PyObject_GetDictPtr(obj);
66989 : #endif
66990 : }
66991 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
66992 : }
66993 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
66994 : PyObject *dict = Py_TYPE(obj)->tp_dict;
66995 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
66996 : return 0;
66997 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
66998 : }
66999 : #endif
67000 :
67001 : /* GetModuleGlobalName */
67002 : #if CYTHON_USE_DICT_VERSIONS
67003 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
67004 : #else
67005 9810 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
67006 : #endif
67007 : {
67008 9810 : PyObject *result;
67009 : #if !CYTHON_AVOID_BORROWED_REFS
67010 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
67011 9810 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
67012 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67013 9810 : if (likely(result)) {
67014 19620 : return __Pyx_NewRef(result);
67015 0 : } else if (unlikely(PyErr_Occurred())) {
67016 : return NULL;
67017 : }
67018 : #elif CYTHON_COMPILING_IN_LIMITED_API
67019 : if (unlikely(!__pyx_m)) {
67020 : return NULL;
67021 : }
67022 : result = PyObject_GetAttr(__pyx_m, name);
67023 : if (likely(result)) {
67024 : return result;
67025 : }
67026 : #else
67027 : result = PyDict_GetItem(__pyx_d, name);
67028 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67029 : if (likely(result)) {
67030 : return __Pyx_NewRef(result);
67031 : }
67032 : #endif
67033 : #else
67034 : result = PyObject_GetItem(__pyx_d, name);
67035 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67036 : if (likely(result)) {
67037 : return __Pyx_NewRef(result);
67038 : }
67039 : PyErr_Clear();
67040 : #endif
67041 0 : return __Pyx_GetBuiltinName(name);
67042 : }
67043 :
67044 : /* RaiseTooManyValuesToUnpack */
67045 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
67046 0 : PyErr_Format(PyExc_ValueError,
67047 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
67048 0 : }
67049 :
67050 : /* RaiseNeedMoreValuesToUnpack */
67051 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
67052 0 : PyErr_Format(PyExc_ValueError,
67053 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
67054 : index, (index == 1) ? "" : "s");
67055 0 : }
67056 :
67057 : /* RaiseNoneIterError */
67058 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
67059 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
67060 : }
67061 :
67062 : /* ExtTypeTest */
67063 1076 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
67064 1076 : __Pyx_TypeName obj_type_name;
67065 1076 : __Pyx_TypeName type_name;
67066 1076 : if (unlikely(!type)) {
67067 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
67068 0 : return 0;
67069 : }
67070 1076 : if (likely(__Pyx_TypeCheck(obj, type)))
67071 : return 1;
67072 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
67073 0 : type_name = __Pyx_PyType_GetName(type);
67074 0 : PyErr_Format(PyExc_TypeError,
67075 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
67076 : obj_type_name, type_name);
67077 0 : __Pyx_DECREF_TypeName(obj_type_name);
67078 0 : __Pyx_DECREF_TypeName(type_name);
67079 0 : return 0;
67080 : }
67081 :
67082 : /* GetTopmostException */
67083 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
67084 : static _PyErr_StackItem *
67085 15 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
67086 : {
67087 15 : _PyErr_StackItem *exc_info = tstate->exc_info;
67088 75 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
67089 75 : exc_info->previous_item != NULL)
67090 : {
67091 : exc_info = exc_info->previous_item;
67092 : }
67093 15 : return exc_info;
67094 : }
67095 : #endif
67096 :
67097 : /* SaveResetException */
67098 : #if CYTHON_FAST_THREAD_STATE
67099 15 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
67100 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
67101 15 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
67102 15 : PyObject *exc_value = exc_info->exc_value;
67103 15 : if (exc_value == NULL || exc_value == Py_None) {
67104 15 : *value = NULL;
67105 15 : *type = NULL;
67106 15 : *tb = NULL;
67107 : } else {
67108 0 : *value = exc_value;
67109 0 : Py_INCREF(*value);
67110 0 : *type = (PyObject*) Py_TYPE(exc_value);
67111 0 : Py_INCREF(*type);
67112 0 : *tb = PyException_GetTraceback(exc_value);
67113 : }
67114 : #elif CYTHON_USE_EXC_INFO_STACK
67115 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
67116 : *type = exc_info->exc_type;
67117 : *value = exc_info->exc_value;
67118 : *tb = exc_info->exc_traceback;
67119 : Py_XINCREF(*type);
67120 : Py_XINCREF(*value);
67121 : Py_XINCREF(*tb);
67122 : #else
67123 : *type = tstate->exc_type;
67124 : *value = tstate->exc_value;
67125 : *tb = tstate->exc_traceback;
67126 : Py_XINCREF(*type);
67127 : Py_XINCREF(*value);
67128 : Py_XINCREF(*tb);
67129 : #endif
67130 15 : }
67131 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
67132 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
67133 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
67134 0 : PyObject *tmp_value = exc_info->exc_value;
67135 0 : exc_info->exc_value = value;
67136 0 : Py_XDECREF(tmp_value);
67137 0 : Py_XDECREF(type);
67138 0 : Py_XDECREF(tb);
67139 : #else
67140 : PyObject *tmp_type, *tmp_value, *tmp_tb;
67141 : #if CYTHON_USE_EXC_INFO_STACK
67142 : _PyErr_StackItem *exc_info = tstate->exc_info;
67143 : tmp_type = exc_info->exc_type;
67144 : tmp_value = exc_info->exc_value;
67145 : tmp_tb = exc_info->exc_traceback;
67146 : exc_info->exc_type = type;
67147 : exc_info->exc_value = value;
67148 : exc_info->exc_traceback = tb;
67149 : #else
67150 : tmp_type = tstate->exc_type;
67151 : tmp_value = tstate->exc_value;
67152 : tmp_tb = tstate->exc_traceback;
67153 : tstate->exc_type = type;
67154 : tstate->exc_value = value;
67155 : tstate->exc_traceback = tb;
67156 : #endif
67157 : Py_XDECREF(tmp_type);
67158 : Py_XDECREF(tmp_value);
67159 : Py_XDECREF(tmp_tb);
67160 : #endif
67161 0 : }
67162 : #endif
67163 :
67164 : /* GetException */
67165 : #if CYTHON_FAST_THREAD_STATE
67166 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
67167 : #else
67168 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
67169 : #endif
67170 : {
67171 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
67172 : #if CYTHON_FAST_THREAD_STATE
67173 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
67174 : #if PY_VERSION_HEX >= 0x030C00A6
67175 0 : local_value = tstate->current_exception;
67176 0 : tstate->current_exception = 0;
67177 0 : if (likely(local_value)) {
67178 0 : local_type = (PyObject*) Py_TYPE(local_value);
67179 0 : Py_INCREF(local_type);
67180 0 : local_tb = PyException_GetTraceback(local_value);
67181 : }
67182 : #else
67183 : local_type = tstate->curexc_type;
67184 : local_value = tstate->curexc_value;
67185 : local_tb = tstate->curexc_traceback;
67186 : tstate->curexc_type = 0;
67187 : tstate->curexc_value = 0;
67188 : tstate->curexc_traceback = 0;
67189 : #endif
67190 : #else
67191 : PyErr_Fetch(&local_type, &local_value, &local_tb);
67192 : #endif
67193 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
67194 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
67195 0 : if (unlikely(tstate->current_exception))
67196 : #elif CYTHON_FAST_THREAD_STATE
67197 : if (unlikely(tstate->curexc_type))
67198 : #else
67199 : if (unlikely(PyErr_Occurred()))
67200 : #endif
67201 0 : goto bad;
67202 : #if PY_MAJOR_VERSION >= 3
67203 0 : if (local_tb) {
67204 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
67205 0 : goto bad;
67206 : }
67207 : #endif
67208 0 : Py_XINCREF(local_tb);
67209 0 : Py_XINCREF(local_type);
67210 0 : Py_XINCREF(local_value);
67211 0 : *type = local_type;
67212 0 : *value = local_value;
67213 0 : *tb = local_tb;
67214 : #if CYTHON_FAST_THREAD_STATE
67215 : #if CYTHON_USE_EXC_INFO_STACK
67216 : {
67217 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
67218 : #if PY_VERSION_HEX >= 0x030B00a4
67219 0 : tmp_value = exc_info->exc_value;
67220 0 : exc_info->exc_value = local_value;
67221 0 : tmp_type = NULL;
67222 0 : tmp_tb = NULL;
67223 0 : Py_XDECREF(local_type);
67224 0 : Py_XDECREF(local_tb);
67225 : #else
67226 : tmp_type = exc_info->exc_type;
67227 : tmp_value = exc_info->exc_value;
67228 : tmp_tb = exc_info->exc_traceback;
67229 : exc_info->exc_type = local_type;
67230 : exc_info->exc_value = local_value;
67231 : exc_info->exc_traceback = local_tb;
67232 : #endif
67233 : }
67234 : #else
67235 : tmp_type = tstate->exc_type;
67236 : tmp_value = tstate->exc_value;
67237 : tmp_tb = tstate->exc_traceback;
67238 : tstate->exc_type = local_type;
67239 : tstate->exc_value = local_value;
67240 : tstate->exc_traceback = local_tb;
67241 : #endif
67242 0 : Py_XDECREF(tmp_type);
67243 0 : Py_XDECREF(tmp_value);
67244 0 : Py_XDECREF(tmp_tb);
67245 : #else
67246 : PyErr_SetExcInfo(local_type, local_value, local_tb);
67247 : #endif
67248 0 : return 0;
67249 0 : bad:
67250 0 : *type = 0;
67251 0 : *value = 0;
67252 0 : *tb = 0;
67253 0 : Py_XDECREF(local_type);
67254 0 : Py_XDECREF(local_value);
67255 0 : Py_XDECREF(local_tb);
67256 0 : return -1;
67257 : }
67258 :
67259 : /* SwapException */
67260 : #if CYTHON_FAST_THREAD_STATE
67261 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
67262 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
67263 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
67264 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
67265 0 : tmp_value = exc_info->exc_value;
67266 0 : exc_info->exc_value = *value;
67267 0 : if (tmp_value == NULL || tmp_value == Py_None) {
67268 0 : Py_XDECREF(tmp_value);
67269 0 : tmp_value = NULL;
67270 0 : tmp_type = NULL;
67271 0 : tmp_tb = NULL;
67272 : } else {
67273 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
67274 0 : Py_INCREF(tmp_type);
67275 : #if CYTHON_COMPILING_IN_CPYTHON
67276 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
67277 0 : Py_XINCREF(tmp_tb);
67278 : #else
67279 : tmp_tb = PyException_GetTraceback(tmp_value);
67280 : #endif
67281 : }
67282 : #elif CYTHON_USE_EXC_INFO_STACK
67283 : _PyErr_StackItem *exc_info = tstate->exc_info;
67284 : tmp_type = exc_info->exc_type;
67285 : tmp_value = exc_info->exc_value;
67286 : tmp_tb = exc_info->exc_traceback;
67287 : exc_info->exc_type = *type;
67288 : exc_info->exc_value = *value;
67289 : exc_info->exc_traceback = *tb;
67290 : #else
67291 : tmp_type = tstate->exc_type;
67292 : tmp_value = tstate->exc_value;
67293 : tmp_tb = tstate->exc_traceback;
67294 : tstate->exc_type = *type;
67295 : tstate->exc_value = *value;
67296 : tstate->exc_traceback = *tb;
67297 : #endif
67298 0 : *type = tmp_type;
67299 0 : *value = tmp_value;
67300 0 : *tb = tmp_tb;
67301 0 : }
67302 : #else
67303 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
67304 : PyObject *tmp_type, *tmp_value, *tmp_tb;
67305 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
67306 : PyErr_SetExcInfo(*type, *value, *tb);
67307 : *type = tmp_type;
67308 : *value = tmp_value;
67309 : *tb = tmp_tb;
67310 : }
67311 : #endif
67312 :
67313 : /* Import */
67314 9 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
67315 9 : PyObject *module = 0;
67316 9 : PyObject *empty_dict = 0;
67317 9 : PyObject *empty_list = 0;
67318 : #if PY_MAJOR_VERSION < 3
67319 : PyObject *py_import;
67320 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
67321 : if (unlikely(!py_import))
67322 : goto bad;
67323 : if (!from_list) {
67324 : empty_list = PyList_New(0);
67325 : if (unlikely(!empty_list))
67326 : goto bad;
67327 : from_list = empty_list;
67328 : }
67329 : #endif
67330 9 : empty_dict = PyDict_New();
67331 9 : if (unlikely(!empty_dict))
67332 0 : goto bad;
67333 : {
67334 : #if PY_MAJOR_VERSION >= 3
67335 9 : if (level == -1) {
67336 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
67337 0 : module = PyImport_ImportModuleLevelObject(
67338 0 : name, __pyx_d, empty_dict, from_list, 1);
67339 0 : if (unlikely(!module)) {
67340 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
67341 0 : goto bad;
67342 0 : PyErr_Clear();
67343 : }
67344 : }
67345 0 : level = 0;
67346 : }
67347 : #endif
67348 0 : if (!module) {
67349 : #if PY_MAJOR_VERSION < 3
67350 : PyObject *py_level = PyInt_FromLong(level);
67351 : if (unlikely(!py_level))
67352 : goto bad;
67353 : module = PyObject_CallFunctionObjArgs(py_import,
67354 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
67355 : Py_DECREF(py_level);
67356 : #else
67357 9 : module = PyImport_ImportModuleLevelObject(
67358 9 : name, __pyx_d, empty_dict, from_list, level);
67359 : #endif
67360 : }
67361 : }
67362 9 : bad:
67363 9 : Py_XDECREF(empty_dict);
67364 9 : Py_XDECREF(empty_list);
67365 : #if PY_MAJOR_VERSION < 3
67366 : Py_XDECREF(py_import);
67367 : #endif
67368 9 : return module;
67369 : }
67370 :
67371 : /* ImportDottedModule */
67372 : #if PY_MAJOR_VERSION >= 3
67373 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
67374 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
67375 0 : if (unlikely(PyErr_Occurred())) {
67376 0 : PyErr_Clear();
67377 : }
67378 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
67379 : partial_name = name;
67380 : } else {
67381 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
67382 0 : if (unlikely(!slice))
67383 0 : goto bad;
67384 0 : sep = PyUnicode_FromStringAndSize(".", 1);
67385 0 : if (unlikely(!sep))
67386 0 : goto bad;
67387 0 : partial_name = PyUnicode_Join(sep, slice);
67388 : }
67389 0 : PyErr_Format(
67390 : #if PY_MAJOR_VERSION < 3
67391 : PyExc_ImportError,
67392 : "No module named '%s'", PyString_AS_STRING(partial_name));
67393 : #else
67394 : #if PY_VERSION_HEX >= 0x030600B1
67395 : PyExc_ModuleNotFoundError,
67396 : #else
67397 : PyExc_ImportError,
67398 : #endif
67399 : "No module named '%U'", partial_name);
67400 : #endif
67401 0 : bad:
67402 0 : Py_XDECREF(sep);
67403 0 : Py_XDECREF(slice);
67404 0 : Py_XDECREF(partial_name);
67405 0 : return NULL;
67406 : }
67407 : #endif
67408 : #if PY_MAJOR_VERSION >= 3
67409 6 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
67410 6 : PyObject *imported_module;
67411 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
67412 : PyObject *modules = PyImport_GetModuleDict();
67413 : if (unlikely(!modules))
67414 : return NULL;
67415 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
67416 : Py_XINCREF(imported_module);
67417 : #else
67418 12 : imported_module = PyImport_GetModule(name);
67419 : #endif
67420 6 : return imported_module;
67421 : }
67422 : #endif
67423 : #if PY_MAJOR_VERSION >= 3
67424 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
67425 0 : Py_ssize_t i, nparts;
67426 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
67427 0 : for (i=1; i < nparts && module; i++) {
67428 0 : PyObject *part, *submodule;
67429 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
67430 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
67431 : #else
67432 : part = PySequence_ITEM(parts_tuple, i);
67433 : #endif
67434 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
67435 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
67436 : Py_DECREF(part);
67437 : #endif
67438 0 : Py_DECREF(module);
67439 0 : module = submodule;
67440 : }
67441 0 : if (unlikely(!module)) {
67442 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
67443 : }
67444 : return module;
67445 : }
67446 : #endif
67447 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
67448 : #if PY_MAJOR_VERSION < 3
67449 : PyObject *module, *from_list, *star = __pyx_n_s__3;
67450 : CYTHON_UNUSED_VAR(parts_tuple);
67451 : from_list = PyList_New(1);
67452 : if (unlikely(!from_list))
67453 : return NULL;
67454 : Py_INCREF(star);
67455 : PyList_SET_ITEM(from_list, 0, star);
67456 : module = __Pyx_Import(name, from_list, 0);
67457 : Py_DECREF(from_list);
67458 : return module;
67459 : #else
67460 0 : PyObject *imported_module;
67461 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
67462 0 : if (!parts_tuple || unlikely(!module))
67463 : return module;
67464 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
67465 0 : if (likely(imported_module)) {
67466 0 : Py_DECREF(module);
67467 0 : return imported_module;
67468 : }
67469 0 : PyErr_Clear();
67470 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
67471 : #endif
67472 : }
67473 6 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
67474 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
67475 6 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
67476 6 : if (likely(module)) {
67477 6 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
67478 6 : if (likely(spec)) {
67479 6 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
67480 6 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
67481 6 : Py_DECREF(spec);
67482 : spec = NULL;
67483 : }
67484 6 : Py_XDECREF(unsafe);
67485 : }
67486 6 : if (likely(!spec)) {
67487 6 : PyErr_Clear();
67488 6 : return module;
67489 : }
67490 0 : Py_DECREF(spec);
67491 0 : Py_DECREF(module);
67492 0 : } else if (PyErr_Occurred()) {
67493 0 : PyErr_Clear();
67494 : }
67495 : #endif
67496 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
67497 : }
67498 :
67499 : /* FastTypeChecks */
67500 : #if CYTHON_COMPILING_IN_CPYTHON
67501 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
67502 0 : while (a) {
67503 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
67504 0 : if (a == b)
67505 : return 1;
67506 : }
67507 0 : return b == &PyBaseObject_Type;
67508 : }
67509 1295 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
67510 1295 : PyObject *mro;
67511 1295 : if (a == b) return 1;
67512 219 : mro = a->tp_mro;
67513 219 : if (likely(mro)) {
67514 219 : Py_ssize_t i, n;
67515 219 : n = PyTuple_GET_SIZE(mro);
67516 657 : for (i = 0; i < n; i++) {
67517 438 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
67518 : return 1;
67519 : }
67520 : return 0;
67521 : }
67522 1295 : return __Pyx_InBases(a, b);
67523 : }
67524 5012 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
67525 5012 : PyObject *mro;
67526 5012 : if (cls == a || cls == b) return 1;
67527 2786 : mro = cls->tp_mro;
67528 2786 : if (likely(mro)) {
67529 2786 : Py_ssize_t i, n;
67530 2786 : n = PyTuple_GET_SIZE(mro);
67531 8358 : for (i = 0; i < n; i++) {
67532 5572 : PyObject *base = PyTuple_GET_ITEM(mro, i);
67533 5572 : if (base == (PyObject *)a || base == (PyObject *)b)
67534 : return 1;
67535 : }
67536 : return 0;
67537 : }
67538 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
67539 : }
67540 : #if PY_MAJOR_VERSION == 2
67541 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
67542 : PyObject *exception, *value, *tb;
67543 : int res;
67544 : __Pyx_PyThreadState_declare
67545 : __Pyx_PyThreadState_assign
67546 : __Pyx_ErrFetch(&exception, &value, &tb);
67547 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
67548 : if (unlikely(res == -1)) {
67549 : PyErr_WriteUnraisable(err);
67550 : res = 0;
67551 : }
67552 : if (!res) {
67553 : res = PyObject_IsSubclass(err, exc_type2);
67554 : if (unlikely(res == -1)) {
67555 : PyErr_WriteUnraisable(err);
67556 : res = 0;
67557 : }
67558 : }
67559 : __Pyx_ErrRestore(exception, value, tb);
67560 : return res;
67561 : }
67562 : #else
67563 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
67564 0 : if (exc_type1) {
67565 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
67566 : } else {
67567 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
67568 : }
67569 : }
67570 : #endif
67571 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
67572 0 : Py_ssize_t i, n;
67573 0 : assert(PyExceptionClass_Check(exc_type));
67574 0 : n = PyTuple_GET_SIZE(tuple);
67575 : #if PY_MAJOR_VERSION >= 3
67576 0 : for (i=0; i<n; i++) {
67577 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
67578 : }
67579 : #endif
67580 0 : for (i=0; i<n; i++) {
67581 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
67582 : #if PY_MAJOR_VERSION < 3
67583 : if (likely(exc_type == t)) return 1;
67584 : #endif
67585 0 : if (likely(PyExceptionClass_Check(t))) {
67586 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
67587 : } else {
67588 0 : }
67589 : }
67590 : return 0;
67591 : }
67592 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
67593 0 : if (likely(err == exc_type)) return 1;
67594 0 : if (likely(PyExceptionClass_Check(err))) {
67595 0 : if (likely(PyExceptionClass_Check(exc_type))) {
67596 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
67597 0 : } else if (likely(PyTuple_Check(exc_type))) {
67598 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
67599 : } else {
67600 0 : }
67601 : }
67602 0 : return PyErr_GivenExceptionMatches(err, exc_type);
67603 : }
67604 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
67605 : assert(PyExceptionClass_Check(exc_type1));
67606 : assert(PyExceptionClass_Check(exc_type2));
67607 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
67608 : if (likely(PyExceptionClass_Check(err))) {
67609 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
67610 : }
67611 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
67612 : }
67613 : #endif
67614 :
67615 : /* PySequenceMultiply */
67616 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
67617 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
67618 0 : if (unlikely(!pymul))
67619 : return NULL;
67620 0 : result = PyNumber_Multiply(seq, pymul);
67621 0 : Py_DECREF(pymul);
67622 : return result;
67623 : }
67624 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
67625 : #if CYTHON_USE_TYPE_SLOTS
67626 0 : PyTypeObject *type = Py_TYPE(seq);
67627 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
67628 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
67629 : } else
67630 : #endif
67631 : {
67632 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
67633 : }
67634 : }
67635 :
67636 : /* SetItemInt */
67637 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
67638 0 : int r;
67639 0 : if (unlikely(!j)) return -1;
67640 0 : r = PyObject_SetItem(o, j, v);
67641 0 : Py_DECREF(j);
67642 : return r;
67643 : }
67644 22730 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
67645 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
67646 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
67647 22730 : if (is_list || PyList_CheckExact(o)) {
67648 0 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
67649 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
67650 0 : PyObject* old = PyList_GET_ITEM(o, n);
67651 0 : Py_INCREF(v);
67652 0 : PyList_SET_ITEM(o, n, v);
67653 0 : Py_DECREF(old);
67654 0 : return 1;
67655 : }
67656 : } else {
67657 22730 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
67658 22730 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
67659 22730 : if (mm && mm->mp_ass_subscript) {
67660 22730 : int r;
67661 22730 : PyObject *key = PyInt_FromSsize_t(i);
67662 22730 : if (unlikely(!key)) return -1;
67663 22730 : r = mm->mp_ass_subscript(o, key, v);
67664 22730 : Py_DECREF(key);
67665 22730 : return r;
67666 : }
67667 0 : if (likely(sm && sm->sq_ass_item)) {
67668 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
67669 0 : Py_ssize_t l = sm->sq_length(o);
67670 0 : if (likely(l >= 0)) {
67671 0 : i += l;
67672 : } else {
67673 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
67674 : return -1;
67675 0 : PyErr_Clear();
67676 : }
67677 : }
67678 0 : return sm->sq_ass_item(o, i, v);
67679 : }
67680 : }
67681 : #else
67682 : if (is_list || !PyMapping_Check(o))
67683 : {
67684 : return PySequence_SetItem(o, i, v);
67685 : }
67686 : #endif
67687 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
67688 : }
67689 :
67690 : /* RaiseUnboundLocalError */
67691 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
67692 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
67693 : }
67694 :
67695 : /* DivInt[long] */
67696 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
67697 0 : long q = a / b;
67698 0 : long r = a - q*b;
67699 0 : q -= ((r != 0) & ((r ^ b) < 0));
67700 0 : return q;
67701 : }
67702 :
67703 : /* ImportFrom */
67704 12 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
67705 12 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
67706 12 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
67707 0 : const char* module_name_str = 0;
67708 0 : PyObject* module_name = 0;
67709 0 : PyObject* module_dot = 0;
67710 0 : PyObject* full_name = 0;
67711 0 : PyErr_Clear();
67712 0 : module_name_str = PyModule_GetName(module);
67713 0 : if (unlikely(!module_name_str)) { goto modbad; }
67714 0 : module_name = PyUnicode_FromString(module_name_str);
67715 0 : if (unlikely(!module_name)) { goto modbad; }
67716 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
67717 0 : if (unlikely(!module_dot)) { goto modbad; }
67718 0 : full_name = PyUnicode_Concat(module_dot, name);
67719 0 : if (unlikely(!full_name)) { goto modbad; }
67720 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
67721 : {
67722 : PyObject *modules = PyImport_GetModuleDict();
67723 : if (unlikely(!modules))
67724 : goto modbad;
67725 : value = PyObject_GetItem(modules, full_name);
67726 : }
67727 : #else
67728 0 : value = PyImport_GetModule(full_name);
67729 : #endif
67730 0 : modbad:
67731 0 : Py_XDECREF(full_name);
67732 0 : Py_XDECREF(module_dot);
67733 0 : Py_XDECREF(module_name);
67734 : }
67735 12 : if (unlikely(!value)) {
67736 0 : PyErr_Format(PyExc_ImportError,
67737 : #if PY_MAJOR_VERSION < 3
67738 : "cannot import name %.230s", PyString_AS_STRING(name));
67739 : #else
67740 : "cannot import name %S", name);
67741 : #endif
67742 : }
67743 12 : return value;
67744 : }
67745 :
67746 : /* HasAttr */
67747 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
67748 0 : PyObject *r;
67749 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
67750 0 : PyErr_SetString(PyExc_TypeError,
67751 : "hasattr(): attribute name must be string");
67752 0 : return -1;
67753 : }
67754 0 : r = __Pyx_GetAttr(o, n);
67755 0 : if (!r) {
67756 0 : PyErr_Clear();
67757 0 : return 0;
67758 : } else {
67759 0 : Py_DECREF(r);
67760 0 : return 1;
67761 : }
67762 : }
67763 :
67764 : /* RaiseKeywordRequired */
67765 0 : static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) {
67766 0 : PyErr_Format(PyExc_TypeError,
67767 : #if PY_MAJOR_VERSION >= 3
67768 : "%s() needs keyword-only argument %U", func_name, kw_name);
67769 : #else
67770 : "%s() needs keyword-only argument %s", func_name,
67771 : PyString_AS_STRING(kw_name));
67772 : #endif
67773 : }
67774 :
67775 : /* IsLittleEndian */
67776 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
67777 : {
67778 0 : union {
67779 : uint32_t u32;
67780 : uint8_t u8[4];
67781 : } S;
67782 0 : S.u32 = 0x01020304;
67783 0 : return S.u8[0] == 4;
67784 : }
67785 :
67786 : /* BufferFormatCheck */
67787 1264 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
67788 : __Pyx_BufFmt_StackElem* stack,
67789 : __Pyx_TypeInfo* type) {
67790 1264 : stack[0].field = &ctx->root;
67791 1264 : stack[0].parent_offset = 0;
67792 1264 : ctx->root.type = type;
67793 1264 : ctx->root.name = "buffer dtype";
67794 1264 : ctx->root.offset = 0;
67795 1264 : ctx->head = stack;
67796 1264 : ctx->head->field = &ctx->root;
67797 1264 : ctx->fmt_offset = 0;
67798 1264 : ctx->head->parent_offset = 0;
67799 1264 : ctx->new_packmode = '@';
67800 1264 : ctx->enc_packmode = '@';
67801 1264 : ctx->new_count = 1;
67802 1264 : ctx->enc_count = 0;
67803 1264 : ctx->enc_type = 0;
67804 1264 : ctx->is_complex = 0;
67805 1264 : ctx->is_valid_array = 0;
67806 1264 : ctx->struct_alignment = 0;
67807 1264 : while (type->typegroup == 'S') {
67808 0 : ++ctx->head;
67809 0 : ctx->head->field = type->fields;
67810 0 : ctx->head->parent_offset = 0;
67811 0 : type = type->fields->type;
67812 : }
67813 1264 : }
67814 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
67815 0 : int count;
67816 0 : const char* t = *ts;
67817 0 : if (*t < '0' || *t > '9') {
67818 : return -1;
67819 : } else {
67820 0 : count = *t++ - '0';
67821 0 : while (*t >= '0' && *t <= '9') {
67822 0 : count *= 10;
67823 0 : count += *t++ - '0';
67824 : }
67825 : }
67826 0 : *ts = t;
67827 0 : return count;
67828 : }
67829 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
67830 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
67831 0 : if (number == -1)
67832 0 : PyErr_Format(PyExc_ValueError,\
67833 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
67834 0 : return number;
67835 : }
67836 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
67837 0 : PyErr_Format(PyExc_ValueError,
67838 : "Unexpected format string character: '%c'", ch);
67839 : }
67840 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
67841 0 : switch (ch) {
67842 : case '?': return "'bool'";
67843 0 : case 'c': return "'char'";
67844 0 : case 'b': return "'signed char'";
67845 0 : case 'B': return "'unsigned char'";
67846 0 : case 'h': return "'short'";
67847 0 : case 'H': return "'unsigned short'";
67848 0 : case 'i': return "'int'";
67849 0 : case 'I': return "'unsigned int'";
67850 0 : case 'l': return "'long'";
67851 0 : case 'L': return "'unsigned long'";
67852 0 : case 'q': return "'long long'";
67853 0 : case 'Q': return "'unsigned long long'";
67854 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
67855 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
67856 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
67857 0 : case 'T': return "a struct";
67858 0 : case 'O': return "Python object";
67859 0 : case 'P': return "a pointer";
67860 0 : case 's': case 'p': return "a string";
67861 0 : case 0: return "end";
67862 0 : default: return "unparsable format string";
67863 : }
67864 : }
67865 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
67866 0 : switch (ch) {
67867 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
67868 0 : case 'h': case 'H': return 2;
67869 : case 'i': case 'I': case 'l': case 'L': return 4;
67870 : case 'q': case 'Q': return 8;
67871 0 : case 'f': return (is_complex ? 8 : 4);
67872 0 : case 'd': return (is_complex ? 16 : 8);
67873 0 : case 'g': {
67874 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
67875 0 : return 0;
67876 : }
67877 : case 'O': case 'P': return sizeof(void*);
67878 0 : default:
67879 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
67880 0 : return 0;
67881 : }
67882 : }
67883 1264 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
67884 1264 : switch (ch) {
67885 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
67886 0 : case 'h': case 'H': return sizeof(short);
67887 : case 'i': case 'I': return sizeof(int);
67888 : case 'l': case 'L': return sizeof(long);
67889 : #ifdef HAVE_LONG_LONG
67890 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
67891 : #endif
67892 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
67893 1138 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
67894 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
67895 : case 'O': case 'P': return sizeof(void*);
67896 0 : default: {
67897 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
67898 0 : return 0;
67899 : }
67900 : }
67901 : }
67902 : typedef struct { char c; short x; } __Pyx_st_short;
67903 : typedef struct { char c; int x; } __Pyx_st_int;
67904 : typedef struct { char c; long x; } __Pyx_st_long;
67905 : typedef struct { char c; float x; } __Pyx_st_float;
67906 : typedef struct { char c; double x; } __Pyx_st_double;
67907 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
67908 : typedef struct { char c; void *x; } __Pyx_st_void_p;
67909 : #ifdef HAVE_LONG_LONG
67910 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
67911 : #endif
67912 1264 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
67913 1264 : CYTHON_UNUSED_VAR(is_complex);
67914 1264 : switch (ch) {
67915 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
67916 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
67917 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
67918 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
67919 : #ifdef HAVE_LONG_LONG
67920 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
67921 : #endif
67922 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
67923 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
67924 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
67925 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
67926 0 : default:
67927 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
67928 0 : return 0;
67929 : }
67930 : }
67931 : /* These are for computing the padding at the end of the struct to align
67932 : on the first member of the struct. This will probably the same as above,
67933 : but we don't have any guarantees.
67934 : */
67935 : typedef struct { short x; char c; } __Pyx_pad_short;
67936 : typedef struct { int x; char c; } __Pyx_pad_int;
67937 : typedef struct { long x; char c; } __Pyx_pad_long;
67938 : typedef struct { float x; char c; } __Pyx_pad_float;
67939 : typedef struct { double x; char c; } __Pyx_pad_double;
67940 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
67941 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
67942 : #ifdef HAVE_LONG_LONG
67943 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
67944 : #endif
67945 1264 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
67946 1264 : CYTHON_UNUSED_VAR(is_complex);
67947 1264 : switch (ch) {
67948 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
67949 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
67950 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
67951 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
67952 : #ifdef HAVE_LONG_LONG
67953 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
67954 : #endif
67955 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
67956 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
67957 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
67958 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
67959 0 : default:
67960 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
67961 0 : return 0;
67962 : }
67963 : }
67964 1264 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
67965 1264 : switch (ch) {
67966 : case 'c':
67967 : return 'H';
67968 126 : case 'b': case 'h': case 'i':
67969 : case 'l': case 'q': case 's': case 'p':
67970 126 : return 'I';
67971 0 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
67972 0 : return 'U';
67973 1138 : case 'f': case 'd': case 'g':
67974 1138 : return (is_complex ? 'C' : 'R');
67975 0 : case 'O':
67976 0 : return 'O';
67977 0 : case 'P':
67978 0 : return 'P';
67979 0 : default: {
67980 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
67981 0 : return 0;
67982 : }
67983 : }
67984 : }
67985 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
67986 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
67987 0 : const char* expected;
67988 0 : const char* quote;
67989 0 : if (ctx->head == NULL) {
67990 : expected = "end";
67991 : quote = "";
67992 : } else {
67993 0 : expected = ctx->head->field->type->name;
67994 0 : quote = "'";
67995 : }
67996 0 : PyErr_Format(PyExc_ValueError,
67997 : "Buffer dtype mismatch, expected %s%s%s but got %s",
67998 : quote, expected, quote,
67999 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
68000 : } else {
68001 0 : __Pyx_StructField* field = ctx->head->field;
68002 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
68003 0 : PyErr_Format(PyExc_ValueError,
68004 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
68005 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
68006 0 : parent->type->name, field->name);
68007 : }
68008 0 : }
68009 2528 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
68010 2528 : char group;
68011 2528 : size_t size, offset, arraysize = 1;
68012 2528 : if (ctx->enc_type == 0) return 0;
68013 1264 : if (ctx->head->field->type->arraysize[0]) {
68014 0 : int i, ndim = 0;
68015 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
68016 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
68017 0 : ndim = 1;
68018 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
68019 0 : PyErr_Format(PyExc_ValueError,
68020 : "Expected a dimension of size %zu, got %zu",
68021 : ctx->head->field->type->arraysize[0], ctx->enc_count);
68022 0 : return -1;
68023 : }
68024 : }
68025 0 : if (!ctx->is_valid_array) {
68026 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
68027 : ctx->head->field->type->ndim, ndim);
68028 0 : return -1;
68029 : }
68030 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
68031 0 : arraysize *= ctx->head->field->type->arraysize[i];
68032 : }
68033 0 : ctx->is_valid_array = 0;
68034 0 : ctx->enc_count = 1;
68035 : }
68036 1264 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
68037 1264 : do {
68038 1264 : __Pyx_StructField* field = ctx->head->field;
68039 1264 : __Pyx_TypeInfo* type = field->type;
68040 1264 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
68041 1264 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
68042 : } else {
68043 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
68044 : }
68045 1264 : if (ctx->enc_packmode == '@') {
68046 1264 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
68047 1264 : size_t align_mod_offset;
68048 1264 : if (align_at == 0) return -1;
68049 1264 : align_mod_offset = ctx->fmt_offset % align_at;
68050 1264 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
68051 1264 : if (ctx->struct_alignment == 0)
68052 1264 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
68053 : ctx->is_complex);
68054 : }
68055 1264 : if (type->size != size || type->typegroup != group) {
68056 0 : if (type->typegroup == 'C' && type->fields != NULL) {
68057 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
68058 0 : ++ctx->head;
68059 0 : ctx->head->field = type->fields;
68060 0 : ctx->head->parent_offset = parent_offset;
68061 0 : continue;
68062 : }
68063 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
68064 : } else {
68065 0 : __Pyx_BufFmt_RaiseExpected(ctx);
68066 0 : return -1;
68067 : }
68068 : }
68069 1264 : offset = ctx->head->parent_offset + field->offset;
68070 1264 : if (ctx->fmt_offset != offset) {
68071 0 : PyErr_Format(PyExc_ValueError,
68072 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
68073 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
68074 0 : return -1;
68075 : }
68076 1264 : ctx->fmt_offset += size;
68077 1264 : if (arraysize)
68078 1264 : ctx->fmt_offset += (arraysize - 1) * size;
68079 1264 : --ctx->enc_count;
68080 1264 : while (1) {
68081 1264 : if (field == &ctx->root) {
68082 1264 : ctx->head = NULL;
68083 1264 : if (ctx->enc_count != 0) {
68084 0 : __Pyx_BufFmt_RaiseExpected(ctx);
68085 0 : return -1;
68086 : }
68087 : break;
68088 : }
68089 0 : ctx->head->field = ++field;
68090 0 : if (field->type == NULL) {
68091 0 : --ctx->head;
68092 0 : field = ctx->head->field;
68093 0 : continue;
68094 0 : } else if (field->type->typegroup == 'S') {
68095 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
68096 0 : if (field->type->fields->type == NULL) continue;
68097 0 : field = field->type->fields;
68098 0 : ++ctx->head;
68099 0 : ctx->head->field = field;
68100 0 : ctx->head->parent_offset = parent_offset;
68101 0 : break;
68102 : } else {
68103 : break;
68104 : }
68105 : }
68106 1264 : } while (ctx->enc_count);
68107 1264 : ctx->enc_type = 0;
68108 1264 : ctx->is_complex = 0;
68109 1264 : return 0;
68110 : }
68111 : static int
68112 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
68113 : {
68114 0 : const char *ts = *tsp;
68115 0 : int i = 0, number, ndim;
68116 0 : ++ts;
68117 0 : if (ctx->new_count != 1) {
68118 0 : PyErr_SetString(PyExc_ValueError,
68119 : "Cannot handle repeated arrays in format string");
68120 0 : return -1;
68121 : }
68122 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
68123 0 : ndim = ctx->head->field->type->ndim;
68124 0 : while (*ts && *ts != ')') {
68125 0 : switch (*ts) {
68126 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
68127 0 : default: break;
68128 : }
68129 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
68130 0 : if (number == -1) return -1;
68131 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
68132 0 : PyErr_Format(PyExc_ValueError,
68133 : "Expected a dimension of size %zu, got %d",
68134 : ctx->head->field->type->arraysize[i], number);
68135 0 : return -1;
68136 : }
68137 0 : if (*ts != ',' && *ts != ')') {
68138 0 : PyErr_Format(PyExc_ValueError,
68139 : "Expected a comma in format string, got '%c'", *ts);
68140 0 : return -1;
68141 : }
68142 0 : if (*ts == ',') ts++;
68143 0 : i++;
68144 : }
68145 0 : if (i != ndim) {
68146 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
68147 0 : ctx->head->field->type->ndim, i);
68148 0 : return -1;
68149 : }
68150 0 : if (!*ts) {
68151 0 : PyErr_SetString(PyExc_ValueError,
68152 : "Unexpected end of format string, expected ')'");
68153 0 : return -1;
68154 : }
68155 0 : ctx->is_valid_array = 1;
68156 0 : ctx->new_count = 1;
68157 0 : *tsp = ++ts;
68158 0 : return 0;
68159 : }
68160 1264 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
68161 1264 : int got_Z = 0;
68162 2528 : while (1) {
68163 2528 : switch(*ts) {
68164 1264 : case 0:
68165 1264 : if (ctx->enc_type != 0 && ctx->head == NULL) {
68166 0 : __Pyx_BufFmt_RaiseExpected(ctx);
68167 0 : return NULL;
68168 : }
68169 1264 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
68170 1264 : if (ctx->head != NULL) {
68171 0 : __Pyx_BufFmt_RaiseExpected(ctx);
68172 0 : return NULL;
68173 : }
68174 : return ts;
68175 0 : case ' ':
68176 : case '\r':
68177 : case '\n':
68178 0 : ++ts;
68179 0 : break;
68180 : case '<':
68181 0 : if (!__Pyx_Is_Little_Endian()) {
68182 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
68183 : return NULL;
68184 : }
68185 0 : ctx->new_packmode = '=';
68186 0 : ++ts;
68187 0 : break;
68188 : case '>':
68189 : case '!':
68190 0 : if (__Pyx_Is_Little_Endian()) {
68191 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
68192 0 : return NULL;
68193 : }
68194 : ctx->new_packmode = '=';
68195 : ++ts;
68196 : break;
68197 0 : case '=':
68198 : case '@':
68199 : case '^':
68200 0 : ctx->new_packmode = *ts++;
68201 0 : break;
68202 0 : case 'T':
68203 : {
68204 0 : const char* ts_after_sub;
68205 0 : size_t i, struct_count = ctx->new_count;
68206 0 : size_t struct_alignment = ctx->struct_alignment;
68207 0 : ctx->new_count = 1;
68208 0 : ++ts;
68209 0 : if (*ts != '{') {
68210 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
68211 0 : return NULL;
68212 : }
68213 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
68214 0 : ctx->enc_type = 0;
68215 0 : ctx->enc_count = 0;
68216 0 : ctx->struct_alignment = 0;
68217 0 : ++ts;
68218 0 : ts_after_sub = ts;
68219 0 : for (i = 0; i != struct_count; ++i) {
68220 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
68221 0 : if (!ts_after_sub) return NULL;
68222 : }
68223 0 : ts = ts_after_sub;
68224 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
68225 : }
68226 : break;
68227 0 : case '}':
68228 : {
68229 0 : size_t alignment = ctx->struct_alignment;
68230 0 : ++ts;
68231 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
68232 0 : ctx->enc_type = 0;
68233 0 : if (alignment && ctx->fmt_offset % alignment) {
68234 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
68235 : }
68236 : }
68237 : return ts;
68238 0 : case 'x':
68239 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
68240 0 : ctx->fmt_offset += ctx->new_count;
68241 0 : ctx->new_count = 1;
68242 0 : ctx->enc_count = 0;
68243 0 : ctx->enc_type = 0;
68244 0 : ctx->enc_packmode = ctx->new_packmode;
68245 0 : ++ts;
68246 0 : break;
68247 541 : case 'Z':
68248 541 : got_Z = 1;
68249 541 : ++ts;
68250 541 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
68251 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
68252 0 : return NULL;
68253 : }
68254 1264 : CYTHON_FALLTHROUGH;
68255 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
68256 : case 'l': case 'L': case 'q': case 'Q':
68257 : case 'f': case 'd': case 'g':
68258 : case 'O': case 'p':
68259 1264 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
68260 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
68261 0 : ctx->enc_count += ctx->new_count;
68262 0 : ctx->new_count = 1;
68263 0 : got_Z = 0;
68264 0 : ++ts;
68265 0 : break;
68266 : }
68267 1264 : CYTHON_FALLTHROUGH;
68268 : case 's':
68269 1264 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
68270 1264 : ctx->enc_count = ctx->new_count;
68271 1264 : ctx->enc_packmode = ctx->new_packmode;
68272 1264 : ctx->enc_type = *ts;
68273 1264 : ctx->is_complex = got_Z;
68274 1264 : ++ts;
68275 1264 : ctx->new_count = 1;
68276 1264 : got_Z = 0;
68277 1264 : break;
68278 0 : case ':':
68279 0 : ++ts;
68280 0 : while(*ts != ':') ++ts;
68281 0 : ++ts;
68282 0 : break;
68283 0 : case '(':
68284 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
68285 : break;
68286 0 : default:
68287 : {
68288 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
68289 0 : if (number == -1) return NULL;
68290 0 : ctx->new_count = (size_t)number;
68291 : }
68292 : }
68293 : }
68294 : }
68295 :
68296 : /* BufferGetAndValidate */
68297 1513 : static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
68298 1513 : if (unlikely(info->buf == NULL)) return;
68299 1045 : if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
68300 1045 : __Pyx_ReleaseBuffer(info);
68301 : }
68302 0 : static void __Pyx_ZeroBuffer(Py_buffer* buf) {
68303 0 : buf->buf = NULL;
68304 0 : buf->obj = NULL;
68305 0 : buf->strides = __Pyx_zeros;
68306 0 : buf->shape = __Pyx_zeros;
68307 0 : buf->suboffsets = __Pyx_minusones;
68308 : }
68309 1045 : static int __Pyx__GetBufferAndValidate(
68310 : Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
68311 : int nd, int cast, __Pyx_BufFmt_StackElem* stack)
68312 : {
68313 1045 : buf->buf = NULL;
68314 1045 : if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
68315 0 : __Pyx_ZeroBuffer(buf);
68316 0 : return -1;
68317 : }
68318 1045 : if (unlikely(buf->ndim != nd)) {
68319 0 : PyErr_Format(PyExc_ValueError,
68320 : "Buffer has wrong number of dimensions (expected %d, got %d)",
68321 : nd, buf->ndim);
68322 0 : goto fail;
68323 : }
68324 1045 : if (!cast) {
68325 1045 : __Pyx_BufFmt_Context ctx;
68326 1045 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
68327 1045 : if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
68328 : }
68329 1045 : if (unlikely((size_t)buf->itemsize != dtype->size)) {
68330 0 : PyErr_Format(PyExc_ValueError,
68331 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
68332 : buf->itemsize, (buf->itemsize > 1) ? "s" : "",
68333 : dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
68334 0 : goto fail;
68335 : }
68336 1045 : if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
68337 : return 0;
68338 0 : fail:;
68339 0 : __Pyx_SafeReleaseBuffer(buf);
68340 0 : return -1;
68341 : }
68342 :
68343 : /* BufferFallbackError */
68344 0 : static void __Pyx_RaiseBufferFallbackError(void) {
68345 0 : PyErr_SetString(PyExc_ValueError,
68346 : "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
68347 0 : }
68348 :
68349 : /* PyObjectCall2Args */
68350 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
68351 : PyObject *args[3] = {NULL, arg1, arg2};
68352 : return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
68353 : }
68354 :
68355 : /* MatrixMultiply */
68356 : #if PY_VERSION_HEX < 0x03050000
68357 : static PyObject* __Pyx_PyObject_CallMatrixMethod(PyObject* method, PyObject* arg) {
68358 : PyObject *result = NULL;
68359 : #if CYTHON_UNPACK_METHODS
68360 : if (likely(PyMethod_Check(method))) {
68361 : PyObject *self = PyMethod_GET_SELF(method);
68362 : if (likely(self)) {
68363 : PyObject *function = PyMethod_GET_FUNCTION(method);
68364 : result = __Pyx_PyObject_Call2Args(function, self, arg);
68365 : goto done;
68366 : }
68367 : }
68368 : #endif
68369 : result = __Pyx_PyObject_CallOneArg(method, arg);
68370 : done:
68371 : Py_DECREF(method);
68372 : return result;
68373 : }
68374 : #define __Pyx_TryMatrixMethod(x, y, py_method_name) {\
68375 : PyObject *func = __Pyx_PyObject_GetAttrStrNoError(x, py_method_name);\
68376 : if (func) {\
68377 : PyObject *result = __Pyx_PyObject_CallMatrixMethod(func, y);\
68378 : if (result != Py_NotImplemented)\
68379 : return result;\
68380 : Py_DECREF(result);\
68381 : } else if (unlikely(PyErr_Occurred())) {\
68382 : return NULL;\
68383 : }\
68384 : }
68385 : static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y, const char* op_name) {
68386 : __Pyx_TypeName x_type_name;
68387 : __Pyx_TypeName y_type_name;
68388 : int right_is_subtype = PyObject_IsSubclass((PyObject*)Py_TYPE(y), (PyObject*)Py_TYPE(x));
68389 : if (unlikely(right_is_subtype == -1))
68390 : return NULL;
68391 : if (right_is_subtype) {
68392 : __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
68393 : }
68394 : __Pyx_TryMatrixMethod(x, y, __pyx_n_s_matmul_2)
68395 : if (!right_is_subtype) {
68396 : __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
68397 : }
68398 : x_type_name = __Pyx_PyType_GetName(Py_TYPE(x));
68399 : y_type_name = __Pyx_PyType_GetName(Py_TYPE(y));
68400 : PyErr_Format(PyExc_TypeError,
68401 : "unsupported operand type(s) for %.2s: '" __Pyx_FMT_TYPENAME "' and '"
68402 : __Pyx_FMT_TYPENAME "'", op_name, x_type_name, y_type_name);
68403 : __Pyx_DECREF_TypeName(x_type_name);
68404 : __Pyx_DECREF_TypeName(y_type_name);
68405 : return NULL;
68406 : }
68407 : static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y) {
68408 : __Pyx_TryMatrixMethod(x, y, __pyx_n_s_imatmul)
68409 : return __Pyx__PyNumber_MatrixMultiply(x, y, "@=");
68410 : }
68411 : #undef __Pyx_TryMatrixMethod
68412 : #endif
68413 :
68414 : /* CIntToPyUnicode */
68415 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
68416 0 : char digits[sizeof(long)*3+2];
68417 0 : char *dpos, *end = digits + sizeof(long)*3+2;
68418 0 : const char *hex_digits = DIGITS_HEX;
68419 0 : Py_ssize_t length, ulength;
68420 0 : int prepend_sign, last_one_off;
68421 0 : long remaining;
68422 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
68423 : #pragma GCC diagnostic push
68424 : #pragma GCC diagnostic ignored "-Wconversion"
68425 : #endif
68426 0 : const long neg_one = (long) -1, const_zero = (long) 0;
68427 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
68428 : #pragma GCC diagnostic pop
68429 : #endif
68430 0 : const int is_unsigned = neg_one > const_zero;
68431 0 : if (format_char == 'X') {
68432 0 : hex_digits += 16;
68433 0 : format_char = 'x';
68434 : }
68435 0 : remaining = value;
68436 0 : last_one_off = 0;
68437 0 : dpos = end;
68438 0 : do {
68439 0 : int digit_pos;
68440 0 : switch (format_char) {
68441 0 : case 'o':
68442 0 : digit_pos = abs((int)(remaining % (8*8)));
68443 0 : remaining = (long) (remaining / (8*8));
68444 0 : dpos -= 2;
68445 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
68446 0 : last_one_off = (digit_pos < 8);
68447 0 : break;
68448 0 : case 'd':
68449 0 : digit_pos = abs((int)(remaining % (10*10)));
68450 0 : remaining = (long) (remaining / (10*10));
68451 0 : dpos -= 2;
68452 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
68453 0 : last_one_off = (digit_pos < 10);
68454 0 : break;
68455 0 : case 'x':
68456 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
68457 0 : remaining = (long) (remaining / 16);
68458 0 : break;
68459 : default:
68460 : assert(0);
68461 : break;
68462 : }
68463 0 : } while (unlikely(remaining != 0));
68464 0 : assert(!last_one_off || *dpos == '0');
68465 0 : dpos += last_one_off;
68466 0 : length = end - dpos;
68467 0 : ulength = length;
68468 0 : prepend_sign = 0;
68469 0 : if (!is_unsigned && value <= neg_one) {
68470 0 : if (padding_char == ' ' || width <= length + 1) {
68471 0 : *(--dpos) = '-';
68472 0 : ++length;
68473 : } else {
68474 : prepend_sign = 1;
68475 : }
68476 0 : ++ulength;
68477 : }
68478 0 : if (width > ulength) {
68479 : ulength = width;
68480 : }
68481 0 : if (ulength == 1) {
68482 0 : return PyUnicode_FromOrdinal(*dpos);
68483 : }
68484 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
68485 : }
68486 :
68487 : /* IterFinish */
68488 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
68489 0 : PyObject* exc_type;
68490 0 : __Pyx_PyThreadState_declare
68491 0 : __Pyx_PyThreadState_assign
68492 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
68493 0 : if (unlikely(exc_type)) {
68494 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
68495 : return -1;
68496 0 : __Pyx_PyErr_Clear();
68497 0 : return 0;
68498 : }
68499 : return 0;
68500 : }
68501 :
68502 : /* UnpackItemEndCheck */
68503 0 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
68504 0 : if (unlikely(retval)) {
68505 0 : Py_DECREF(retval);
68506 0 : __Pyx_RaiseTooManyValuesError(expected);
68507 0 : return -1;
68508 : }
68509 0 : return __Pyx_IterFinish();
68510 : }
68511 :
68512 : /* SliceObject */
68513 1275 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
68514 : Py_ssize_t cstart, Py_ssize_t cstop,
68515 : PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
68516 : int has_cstart, int has_cstop, int wraparound) {
68517 1275 : __Pyx_TypeName obj_type_name;
68518 : #if CYTHON_USE_TYPE_SLOTS
68519 1275 : PyMappingMethods* mp;
68520 : #if PY_MAJOR_VERSION < 3
68521 : PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
68522 : if (likely(ms && ms->sq_slice)) {
68523 : if (!has_cstart) {
68524 : if (_py_start && (*_py_start != Py_None)) {
68525 : cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
68526 : if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68527 : } else
68528 : cstart = 0;
68529 : }
68530 : if (!has_cstop) {
68531 : if (_py_stop && (*_py_stop != Py_None)) {
68532 : cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
68533 : if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68534 : } else
68535 : cstop = PY_SSIZE_T_MAX;
68536 : }
68537 : if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
68538 : Py_ssize_t l = ms->sq_length(obj);
68539 : if (likely(l >= 0)) {
68540 : if (cstop < 0) {
68541 : cstop += l;
68542 : if (cstop < 0) cstop = 0;
68543 : }
68544 : if (cstart < 0) {
68545 : cstart += l;
68546 : if (cstart < 0) cstart = 0;
68547 : }
68548 : } else {
68549 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
68550 : goto bad;
68551 : PyErr_Clear();
68552 : }
68553 : }
68554 : return ms->sq_slice(obj, cstart, cstop);
68555 : }
68556 : #else
68557 1275 : CYTHON_UNUSED_VAR(wraparound);
68558 : #endif
68559 1275 : mp = Py_TYPE(obj)->tp_as_mapping;
68560 1275 : if (likely(mp && mp->mp_subscript))
68561 : #else
68562 : CYTHON_UNUSED_VAR(wraparound);
68563 : #endif
68564 : {
68565 1275 : PyObject* result;
68566 1275 : PyObject *py_slice, *py_start, *py_stop;
68567 1275 : if (_py_slice) {
68568 0 : py_slice = *_py_slice;
68569 : } else {
68570 1275 : PyObject* owned_start = NULL;
68571 1275 : PyObject* owned_stop = NULL;
68572 1275 : if (_py_start) {
68573 0 : py_start = *_py_start;
68574 : } else {
68575 1275 : if (has_cstart) {
68576 1263 : owned_start = py_start = PyInt_FromSsize_t(cstart);
68577 1263 : if (unlikely(!py_start)) goto bad;
68578 : } else
68579 : py_start = Py_None;
68580 : }
68581 1275 : if (_py_stop) {
68582 0 : py_stop = *_py_stop;
68583 : } else {
68584 1275 : if (has_cstop) {
68585 12 : owned_stop = py_stop = PyInt_FromSsize_t(cstop);
68586 12 : if (unlikely(!py_stop)) {
68587 0 : Py_XDECREF(owned_start);
68588 0 : goto bad;
68589 : }
68590 : } else
68591 : py_stop = Py_None;
68592 : }
68593 1275 : py_slice = PySlice_New(py_start, py_stop, Py_None);
68594 1275 : Py_XDECREF(owned_start);
68595 1275 : Py_XDECREF(owned_stop);
68596 1275 : if (unlikely(!py_slice)) goto bad;
68597 : }
68598 : #if CYTHON_USE_TYPE_SLOTS
68599 1275 : result = mp->mp_subscript(obj, py_slice);
68600 : #else
68601 : result = PyObject_GetItem(obj, py_slice);
68602 : #endif
68603 1275 : if (!_py_slice) {
68604 1275 : Py_DECREF(py_slice);
68605 : }
68606 1275 : return result;
68607 : }
68608 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
68609 0 : PyErr_Format(PyExc_TypeError,
68610 : "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
68611 : __Pyx_DECREF_TypeName(obj_type_name);
68612 : bad:
68613 : return NULL;
68614 : }
68615 :
68616 : /* PyIntCompare */
68617 7 : static CYTHON_INLINE int __Pyx_PyInt_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
68618 7 : CYTHON_MAYBE_UNUSED_VAR(intval);
68619 7 : CYTHON_UNUSED_VAR(inplace);
68620 7 : if (op1 == op2) {
68621 : return 0;
68622 : }
68623 : #if PY_MAJOR_VERSION < 3
68624 : if (likely(PyInt_CheckExact(op1))) {
68625 : const long b = intval;
68626 : long a = PyInt_AS_LONG(op1);
68627 : return (a != b);
68628 : }
68629 : #endif
68630 : #if CYTHON_USE_PYLONG_INTERNALS
68631 4 : if (likely(PyLong_CheckExact(op1))) {
68632 4 : int unequal;
68633 4 : unsigned long uintval;
68634 4 : Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
68635 4 : const digit* digits = __Pyx_PyLong_Digits(op1);
68636 4 : if (intval == 0) {
68637 4 : return (__Pyx_PyLong_IsZero(op1) != 1);
68638 0 : } else if (intval < 0) {
68639 0 : if (__Pyx_PyLong_IsNonNeg(op1))
68640 : return 1;
68641 0 : intval = -intval;
68642 : } else {
68643 0 : if (__Pyx_PyLong_IsNeg(op1))
68644 : return 1;
68645 : }
68646 0 : uintval = (unsigned long) intval;
68647 : #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
68648 : if (uintval >> (PyLong_SHIFT * 4)) {
68649 : unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
68650 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
68651 : } else
68652 : #endif
68653 : #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
68654 : if (uintval >> (PyLong_SHIFT * 3)) {
68655 : unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
68656 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
68657 : } else
68658 : #endif
68659 : #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
68660 0 : if (uintval >> (PyLong_SHIFT * 2)) {
68661 0 : unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
68662 0 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
68663 : } else
68664 : #endif
68665 : #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
68666 0 : if (uintval >> (PyLong_SHIFT * 1)) {
68667 0 : unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
68668 0 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
68669 : } else
68670 : #endif
68671 0 : unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
68672 0 : return (unequal != 0);
68673 : }
68674 : #endif
68675 0 : if (PyFloat_CheckExact(op1)) {
68676 0 : const long b = intval;
68677 : #if CYTHON_COMPILING_IN_LIMITED_API
68678 : double a = __pyx_PyFloat_AsDouble(op1);
68679 : #else
68680 0 : double a = PyFloat_AS_DOUBLE(op1);
68681 : #endif
68682 0 : return ((double)a != (double)b);
68683 : }
68684 0 : return __Pyx_PyObject_IsTrueAndDecref(
68685 : PyObject_RichCompare(op1, op2, Py_NE));
68686 : }
68687 :
68688 : /* PyIntBinop */
68689 : #if !CYTHON_COMPILING_IN_PYPY
68690 21 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
68691 21 : CYTHON_MAYBE_UNUSED_VAR(intval);
68692 21 : CYTHON_MAYBE_UNUSED_VAR(inplace);
68693 21 : CYTHON_UNUSED_VAR(zerodivision_check);
68694 : #if PY_MAJOR_VERSION < 3
68695 : if (likely(PyInt_CheckExact(op1))) {
68696 : const long b = intval;
68697 : long x;
68698 : long a = PyInt_AS_LONG(op1);
68699 :
68700 : x = (long)((unsigned long)a + (unsigned long)b);
68701 : if (likely((x^a) >= 0 || (x^b) >= 0))
68702 : return PyInt_FromLong(x);
68703 : return PyLong_Type.tp_as_number->nb_add(op1, op2);
68704 : }
68705 : #endif
68706 : #if CYTHON_USE_PYLONG_INTERNALS
68707 21 : if (likely(PyLong_CheckExact(op1))) {
68708 21 : const long b = intval;
68709 21 : long a, x;
68710 : #ifdef HAVE_LONG_LONG
68711 21 : const PY_LONG_LONG llb = intval;
68712 21 : PY_LONG_LONG lla, llx;
68713 : #endif
68714 21 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
68715 3 : return __Pyx_NewRef(op2);
68716 : }
68717 18 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
68718 18 : a = __Pyx_PyLong_CompactValue(op1);
68719 : } else {
68720 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
68721 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
68722 0 : switch (size) {
68723 : case -2:
68724 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68725 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68726 0 : break;
68727 : #ifdef HAVE_LONG_LONG
68728 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68729 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68730 : goto long_long;
68731 : #endif
68732 : }
68733 0 : CYTHON_FALLTHROUGH;
68734 : case 2:
68735 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68736 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68737 0 : break;
68738 : #ifdef HAVE_LONG_LONG
68739 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68740 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68741 : goto long_long;
68742 : #endif
68743 : }
68744 : CYTHON_FALLTHROUGH;
68745 : case -3:
68746 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68747 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68748 : break;
68749 : #ifdef HAVE_LONG_LONG
68750 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68751 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68752 : goto long_long;
68753 : #endif
68754 : }
68755 : CYTHON_FALLTHROUGH;
68756 : case 3:
68757 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68758 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68759 : break;
68760 : #ifdef HAVE_LONG_LONG
68761 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68762 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68763 : goto long_long;
68764 : #endif
68765 : }
68766 : CYTHON_FALLTHROUGH;
68767 : case -4:
68768 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68769 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68770 : break;
68771 : #ifdef HAVE_LONG_LONG
68772 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68773 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68774 : goto long_long;
68775 : #endif
68776 : }
68777 : CYTHON_FALLTHROUGH;
68778 : case 4:
68779 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68780 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68781 : break;
68782 : #ifdef HAVE_LONG_LONG
68783 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68784 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68785 : goto long_long;
68786 : #endif
68787 : }
68788 0 : CYTHON_FALLTHROUGH;
68789 0 : default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
68790 : }
68791 : }
68792 18 : x = a + b;
68793 18 : return PyLong_FromLong(x);
68794 : #ifdef HAVE_LONG_LONG
68795 : long_long:
68796 : llx = lla + llb;
68797 : return PyLong_FromLongLong(llx);
68798 : #endif
68799 :
68800 :
68801 : }
68802 : #endif
68803 0 : if (PyFloat_CheckExact(op1)) {
68804 0 : const long b = intval;
68805 : #if CYTHON_COMPILING_IN_LIMITED_API
68806 : double a = __pyx_PyFloat_AsDouble(op1);
68807 : #else
68808 0 : double a = PyFloat_AS_DOUBLE(op1);
68809 : #endif
68810 0 : double result;
68811 :
68812 : PyFPE_START_PROTECT("add", return NULL)
68813 0 : result = ((double)a) + (double)b;
68814 : PyFPE_END_PROTECT(result)
68815 0 : return PyFloat_FromDouble(result);
68816 : }
68817 0 : return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
68818 : }
68819 : #endif
68820 :
68821 : /* PyIntBinop */
68822 : #if !CYTHON_COMPILING_IN_PYPY
68823 0 : static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
68824 0 : CYTHON_MAYBE_UNUSED_VAR(intval);
68825 0 : CYTHON_MAYBE_UNUSED_VAR(inplace);
68826 0 : CYTHON_UNUSED_VAR(zerodivision_check);
68827 : #if PY_MAJOR_VERSION < 3
68828 : if (likely(PyInt_CheckExact(op1))) {
68829 : const long b = intval;
68830 : long x;
68831 : long a = PyInt_AS_LONG(op1);
68832 :
68833 : if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
68834 : return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
68835 : else {
68836 : long q, r;
68837 : q = a / b;
68838 : r = a - q*b;
68839 : q -= ((r != 0) & ((r ^ b) < 0));
68840 : x = q;
68841 : }
68842 : return PyInt_FromLong(x);
68843 : }
68844 : #endif
68845 : #if CYTHON_USE_PYLONG_INTERNALS
68846 0 : if (likely(PyLong_CheckExact(op1))) {
68847 0 : const long b = intval;
68848 0 : long a, x;
68849 : #ifdef HAVE_LONG_LONG
68850 0 : const PY_LONG_LONG llb = intval;
68851 0 : PY_LONG_LONG lla, llx;
68852 : #endif
68853 0 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
68854 0 : return __Pyx_NewRef(op1);
68855 : }
68856 0 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
68857 0 : a = __Pyx_PyLong_CompactValue(op1);
68858 : } else {
68859 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
68860 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
68861 0 : switch (size) {
68862 : case -2:
68863 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68864 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68865 0 : break;
68866 : #ifdef HAVE_LONG_LONG
68867 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68868 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68869 : goto long_long;
68870 : #endif
68871 : }
68872 0 : CYTHON_FALLTHROUGH;
68873 : case 2:
68874 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68875 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68876 0 : break;
68877 : #ifdef HAVE_LONG_LONG
68878 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68879 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68880 : goto long_long;
68881 : #endif
68882 : }
68883 : CYTHON_FALLTHROUGH;
68884 : case -3:
68885 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68886 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68887 : break;
68888 : #ifdef HAVE_LONG_LONG
68889 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68890 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68891 : goto long_long;
68892 : #endif
68893 : }
68894 : CYTHON_FALLTHROUGH;
68895 : case 3:
68896 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68897 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68898 : break;
68899 : #ifdef HAVE_LONG_LONG
68900 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68901 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68902 : goto long_long;
68903 : #endif
68904 : }
68905 : CYTHON_FALLTHROUGH;
68906 : case -4:
68907 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68908 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68909 : break;
68910 : #ifdef HAVE_LONG_LONG
68911 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68912 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68913 : goto long_long;
68914 : #endif
68915 : }
68916 : CYTHON_FALLTHROUGH;
68917 : case 4:
68918 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68919 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68920 : break;
68921 : #ifdef HAVE_LONG_LONG
68922 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68923 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68924 : goto long_long;
68925 : #endif
68926 : }
68927 0 : CYTHON_FALLTHROUGH;
68928 0 : default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
68929 : }
68930 : }
68931 : {
68932 0 : long q, r;
68933 0 : q = a / b;
68934 0 : r = a - q*b;
68935 0 : q -= ((r != 0) & ((r ^ b) < 0));
68936 0 : x = q;
68937 : }
68938 0 : return PyLong_FromLong(x);
68939 : #ifdef HAVE_LONG_LONG
68940 : long_long:
68941 : {
68942 : PY_LONG_LONG q, r;
68943 : q = lla / llb;
68944 : r = lla - q*llb;
68945 : q -= ((r != 0) & ((r ^ llb) < 0));
68946 : llx = q;
68947 : }
68948 : return PyLong_FromLongLong(llx);
68949 : #endif
68950 :
68951 :
68952 : }
68953 : #endif
68954 0 : return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
68955 : }
68956 : #endif
68957 :
68958 : /* PyIntBinop */
68959 : #if !CYTHON_COMPILING_IN_PYPY
68960 3 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
68961 3 : CYTHON_MAYBE_UNUSED_VAR(intval);
68962 3 : CYTHON_MAYBE_UNUSED_VAR(inplace);
68963 3 : CYTHON_UNUSED_VAR(zerodivision_check);
68964 : #if PY_MAJOR_VERSION < 3
68965 : if (likely(PyInt_CheckExact(op2))) {
68966 : const long a = intval;
68967 : long b = PyInt_AS_LONG(op2);
68968 :
68969 : #ifdef HAVE_LONG_LONG
68970 : if (sizeof(PY_LONG_LONG) > sizeof(long)) {
68971 : PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
68972 : return (result >= LONG_MIN && result <= LONG_MAX) ?
68973 : PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
68974 : }
68975 : #endif
68976 : #if CYTHON_USE_TYPE_SLOTS
68977 : return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
68978 : #else
68979 : return PyNumber_Multiply(op1, op2);
68980 : #endif
68981 : }
68982 : #endif
68983 : #if CYTHON_USE_PYLONG_INTERNALS
68984 3 : if (likely(PyLong_CheckExact(op2))) {
68985 0 : const long a = intval;
68986 0 : long b, x;
68987 : #ifdef HAVE_LONG_LONG
68988 0 : const PY_LONG_LONG lla = intval;
68989 0 : PY_LONG_LONG llb, llx;
68990 : #endif
68991 0 : if (unlikely(__Pyx_PyLong_IsZero(op2))) {
68992 0 : return __Pyx_NewRef(op2);
68993 : }
68994 0 : if (likely(__Pyx_PyLong_IsCompact(op2))) {
68995 0 : b = __Pyx_PyLong_CompactValue(op2);
68996 : } else {
68997 0 : const digit* digits = __Pyx_PyLong_Digits(op2);
68998 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
68999 0 : switch (size) {
69000 : case -2:
69001 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
69002 : b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69003 : break;
69004 : #ifdef HAVE_LONG_LONG
69005 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
69006 : llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69007 : goto long_long;
69008 : #endif
69009 : }
69010 : CYTHON_FALLTHROUGH;
69011 : case 2:
69012 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
69013 : b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69014 : break;
69015 : #ifdef HAVE_LONG_LONG
69016 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
69017 : llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69018 : goto long_long;
69019 : #endif
69020 : }
69021 : CYTHON_FALLTHROUGH;
69022 : case -3:
69023 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
69024 : b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69025 : break;
69026 : #ifdef HAVE_LONG_LONG
69027 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
69028 : llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69029 : goto long_long;
69030 : #endif
69031 : }
69032 : CYTHON_FALLTHROUGH;
69033 : case 3:
69034 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
69035 : b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69036 : break;
69037 : #ifdef HAVE_LONG_LONG
69038 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
69039 : llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69040 : goto long_long;
69041 : #endif
69042 : }
69043 : CYTHON_FALLTHROUGH;
69044 : case -4:
69045 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
69046 : b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69047 : break;
69048 : #ifdef HAVE_LONG_LONG
69049 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
69050 : llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69051 : goto long_long;
69052 : #endif
69053 : }
69054 0 : CYTHON_FALLTHROUGH;
69055 : case 4:
69056 0 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
69057 : b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69058 : break;
69059 : #ifdef HAVE_LONG_LONG
69060 0 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
69061 : llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69062 : goto long_long;
69063 : #endif
69064 : }
69065 0 : CYTHON_FALLTHROUGH;
69066 0 : default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
69067 : }
69068 : }
69069 0 : CYTHON_UNUSED_VAR(a);
69070 0 : CYTHON_UNUSED_VAR(b);
69071 : #ifdef HAVE_LONG_LONG
69072 0 : llb = b;
69073 0 : goto long_long;
69074 : #else
69075 : return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
69076 : #endif
69077 : return PyLong_FromLong(x);
69078 : #ifdef HAVE_LONG_LONG
69079 0 : long_long:
69080 0 : llx = lla * llb;
69081 0 : return PyLong_FromLongLong(llx);
69082 : #endif
69083 :
69084 :
69085 : }
69086 : #endif
69087 3 : if (PyFloat_CheckExact(op2)) {
69088 3 : const long a = intval;
69089 : #if CYTHON_COMPILING_IN_LIMITED_API
69090 : double b = __pyx_PyFloat_AsDouble(op2);
69091 : #else
69092 3 : double b = PyFloat_AS_DOUBLE(op2);
69093 : #endif
69094 3 : double result;
69095 :
69096 : PyFPE_START_PROTECT("multiply", return NULL)
69097 3 : result = ((double)a) * (double)b;
69098 : PyFPE_END_PROTECT(result)
69099 3 : return PyFloat_FromDouble(result);
69100 : }
69101 0 : return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
69102 : }
69103 : #endif
69104 :
69105 : /* PyIntCompare */
69106 : static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
69107 : CYTHON_MAYBE_UNUSED_VAR(intval);
69108 : CYTHON_UNUSED_VAR(inplace);
69109 : if (op1 == op2) {
69110 : return 1;
69111 : }
69112 : #if PY_MAJOR_VERSION < 3
69113 : if (likely(PyInt_CheckExact(op1))) {
69114 : const long b = intval;
69115 : long a = PyInt_AS_LONG(op1);
69116 : return (a == b);
69117 : }
69118 : #endif
69119 : #if CYTHON_USE_PYLONG_INTERNALS
69120 : if (likely(PyLong_CheckExact(op1))) {
69121 : int unequal;
69122 : unsigned long uintval;
69123 : Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
69124 : const digit* digits = __Pyx_PyLong_Digits(op1);
69125 : if (intval == 0) {
69126 : return (__Pyx_PyLong_IsZero(op1) == 1);
69127 : } else if (intval < 0) {
69128 : if (__Pyx_PyLong_IsNonNeg(op1))
69129 : return 0;
69130 : intval = -intval;
69131 : } else {
69132 : if (__Pyx_PyLong_IsNeg(op1))
69133 : return 0;
69134 : }
69135 : uintval = (unsigned long) intval;
69136 : #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
69137 : if (uintval >> (PyLong_SHIFT * 4)) {
69138 : unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
69139 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
69140 : } else
69141 : #endif
69142 : #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
69143 : if (uintval >> (PyLong_SHIFT * 3)) {
69144 : unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
69145 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
69146 : } else
69147 : #endif
69148 : #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
69149 : if (uintval >> (PyLong_SHIFT * 2)) {
69150 : unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
69151 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
69152 : } else
69153 : #endif
69154 : #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
69155 : if (uintval >> (PyLong_SHIFT * 1)) {
69156 : unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
69157 : | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
69158 : } else
69159 : #endif
69160 : unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
69161 : return (unequal == 0);
69162 : }
69163 : #endif
69164 : if (PyFloat_CheckExact(op1)) {
69165 : const long b = intval;
69166 : #if CYTHON_COMPILING_IN_LIMITED_API
69167 : double a = __pyx_PyFloat_AsDouble(op1);
69168 : #else
69169 : double a = PyFloat_AS_DOUBLE(op1);
69170 : #endif
69171 : return ((double)a == (double)b);
69172 : }
69173 : return __Pyx_PyObject_IsTrueAndDecref(
69174 : PyObject_RichCompare(op1, op2, Py_EQ));
69175 : }
69176 :
69177 : /* PyIntBinop */
69178 : #if !CYTHON_COMPILING_IN_PYPY
69179 : static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
69180 : CYTHON_MAYBE_UNUSED_VAR(intval);
69181 : CYTHON_MAYBE_UNUSED_VAR(inplace);
69182 : CYTHON_UNUSED_VAR(zerodivision_check);
69183 : #if PY_MAJOR_VERSION < 3
69184 : if (likely(PyInt_CheckExact(op1))) {
69185 : const long b = intval;
69186 : long x;
69187 : long a = PyInt_AS_LONG(op1);
69188 :
69189 : x = (long)((unsigned long)a - (unsigned long)b);
69190 : if (likely((x^a) >= 0 || (x^~b) >= 0))
69191 : return PyInt_FromLong(x);
69192 : return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
69193 : }
69194 : #endif
69195 : #if CYTHON_USE_PYLONG_INTERNALS
69196 : if (likely(PyLong_CheckExact(op1))) {
69197 : const long b = intval;
69198 : long a, x;
69199 : #ifdef HAVE_LONG_LONG
69200 : const PY_LONG_LONG llb = intval;
69201 : PY_LONG_LONG lla, llx;
69202 : #endif
69203 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
69204 : return PyLong_FromLong(-intval);
69205 : }
69206 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
69207 : a = __Pyx_PyLong_CompactValue(op1);
69208 : } else {
69209 : const digit* digits = __Pyx_PyLong_Digits(op1);
69210 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
69211 : switch (size) {
69212 : case -2:
69213 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
69214 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69215 : break;
69216 : #ifdef HAVE_LONG_LONG
69217 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
69218 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69219 : goto long_long;
69220 : #endif
69221 : }
69222 : CYTHON_FALLTHROUGH;
69223 : case 2:
69224 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
69225 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69226 : break;
69227 : #ifdef HAVE_LONG_LONG
69228 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
69229 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69230 : goto long_long;
69231 : #endif
69232 : }
69233 : CYTHON_FALLTHROUGH;
69234 : case -3:
69235 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69236 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69237 : break;
69238 : #ifdef HAVE_LONG_LONG
69239 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
69240 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69241 : goto long_long;
69242 : #endif
69243 : }
69244 : CYTHON_FALLTHROUGH;
69245 : case 3:
69246 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69247 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69248 : break;
69249 : #ifdef HAVE_LONG_LONG
69250 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
69251 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69252 : goto long_long;
69253 : #endif
69254 : }
69255 : CYTHON_FALLTHROUGH;
69256 : case -4:
69257 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
69258 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69259 : break;
69260 : #ifdef HAVE_LONG_LONG
69261 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
69262 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69263 : goto long_long;
69264 : #endif
69265 : }
69266 : CYTHON_FALLTHROUGH;
69267 : case 4:
69268 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
69269 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69270 : break;
69271 : #ifdef HAVE_LONG_LONG
69272 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
69273 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69274 : goto long_long;
69275 : #endif
69276 : }
69277 : CYTHON_FALLTHROUGH;
69278 : default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
69279 : }
69280 : }
69281 : x = a - b;
69282 : return PyLong_FromLong(x);
69283 : #ifdef HAVE_LONG_LONG
69284 : long_long:
69285 : llx = lla - llb;
69286 : return PyLong_FromLongLong(llx);
69287 : #endif
69288 :
69289 :
69290 : }
69291 : #endif
69292 : if (PyFloat_CheckExact(op1)) {
69293 : const long b = intval;
69294 : #if CYTHON_COMPILING_IN_LIMITED_API
69295 : double a = __pyx_PyFloat_AsDouble(op1);
69296 : #else
69297 : double a = PyFloat_AS_DOUBLE(op1);
69298 : #endif
69299 : double result;
69300 :
69301 : PyFPE_START_PROTECT("subtract", return NULL)
69302 : result = ((double)a) - (double)b;
69303 : PyFPE_END_PROTECT(result)
69304 : return PyFloat_FromDouble(result);
69305 : }
69306 : return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
69307 : }
69308 : #endif
69309 :
69310 : /* SliceObject */
69311 : static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
69312 : Py_ssize_t cstart, Py_ssize_t cstop,
69313 : PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
69314 : int has_cstart, int has_cstop, int wraparound) {
69315 : __Pyx_TypeName obj_type_name;
69316 : #if CYTHON_USE_TYPE_SLOTS
69317 : PyMappingMethods* mp;
69318 : #if PY_MAJOR_VERSION < 3
69319 : PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
69320 : if (likely(ms && ms->sq_ass_slice)) {
69321 : if (!has_cstart) {
69322 : if (_py_start && (*_py_start != Py_None)) {
69323 : cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
69324 : if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
69325 : } else
69326 : cstart = 0;
69327 : }
69328 : if (!has_cstop) {
69329 : if (_py_stop && (*_py_stop != Py_None)) {
69330 : cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
69331 : if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
69332 : } else
69333 : cstop = PY_SSIZE_T_MAX;
69334 : }
69335 : if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
69336 : Py_ssize_t l = ms->sq_length(obj);
69337 : if (likely(l >= 0)) {
69338 : if (cstop < 0) {
69339 : cstop += l;
69340 : if (cstop < 0) cstop = 0;
69341 : }
69342 : if (cstart < 0) {
69343 : cstart += l;
69344 : if (cstart < 0) cstart = 0;
69345 : }
69346 : } else {
69347 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
69348 : goto bad;
69349 : PyErr_Clear();
69350 : }
69351 : }
69352 : return ms->sq_ass_slice(obj, cstart, cstop, value);
69353 : }
69354 : #else
69355 : CYTHON_UNUSED_VAR(wraparound);
69356 : #endif
69357 : mp = Py_TYPE(obj)->tp_as_mapping;
69358 : if (likely(mp && mp->mp_ass_subscript))
69359 : #else
69360 : CYTHON_UNUSED_VAR(wraparound);
69361 : #endif
69362 : {
69363 : int result;
69364 : PyObject *py_slice, *py_start, *py_stop;
69365 : if (_py_slice) {
69366 : py_slice = *_py_slice;
69367 : } else {
69368 : PyObject* owned_start = NULL;
69369 : PyObject* owned_stop = NULL;
69370 : if (_py_start) {
69371 : py_start = *_py_start;
69372 : } else {
69373 : if (has_cstart) {
69374 : owned_start = py_start = PyInt_FromSsize_t(cstart);
69375 : if (unlikely(!py_start)) goto bad;
69376 : } else
69377 : py_start = Py_None;
69378 : }
69379 : if (_py_stop) {
69380 : py_stop = *_py_stop;
69381 : } else {
69382 : if (has_cstop) {
69383 : owned_stop = py_stop = PyInt_FromSsize_t(cstop);
69384 : if (unlikely(!py_stop)) {
69385 : Py_XDECREF(owned_start);
69386 : goto bad;
69387 : }
69388 : } else
69389 : py_stop = Py_None;
69390 : }
69391 : py_slice = PySlice_New(py_start, py_stop, Py_None);
69392 : Py_XDECREF(owned_start);
69393 : Py_XDECREF(owned_stop);
69394 : if (unlikely(!py_slice)) goto bad;
69395 : }
69396 : #if CYTHON_USE_TYPE_SLOTS
69397 : result = mp->mp_ass_subscript(obj, py_slice, value);
69398 : #else
69399 : result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
69400 : #endif
69401 : if (!_py_slice) {
69402 : Py_DECREF(py_slice);
69403 : }
69404 : return result;
69405 : }
69406 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
69407 : PyErr_Format(PyExc_TypeError,
69408 : "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s",
69409 : obj_type_name, value ? "assignment" : "deletion");
69410 : __Pyx_DECREF_TypeName(obj_type_name);
69411 : bad:
69412 : return -1;
69413 : }
69414 :
69415 : /* PyFloatBinop */
69416 : #if !CYTHON_COMPILING_IN_PYPY
69417 0 : static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
69418 0 : const double a = floatval;
69419 0 : double b, result;
69420 0 : CYTHON_UNUSED_VAR(inplace);
69421 0 : CYTHON_UNUSED_VAR(zerodivision_check);
69422 0 : if (likely(PyFloat_CheckExact(op2))) {
69423 : #if CYTHON_COMPILING_IN_LIMITED_API
69424 : b = __pyx_PyFloat_AsDouble(op2);
69425 : #else
69426 0 : b = PyFloat_AS_DOUBLE(op2);
69427 : #endif
69428 0 : if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
69429 : } else
69430 : #if PY_MAJOR_VERSION < 3
69431 : if (likely(PyInt_CheckExact(op2))) {
69432 : b = (double) PyInt_AS_LONG(op2);
69433 : if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
69434 : } else
69435 : #endif
69436 0 : if (likely(PyLong_CheckExact(op2))) {
69437 : #if CYTHON_USE_PYLONG_INTERNALS
69438 0 : if (__Pyx_PyLong_IsZero(op2)) {
69439 0 : b = 0.0;
69440 0 : if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
69441 0 : } else if (__Pyx_PyLong_IsCompact(op2)) {
69442 0 : b = (double) __Pyx_PyLong_CompactValue(op2);
69443 : } else {
69444 0 : const digit* digits = __Pyx_PyLong_Digits(op2);
69445 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
69446 0 : switch (size) {
69447 : case -2:
69448 : case 2:
69449 0 : if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
69450 0 : b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69451 0 : if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69452 0 : if (size == -2)
69453 0 : b = -b;
69454 : break;
69455 : }
69456 : }
69457 : CYTHON_FALLTHROUGH;
69458 : case -3:
69459 : case 3:
69460 : if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
69461 : b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69462 : if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69463 : if (size == -3)
69464 : b = -b;
69465 : break;
69466 : }
69467 : }
69468 : CYTHON_FALLTHROUGH;
69469 : case -4:
69470 : case 4:
69471 : if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
69472 : b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69473 : if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69474 : if (size == -4)
69475 : b = -b;
69476 : break;
69477 : }
69478 : }
69479 0 : CYTHON_FALLTHROUGH;
69480 : default:
69481 : #endif
69482 0 : b = PyLong_AsDouble(op2);
69483 0 : if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
69484 : #if !CYTHON_USE_PYLONG_INTERNALS
69485 : if (unlikely(zerodivision_check && ((b) == 0.0))) { PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero"); return NULL;}
69486 : #endif
69487 : #if CYTHON_USE_PYLONG_INTERNALS
69488 : }
69489 : }
69490 : #endif
69491 : } else {
69492 0 : return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
69493 : }
69494 : PyFPE_START_PROTECT("divide", return NULL)
69495 0 : result = a / b;
69496 : PyFPE_END_PROTECT(result)
69497 0 : return PyFloat_FromDouble(result);
69498 : }
69499 : #endif
69500 :
69501 : /* PyObject_GenericGetAttrNoDict */
69502 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
69503 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
69504 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
69505 : PyErr_Format(PyExc_AttributeError,
69506 : #if PY_MAJOR_VERSION >= 3
69507 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
69508 : type_name, attr_name);
69509 : #else
69510 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
69511 : type_name, PyString_AS_STRING(attr_name));
69512 : #endif
69513 : __Pyx_DECREF_TypeName(type_name);
69514 : return NULL;
69515 : }
69516 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
69517 : PyObject *descr;
69518 : PyTypeObject *tp = Py_TYPE(obj);
69519 : if (unlikely(!PyString_Check(attr_name))) {
69520 : return PyObject_GenericGetAttr(obj, attr_name);
69521 : }
69522 : assert(!tp->tp_dictoffset);
69523 : descr = _PyType_Lookup(tp, attr_name);
69524 : if (unlikely(!descr)) {
69525 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
69526 : }
69527 : Py_INCREF(descr);
69528 : #if PY_MAJOR_VERSION < 3
69529 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
69530 : #endif
69531 : {
69532 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
69533 : if (unlikely(f)) {
69534 : PyObject *res = f(descr, obj, (PyObject *)tp);
69535 : Py_DECREF(descr);
69536 : return res;
69537 : }
69538 : }
69539 : return descr;
69540 : }
69541 : #endif
69542 :
69543 : /* PyObject_GenericGetAttr */
69544 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
69545 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
69546 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
69547 : return PyObject_GenericGetAttr(obj, attr_name);
69548 : }
69549 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
69550 : }
69551 : #endif
69552 :
69553 : /* FixUpExtensionType */
69554 : #if CYTHON_USE_TYPE_SPECS
69555 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
69556 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
69557 : CYTHON_UNUSED_VAR(spec);
69558 : CYTHON_UNUSED_VAR(type);
69559 : #else
69560 : const PyType_Slot *slot = spec->slots;
69561 : while (slot && slot->slot && slot->slot != Py_tp_members)
69562 : slot++;
69563 : if (slot && slot->slot == Py_tp_members) {
69564 : int changed = 0;
69565 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
69566 : const
69567 : #endif
69568 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
69569 : while (memb && memb->name) {
69570 : if (memb->name[0] == '_' && memb->name[1] == '_') {
69571 : #if PY_VERSION_HEX < 0x030900b1
69572 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
69573 : assert(memb->type == T_PYSSIZET);
69574 : assert(memb->flags == READONLY);
69575 : type->tp_weaklistoffset = memb->offset;
69576 : changed = 1;
69577 : }
69578 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
69579 : assert(memb->type == T_PYSSIZET);
69580 : assert(memb->flags == READONLY);
69581 : type->tp_dictoffset = memb->offset;
69582 : changed = 1;
69583 : }
69584 : #if CYTHON_METH_FASTCALL
69585 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
69586 : assert(memb->type == T_PYSSIZET);
69587 : assert(memb->flags == READONLY);
69588 : #if PY_VERSION_HEX >= 0x030800b4
69589 : type->tp_vectorcall_offset = memb->offset;
69590 : #else
69591 : type->tp_print = (printfunc) memb->offset;
69592 : #endif
69593 : changed = 1;
69594 : }
69595 : #endif
69596 : #else
69597 : if ((0));
69598 : #endif
69599 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
69600 : else if (strcmp(memb->name, "__module__") == 0) {
69601 : PyObject *descr;
69602 : assert(memb->type == T_OBJECT);
69603 : assert(memb->flags == 0 || memb->flags == READONLY);
69604 : descr = PyDescr_NewMember(type, memb);
69605 : if (unlikely(!descr))
69606 : return -1;
69607 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
69608 : Py_DECREF(descr);
69609 : return -1;
69610 : }
69611 : Py_DECREF(descr);
69612 : changed = 1;
69613 : }
69614 : #endif
69615 : }
69616 : memb++;
69617 : }
69618 : if (changed)
69619 : PyType_Modified(type);
69620 : }
69621 : #endif
69622 : return 0;
69623 : }
69624 : #endif
69625 :
69626 : /* PyObjectCallNoArg */
69627 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
69628 : PyObject *arg[2] = {NULL, NULL};
69629 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
69630 : }
69631 :
69632 : /* PyObjectGetMethod */
69633 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
69634 : PyObject *attr;
69635 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
69636 : __Pyx_TypeName type_name;
69637 : PyTypeObject *tp = Py_TYPE(obj);
69638 : PyObject *descr;
69639 : descrgetfunc f = NULL;
69640 : PyObject **dictptr, *dict;
69641 : int meth_found = 0;
69642 : assert (*method == NULL);
69643 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
69644 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
69645 : goto try_unpack;
69646 : }
69647 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
69648 : return 0;
69649 : }
69650 : descr = _PyType_Lookup(tp, name);
69651 : if (likely(descr != NULL)) {
69652 : Py_INCREF(descr);
69653 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
69654 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
69655 : #elif PY_MAJOR_VERSION >= 3
69656 : #ifdef __Pyx_CyFunction_USED
69657 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
69658 : #else
69659 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
69660 : #endif
69661 : #else
69662 : #ifdef __Pyx_CyFunction_USED
69663 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
69664 : #else
69665 : if (likely(PyFunction_Check(descr)))
69666 : #endif
69667 : #endif
69668 : {
69669 : meth_found = 1;
69670 : } else {
69671 : f = Py_TYPE(descr)->tp_descr_get;
69672 : if (f != NULL && PyDescr_IsData(descr)) {
69673 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
69674 : Py_DECREF(descr);
69675 : goto try_unpack;
69676 : }
69677 : }
69678 : }
69679 : dictptr = _PyObject_GetDictPtr(obj);
69680 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
69681 : Py_INCREF(dict);
69682 : attr = __Pyx_PyDict_GetItemStr(dict, name);
69683 : if (attr != NULL) {
69684 : Py_INCREF(attr);
69685 : Py_DECREF(dict);
69686 : Py_XDECREF(descr);
69687 : goto try_unpack;
69688 : }
69689 : Py_DECREF(dict);
69690 : }
69691 : if (meth_found) {
69692 : *method = descr;
69693 : return 1;
69694 : }
69695 : if (f != NULL) {
69696 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
69697 : Py_DECREF(descr);
69698 : goto try_unpack;
69699 : }
69700 : if (likely(descr != NULL)) {
69701 : *method = descr;
69702 : return 0;
69703 : }
69704 : type_name = __Pyx_PyType_GetName(tp);
69705 : PyErr_Format(PyExc_AttributeError,
69706 : #if PY_MAJOR_VERSION >= 3
69707 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
69708 : type_name, name);
69709 : #else
69710 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
69711 : type_name, PyString_AS_STRING(name));
69712 : #endif
69713 : __Pyx_DECREF_TypeName(type_name);
69714 : return 0;
69715 : #else
69716 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
69717 : goto try_unpack;
69718 : #endif
69719 : try_unpack:
69720 : #if CYTHON_UNPACK_METHODS
69721 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
69722 : PyObject *function = PyMethod_GET_FUNCTION(attr);
69723 : Py_INCREF(function);
69724 : Py_DECREF(attr);
69725 : *method = function;
69726 : return 1;
69727 : }
69728 : #endif
69729 : *method = attr;
69730 : return 0;
69731 : }
69732 :
69733 : /* PyObjectCallMethod0 */
69734 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
69735 : PyObject *method = NULL, *result = NULL;
69736 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
69737 : if (likely(is_method)) {
69738 : result = __Pyx_PyObject_CallOneArg(method, obj);
69739 : Py_DECREF(method);
69740 : return result;
69741 : }
69742 : if (unlikely(!method)) goto bad;
69743 : result = __Pyx_PyObject_CallNoArg(method);
69744 : Py_DECREF(method);
69745 : bad:
69746 : return result;
69747 : }
69748 :
69749 : /* ValidateBasesTuple */
69750 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
69751 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
69752 0 : Py_ssize_t i, n;
69753 : #if CYTHON_ASSUME_SAFE_MACROS
69754 0 : n = PyTuple_GET_SIZE(bases);
69755 : #else
69756 : n = PyTuple_Size(bases);
69757 : if (n < 0) return -1;
69758 : #endif
69759 0 : for (i = 1; i < n; i++)
69760 : {
69761 : #if CYTHON_AVOID_BORROWED_REFS
69762 : PyObject *b0 = PySequence_GetItem(bases, i);
69763 : if (!b0) return -1;
69764 : #elif CYTHON_ASSUME_SAFE_MACROS
69765 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
69766 : #else
69767 : PyObject *b0 = PyTuple_GetItem(bases, i);
69768 : if (!b0) return -1;
69769 : #endif
69770 0 : PyTypeObject *b;
69771 : #if PY_MAJOR_VERSION < 3
69772 : if (PyClass_Check(b0))
69773 : {
69774 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
69775 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
69776 : #if CYTHON_AVOID_BORROWED_REFS
69777 : Py_DECREF(b0);
69778 : #endif
69779 : return -1;
69780 : }
69781 : #endif
69782 0 : b = (PyTypeObject*) b0;
69783 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
69784 : {
69785 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
69786 0 : PyErr_Format(PyExc_TypeError,
69787 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
69788 0 : __Pyx_DECREF_TypeName(b_name);
69789 : #if CYTHON_AVOID_BORROWED_REFS
69790 : Py_DECREF(b0);
69791 : #endif
69792 0 : return -1;
69793 : }
69794 0 : if (dictoffset == 0)
69795 : {
69796 0 : Py_ssize_t b_dictoffset = 0;
69797 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
69798 0 : b_dictoffset = b->tp_dictoffset;
69799 : #else
69800 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
69801 : if (!py_b_dictoffset) goto dictoffset_return;
69802 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
69803 : Py_DECREF(py_b_dictoffset);
69804 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
69805 : #endif
69806 0 : if (b_dictoffset) {
69807 : {
69808 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
69809 0 : PyErr_Format(PyExc_TypeError,
69810 : "extension type '%.200s' has no __dict__ slot, "
69811 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
69812 : "either add 'cdef dict __dict__' to the extension type "
69813 : "or add '__slots__ = [...]' to the base type",
69814 : type_name, b_name);
69815 0 : __Pyx_DECREF_TypeName(b_name);
69816 : }
69817 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
69818 : dictoffset_return:
69819 : #endif
69820 : #if CYTHON_AVOID_BORROWED_REFS
69821 : Py_DECREF(b0);
69822 : #endif
69823 0 : return -1;
69824 : }
69825 : }
69826 : #if CYTHON_AVOID_BORROWED_REFS
69827 : Py_DECREF(b0);
69828 : #endif
69829 : }
69830 : return 0;
69831 : }
69832 : #endif
69833 :
69834 : /* PyType_Ready */
69835 12 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
69836 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
69837 : (void)__Pyx_PyObject_CallMethod0;
69838 : #if CYTHON_USE_TYPE_SPECS
69839 : (void)__Pyx_validate_bases_tuple;
69840 : #endif
69841 : return PyType_Ready(t);
69842 : #else
69843 12 : int r;
69844 12 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
69845 12 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
69846 : return -1;
69847 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
69848 : {
69849 12 : int gc_was_enabled;
69850 : #if PY_VERSION_HEX >= 0x030A00b1
69851 12 : gc_was_enabled = PyGC_Disable();
69852 12 : (void)__Pyx_PyObject_CallMethod0;
69853 : #else
69854 : PyObject *ret, *py_status;
69855 : PyObject *gc = NULL;
69856 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
69857 : gc = PyImport_GetModule(__pyx_kp_u_gc);
69858 : #endif
69859 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
69860 : if (unlikely(!gc)) return -1;
69861 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
69862 : if (unlikely(!py_status)) {
69863 : Py_DECREF(gc);
69864 : return -1;
69865 : }
69866 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
69867 : Py_DECREF(py_status);
69868 : if (gc_was_enabled > 0) {
69869 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
69870 : if (unlikely(!ret)) {
69871 : Py_DECREF(gc);
69872 : return -1;
69873 : }
69874 : Py_DECREF(ret);
69875 : } else if (unlikely(gc_was_enabled == -1)) {
69876 : Py_DECREF(gc);
69877 : return -1;
69878 : }
69879 : #endif
69880 12 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
69881 : #if PY_VERSION_HEX >= 0x030A0000
69882 12 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
69883 : #endif
69884 : #else
69885 : (void)__Pyx_PyObject_CallMethod0;
69886 : #endif
69887 12 : r = PyType_Ready(t);
69888 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
69889 12 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
69890 : #if PY_VERSION_HEX >= 0x030A00b1
69891 12 : if (gc_was_enabled)
69892 12 : PyGC_Enable();
69893 : #else
69894 : if (gc_was_enabled) {
69895 : PyObject *tp, *v, *tb;
69896 : PyErr_Fetch(&tp, &v, &tb);
69897 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
69898 : if (likely(ret || r == -1)) {
69899 : Py_XDECREF(ret);
69900 : PyErr_Restore(tp, v, tb);
69901 : } else {
69902 : Py_XDECREF(tp);
69903 : Py_XDECREF(v);
69904 : Py_XDECREF(tb);
69905 : r = -1;
69906 : }
69907 : }
69908 : Py_DECREF(gc);
69909 : #endif
69910 : }
69911 : #endif
69912 : return r;
69913 : #endif
69914 : }
69915 :
69916 : /* SetVTable */
69917 9 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
69918 9 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
69919 9 : if (unlikely(!ob))
69920 0 : goto bad;
69921 : #if CYTHON_COMPILING_IN_LIMITED_API
69922 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
69923 : #else
69924 9 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
69925 : #endif
69926 0 : goto bad;
69927 9 : Py_DECREF(ob);
69928 : return 0;
69929 0 : bad:
69930 0 : Py_XDECREF(ob);
69931 0 : return -1;
69932 : }
69933 :
69934 : /* GetVTable */
69935 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
69936 0 : void* ptr;
69937 : #if CYTHON_COMPILING_IN_LIMITED_API
69938 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
69939 : #else
69940 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
69941 : #endif
69942 0 : if (!ob)
69943 0 : goto bad;
69944 0 : ptr = PyCapsule_GetPointer(ob, 0);
69945 0 : if (!ptr && !PyErr_Occurred())
69946 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
69947 0 : Py_DECREF(ob);
69948 : return ptr;
69949 0 : bad:
69950 0 : Py_XDECREF(ob);
69951 0 : return NULL;
69952 : }
69953 :
69954 : /* MergeVTables */
69955 : #if !CYTHON_COMPILING_IN_LIMITED_API
69956 9 : static int __Pyx_MergeVtables(PyTypeObject *type) {
69957 9 : int i;
69958 9 : void** base_vtables;
69959 9 : __Pyx_TypeName tp_base_name;
69960 9 : __Pyx_TypeName base_name;
69961 9 : void* unknown = (void*)-1;
69962 9 : PyObject* bases = type->tp_bases;
69963 9 : int base_depth = 0;
69964 : {
69965 9 : PyTypeObject* base = type->tp_base;
69966 21 : while (base) {
69967 12 : base_depth += 1;
69968 12 : base = base->tp_base;
69969 : }
69970 : }
69971 9 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
69972 9 : base_vtables[0] = unknown;
69973 9 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
69974 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
69975 0 : if (base_vtable != NULL) {
69976 0 : int j;
69977 0 : PyTypeObject* base = type->tp_base;
69978 0 : for (j = 0; j < base_depth; j++) {
69979 0 : if (base_vtables[j] == unknown) {
69980 0 : base_vtables[j] = __Pyx_GetVtable(base);
69981 0 : base_vtables[j + 1] = unknown;
69982 : }
69983 0 : if (base_vtables[j] == base_vtable) {
69984 : break;
69985 0 : } else if (base_vtables[j] == NULL) {
69986 0 : goto bad;
69987 : }
69988 0 : base = base->tp_base;
69989 : }
69990 : }
69991 : }
69992 9 : PyErr_Clear();
69993 9 : free(base_vtables);
69994 9 : return 0;
69995 0 : bad:
69996 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
69997 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
69998 0 : PyErr_Format(PyExc_TypeError,
69999 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
70000 0 : __Pyx_DECREF_TypeName(tp_base_name);
70001 0 : __Pyx_DECREF_TypeName(base_name);
70002 0 : free(base_vtables);
70003 0 : return -1;
70004 : }
70005 : #endif
70006 :
70007 : /* SetupReduce */
70008 : #if !CYTHON_COMPILING_IN_LIMITED_API
70009 6 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
70010 6 : int ret;
70011 6 : PyObject *name_attr;
70012 6 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
70013 6 : if (likely(name_attr)) {
70014 6 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
70015 : } else {
70016 : ret = -1;
70017 : }
70018 6 : if (unlikely(ret < 0)) {
70019 0 : PyErr_Clear();
70020 0 : ret = 0;
70021 : }
70022 6 : Py_XDECREF(name_attr);
70023 6 : return ret;
70024 : }
70025 12 : static int __Pyx_setup_reduce(PyObject* type_obj) {
70026 12 : int ret = 0;
70027 12 : PyObject *object_reduce = NULL;
70028 12 : PyObject *object_getstate = NULL;
70029 12 : PyObject *object_reduce_ex = NULL;
70030 12 : PyObject *reduce = NULL;
70031 12 : PyObject *reduce_ex = NULL;
70032 12 : PyObject *reduce_cython = NULL;
70033 12 : PyObject *setstate = NULL;
70034 12 : PyObject *setstate_cython = NULL;
70035 12 : PyObject *getstate = NULL;
70036 : #if CYTHON_USE_PYTYPE_LOOKUP
70037 12 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
70038 : #else
70039 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
70040 : if (!getstate && PyErr_Occurred()) {
70041 : goto __PYX_BAD;
70042 : }
70043 : #endif
70044 12 : if (getstate) {
70045 : #if CYTHON_USE_PYTYPE_LOOKUP
70046 12 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
70047 : #else
70048 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
70049 : if (!object_getstate && PyErr_Occurred()) {
70050 : goto __PYX_BAD;
70051 : }
70052 : #endif
70053 12 : if (object_getstate != getstate) {
70054 0 : goto __PYX_GOOD;
70055 : }
70056 : }
70057 : #if CYTHON_USE_PYTYPE_LOOKUP
70058 12 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
70059 : #else
70060 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
70061 : #endif
70062 12 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
70063 12 : if (reduce_ex == object_reduce_ex) {
70064 : #if CYTHON_USE_PYTYPE_LOOKUP
70065 12 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
70066 : #else
70067 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
70068 : #endif
70069 12 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
70070 12 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
70071 12 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
70072 12 : if (likely(reduce_cython)) {
70073 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
70074 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
70075 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
70076 0 : goto __PYX_BAD;
70077 : }
70078 12 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
70079 12 : if (!setstate) PyErr_Clear();
70080 12 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
70081 12 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
70082 12 : if (likely(setstate_cython)) {
70083 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
70084 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
70085 0 : } else if (!setstate || PyErr_Occurred()) {
70086 0 : goto __PYX_BAD;
70087 : }
70088 : }
70089 12 : PyType_Modified((PyTypeObject*)type_obj);
70090 : }
70091 : }
70092 12 : goto __PYX_GOOD;
70093 0 : __PYX_BAD:
70094 0 : if (!PyErr_Occurred()) {
70095 0 : __Pyx_TypeName type_obj_name =
70096 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
70097 0 : PyErr_Format(PyExc_RuntimeError,
70098 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
70099 : __Pyx_DECREF_TypeName(type_obj_name);
70100 : }
70101 : ret = -1;
70102 12 : __PYX_GOOD:
70103 : #if !CYTHON_USE_PYTYPE_LOOKUP
70104 : Py_XDECREF(object_reduce);
70105 : Py_XDECREF(object_reduce_ex);
70106 : Py_XDECREF(object_getstate);
70107 : Py_XDECREF(getstate);
70108 : #endif
70109 12 : Py_XDECREF(reduce);
70110 12 : Py_XDECREF(reduce_ex);
70111 12 : Py_XDECREF(reduce_cython);
70112 12 : Py_XDECREF(setstate);
70113 12 : Py_XDECREF(setstate_cython);
70114 12 : return ret;
70115 : }
70116 : #endif
70117 :
70118 : /* TypeImport */
70119 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
70120 : #define __PYX_HAVE_RT_ImportType_3_0_11
70121 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
70122 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
70123 : {
70124 48 : PyObject *result = 0;
70125 48 : char warning[200];
70126 48 : Py_ssize_t basicsize;
70127 48 : Py_ssize_t itemsize;
70128 : #if CYTHON_COMPILING_IN_LIMITED_API
70129 : PyObject *py_basicsize;
70130 : PyObject *py_itemsize;
70131 : #endif
70132 48 : result = PyObject_GetAttrString(module, class_name);
70133 48 : if (!result)
70134 0 : goto bad;
70135 48 : if (!PyType_Check(result)) {
70136 0 : PyErr_Format(PyExc_TypeError,
70137 : "%.200s.%.200s is not a type object",
70138 : module_name, class_name);
70139 0 : goto bad;
70140 : }
70141 : #if !CYTHON_COMPILING_IN_LIMITED_API
70142 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
70143 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
70144 : #else
70145 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
70146 : if (!py_basicsize)
70147 : goto bad;
70148 : basicsize = PyLong_AsSsize_t(py_basicsize);
70149 : Py_DECREF(py_basicsize);
70150 : py_basicsize = 0;
70151 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
70152 : goto bad;
70153 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
70154 : if (!py_itemsize)
70155 : goto bad;
70156 : itemsize = PyLong_AsSsize_t(py_itemsize);
70157 : Py_DECREF(py_itemsize);
70158 : py_itemsize = 0;
70159 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
70160 : goto bad;
70161 : #endif
70162 48 : if (itemsize) {
70163 3 : if (size % alignment) {
70164 0 : alignment = size % alignment;
70165 : }
70166 3 : if (itemsize < (Py_ssize_t)alignment)
70167 : itemsize = (Py_ssize_t)alignment;
70168 : }
70169 48 : if ((size_t)(basicsize + itemsize) < size) {
70170 0 : PyErr_Format(PyExc_ValueError,
70171 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
70172 : "Expected %zd from C header, got %zd from PyObject",
70173 : module_name, class_name, size, basicsize+itemsize);
70174 0 : goto bad;
70175 : }
70176 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
70177 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
70178 0 : PyErr_Format(PyExc_ValueError,
70179 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
70180 : "Expected %zd from C header, got %zd-%zd from PyObject",
70181 : module_name, class_name, size, basicsize, basicsize+itemsize);
70182 0 : goto bad;
70183 : }
70184 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
70185 0 : PyOS_snprintf(warning, sizeof(warning),
70186 : "%s.%s size changed, may indicate binary incompatibility. "
70187 : "Expected %zd from C header, got %zd from PyObject",
70188 : module_name, class_name, size, basicsize);
70189 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
70190 : }
70191 : return (PyTypeObject *)result;
70192 0 : bad:
70193 0 : Py_XDECREF(result);
70194 0 : return NULL;
70195 : }
70196 : #endif
70197 :
70198 : /* FetchSharedCythonModule */
70199 3 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
70200 3 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
70201 : }
70202 :
70203 : /* FetchCommonType */
70204 3 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
70205 : const char *name,
70206 : Py_ssize_t basicsize,
70207 : Py_ssize_t expected_basicsize) {
70208 3 : if (!PyType_Check(cached_type)) {
70209 0 : PyErr_Format(PyExc_TypeError,
70210 : "Shared Cython type %.200s is not a type object", name);
70211 0 : return -1;
70212 : }
70213 3 : if (basicsize != expected_basicsize) {
70214 0 : PyErr_Format(PyExc_TypeError,
70215 : "Shared Cython type %.200s has the wrong size, try recompiling",
70216 : name);
70217 0 : return -1;
70218 : }
70219 : return 0;
70220 : }
70221 : #if !CYTHON_USE_TYPE_SPECS
70222 3 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
70223 3 : PyObject* abi_module;
70224 3 : const char* object_name;
70225 3 : PyTypeObject *cached_type = NULL;
70226 3 : abi_module = __Pyx_FetchSharedCythonABIModule();
70227 3 : if (!abi_module) return NULL;
70228 3 : object_name = strrchr(type->tp_name, '.');
70229 3 : object_name = object_name ? object_name+1 : type->tp_name;
70230 3 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
70231 3 : if (cached_type) {
70232 3 : if (__Pyx_VerifyCachedType(
70233 : (PyObject *)cached_type,
70234 : object_name,
70235 : cached_type->tp_basicsize,
70236 : type->tp_basicsize) < 0) {
70237 0 : goto bad;
70238 : }
70239 3 : goto done;
70240 : }
70241 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
70242 0 : PyErr_Clear();
70243 0 : if (PyType_Ready(type) < 0) goto bad;
70244 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
70245 0 : goto bad;
70246 0 : Py_INCREF(type);
70247 : cached_type = type;
70248 3 : done:
70249 3 : Py_DECREF(abi_module);
70250 : return cached_type;
70251 0 : bad:
70252 0 : Py_XDECREF(cached_type);
70253 0 : cached_type = NULL;
70254 0 : goto done;
70255 : }
70256 : #else
70257 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
70258 : PyObject *abi_module, *cached_type = NULL;
70259 : const char* object_name = strrchr(spec->name, '.');
70260 : object_name = object_name ? object_name+1 : spec->name;
70261 : abi_module = __Pyx_FetchSharedCythonABIModule();
70262 : if (!abi_module) return NULL;
70263 : cached_type = PyObject_GetAttrString(abi_module, object_name);
70264 : if (cached_type) {
70265 : Py_ssize_t basicsize;
70266 : #if CYTHON_COMPILING_IN_LIMITED_API
70267 : PyObject *py_basicsize;
70268 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
70269 : if (unlikely(!py_basicsize)) goto bad;
70270 : basicsize = PyLong_AsSsize_t(py_basicsize);
70271 : Py_DECREF(py_basicsize);
70272 : py_basicsize = 0;
70273 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
70274 : #else
70275 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
70276 : #endif
70277 : if (__Pyx_VerifyCachedType(
70278 : cached_type,
70279 : object_name,
70280 : basicsize,
70281 : spec->basicsize) < 0) {
70282 : goto bad;
70283 : }
70284 : goto done;
70285 : }
70286 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
70287 : PyErr_Clear();
70288 : CYTHON_UNUSED_VAR(module);
70289 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
70290 : if (unlikely(!cached_type)) goto bad;
70291 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
70292 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
70293 : done:
70294 : Py_DECREF(abi_module);
70295 : assert(cached_type == NULL || PyType_Check(cached_type));
70296 : return (PyTypeObject *) cached_type;
70297 : bad:
70298 : Py_XDECREF(cached_type);
70299 : cached_type = NULL;
70300 : goto done;
70301 : }
70302 : #endif
70303 :
70304 : /* PyVectorcallFastCallDict */
70305 : #if CYTHON_METH_FASTCALL
70306 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
70307 : {
70308 0 : PyObject *res = NULL;
70309 0 : PyObject *kwnames;
70310 0 : PyObject **newargs;
70311 0 : PyObject **kwvalues;
70312 0 : Py_ssize_t i, pos;
70313 0 : size_t j;
70314 0 : PyObject *key, *value;
70315 0 : unsigned long keys_are_strings;
70316 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
70317 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
70318 0 : if (unlikely(newargs == NULL)) {
70319 0 : PyErr_NoMemory();
70320 0 : return NULL;
70321 : }
70322 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
70323 0 : kwnames = PyTuple_New(nkw);
70324 0 : if (unlikely(kwnames == NULL)) {
70325 0 : PyMem_Free(newargs);
70326 0 : return NULL;
70327 : }
70328 0 : kwvalues = newargs + nargs;
70329 0 : pos = i = 0;
70330 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
70331 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
70332 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
70333 0 : Py_INCREF(key);
70334 0 : Py_INCREF(value);
70335 0 : PyTuple_SET_ITEM(kwnames, i, key);
70336 0 : kwvalues[i] = value;
70337 0 : i++;
70338 : }
70339 0 : if (unlikely(!keys_are_strings)) {
70340 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
70341 0 : goto cleanup;
70342 : }
70343 0 : res = vc(func, newargs, nargs, kwnames);
70344 0 : cleanup:
70345 0 : Py_DECREF(kwnames);
70346 0 : for (i = 0; i < nkw; i++)
70347 0 : Py_DECREF(kwvalues[i]);
70348 0 : PyMem_Free(newargs);
70349 0 : return res;
70350 : }
70351 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
70352 : {
70353 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
70354 0 : return vc(func, args, nargs, NULL);
70355 : }
70356 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
70357 : }
70358 : #endif
70359 :
70360 : /* CythonFunctionShared */
70361 : #if CYTHON_COMPILING_IN_LIMITED_API
70362 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
70363 : if (__Pyx_CyFunction_Check(func)) {
70364 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
70365 : } else if (PyCFunction_Check(func)) {
70366 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
70367 : }
70368 : return 0;
70369 : }
70370 : #else
70371 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
70372 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
70373 : }
70374 : #endif
70375 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
70376 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
70377 : __Pyx_Py_XDECREF_SET(
70378 : __Pyx_CyFunction_GetClassObj(f),
70379 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
70380 : #else
70381 : __Pyx_Py_XDECREF_SET(
70382 : ((PyCMethodObject *) (f))->mm_class,
70383 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
70384 : #endif
70385 : }
70386 : static PyObject *
70387 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
70388 : {
70389 0 : CYTHON_UNUSED_VAR(closure);
70390 0 : if (unlikely(op->func_doc == NULL)) {
70391 : #if CYTHON_COMPILING_IN_LIMITED_API
70392 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
70393 : if (unlikely(!op->func_doc)) return NULL;
70394 : #else
70395 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
70396 : #if PY_MAJOR_VERSION >= 3
70397 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
70398 : #else
70399 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
70400 : #endif
70401 0 : if (unlikely(op->func_doc == NULL))
70402 : return NULL;
70403 : } else {
70404 0 : Py_INCREF(Py_None);
70405 0 : return Py_None;
70406 : }
70407 : #endif
70408 : }
70409 0 : Py_INCREF(op->func_doc);
70410 : return op->func_doc;
70411 : }
70412 : static int
70413 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
70414 : {
70415 0 : CYTHON_UNUSED_VAR(context);
70416 0 : if (value == NULL) {
70417 0 : value = Py_None;
70418 : }
70419 0 : Py_INCREF(value);
70420 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
70421 0 : return 0;
70422 : }
70423 : static PyObject *
70424 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
70425 : {
70426 0 : CYTHON_UNUSED_VAR(context);
70427 0 : if (unlikely(op->func_name == NULL)) {
70428 : #if CYTHON_COMPILING_IN_LIMITED_API
70429 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
70430 : #elif PY_MAJOR_VERSION >= 3
70431 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
70432 : #else
70433 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
70434 : #endif
70435 0 : if (unlikely(op->func_name == NULL))
70436 : return NULL;
70437 : }
70438 0 : Py_INCREF(op->func_name);
70439 : return op->func_name;
70440 : }
70441 : static int
70442 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
70443 : {
70444 0 : CYTHON_UNUSED_VAR(context);
70445 : #if PY_MAJOR_VERSION >= 3
70446 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
70447 : #else
70448 : if (unlikely(value == NULL || !PyString_Check(value)))
70449 : #endif
70450 : {
70451 0 : PyErr_SetString(PyExc_TypeError,
70452 : "__name__ must be set to a string object");
70453 0 : return -1;
70454 : }
70455 0 : Py_INCREF(value);
70456 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
70457 0 : return 0;
70458 : }
70459 : static PyObject *
70460 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
70461 : {
70462 0 : CYTHON_UNUSED_VAR(context);
70463 0 : Py_INCREF(op->func_qualname);
70464 0 : return op->func_qualname;
70465 : }
70466 : static int
70467 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
70468 : {
70469 0 : CYTHON_UNUSED_VAR(context);
70470 : #if PY_MAJOR_VERSION >= 3
70471 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
70472 : #else
70473 : if (unlikely(value == NULL || !PyString_Check(value)))
70474 : #endif
70475 : {
70476 0 : PyErr_SetString(PyExc_TypeError,
70477 : "__qualname__ must be set to a string object");
70478 0 : return -1;
70479 : }
70480 0 : Py_INCREF(value);
70481 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
70482 0 : return 0;
70483 : }
70484 : static PyObject *
70485 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
70486 : {
70487 0 : CYTHON_UNUSED_VAR(context);
70488 0 : if (unlikely(op->func_dict == NULL)) {
70489 0 : op->func_dict = PyDict_New();
70490 0 : if (unlikely(op->func_dict == NULL))
70491 : return NULL;
70492 : }
70493 0 : Py_INCREF(op->func_dict);
70494 : return op->func_dict;
70495 : }
70496 : static int
70497 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
70498 : {
70499 0 : CYTHON_UNUSED_VAR(context);
70500 0 : if (unlikely(value == NULL)) {
70501 0 : PyErr_SetString(PyExc_TypeError,
70502 : "function's dictionary may not be deleted");
70503 0 : return -1;
70504 : }
70505 0 : if (unlikely(!PyDict_Check(value))) {
70506 0 : PyErr_SetString(PyExc_TypeError,
70507 : "setting function's dictionary to a non-dict");
70508 0 : return -1;
70509 : }
70510 0 : Py_INCREF(value);
70511 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
70512 0 : return 0;
70513 : }
70514 : static PyObject *
70515 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
70516 : {
70517 0 : CYTHON_UNUSED_VAR(context);
70518 0 : Py_INCREF(op->func_globals);
70519 0 : return op->func_globals;
70520 : }
70521 : static PyObject *
70522 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
70523 : {
70524 0 : CYTHON_UNUSED_VAR(op);
70525 0 : CYTHON_UNUSED_VAR(context);
70526 0 : Py_INCREF(Py_None);
70527 0 : return Py_None;
70528 : }
70529 : static PyObject *
70530 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
70531 : {
70532 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
70533 0 : CYTHON_UNUSED_VAR(context);
70534 0 : Py_INCREF(result);
70535 0 : return result;
70536 : }
70537 : static int
70538 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
70539 0 : int result = 0;
70540 0 : PyObject *res = op->defaults_getter((PyObject *) op);
70541 0 : if (unlikely(!res))
70542 : return -1;
70543 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
70544 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
70545 0 : Py_INCREF(op->defaults_tuple);
70546 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
70547 0 : Py_INCREF(op->defaults_kwdict);
70548 : #else
70549 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
70550 : if (unlikely(!op->defaults_tuple)) result = -1;
70551 : else {
70552 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
70553 : if (unlikely(!op->defaults_kwdict)) result = -1;
70554 : }
70555 : #endif
70556 0 : Py_DECREF(res);
70557 : return result;
70558 : }
70559 : static int
70560 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
70561 0 : CYTHON_UNUSED_VAR(context);
70562 0 : if (!value) {
70563 : value = Py_None;
70564 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
70565 0 : PyErr_SetString(PyExc_TypeError,
70566 : "__defaults__ must be set to a tuple object");
70567 0 : return -1;
70568 : }
70569 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
70570 : "currently affect the values used in function calls", 1);
70571 0 : Py_INCREF(value);
70572 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
70573 0 : return 0;
70574 : }
70575 : static PyObject *
70576 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
70577 0 : PyObject* result = op->defaults_tuple;
70578 0 : CYTHON_UNUSED_VAR(context);
70579 0 : if (unlikely(!result)) {
70580 0 : if (op->defaults_getter) {
70581 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
70582 0 : result = op->defaults_tuple;
70583 : } else {
70584 : result = Py_None;
70585 : }
70586 : }
70587 0 : Py_INCREF(result);
70588 : return result;
70589 : }
70590 : static int
70591 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
70592 0 : CYTHON_UNUSED_VAR(context);
70593 0 : if (!value) {
70594 : value = Py_None;
70595 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
70596 0 : PyErr_SetString(PyExc_TypeError,
70597 : "__kwdefaults__ must be set to a dict object");
70598 0 : return -1;
70599 : }
70600 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
70601 : "currently affect the values used in function calls", 1);
70602 0 : Py_INCREF(value);
70603 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
70604 0 : return 0;
70605 : }
70606 : static PyObject *
70607 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
70608 0 : PyObject* result = op->defaults_kwdict;
70609 0 : CYTHON_UNUSED_VAR(context);
70610 0 : if (unlikely(!result)) {
70611 0 : if (op->defaults_getter) {
70612 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
70613 0 : result = op->defaults_kwdict;
70614 : } else {
70615 : result = Py_None;
70616 : }
70617 : }
70618 0 : Py_INCREF(result);
70619 : return result;
70620 : }
70621 : static int
70622 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
70623 0 : CYTHON_UNUSED_VAR(context);
70624 0 : if (!value || value == Py_None) {
70625 : value = NULL;
70626 0 : } else if (unlikely(!PyDict_Check(value))) {
70627 0 : PyErr_SetString(PyExc_TypeError,
70628 : "__annotations__ must be set to a dict object");
70629 0 : return -1;
70630 : }
70631 0 : Py_XINCREF(value);
70632 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
70633 0 : return 0;
70634 : }
70635 : static PyObject *
70636 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
70637 0 : PyObject* result = op->func_annotations;
70638 0 : CYTHON_UNUSED_VAR(context);
70639 0 : if (unlikely(!result)) {
70640 0 : result = PyDict_New();
70641 0 : if (unlikely(!result)) return NULL;
70642 0 : op->func_annotations = result;
70643 : }
70644 0 : Py_INCREF(result);
70645 : return result;
70646 : }
70647 : static PyObject *
70648 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
70649 0 : int is_coroutine;
70650 0 : CYTHON_UNUSED_VAR(context);
70651 0 : if (op->func_is_coroutine) {
70652 0 : return __Pyx_NewRef(op->func_is_coroutine);
70653 : }
70654 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
70655 : #if PY_VERSION_HEX >= 0x03050000
70656 0 : if (is_coroutine) {
70657 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
70658 0 : fromlist = PyList_New(1);
70659 0 : if (unlikely(!fromlist)) return NULL;
70660 0 : Py_INCREF(marker);
70661 : #if CYTHON_ASSUME_SAFE_MACROS
70662 0 : PyList_SET_ITEM(fromlist, 0, marker);
70663 : #else
70664 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
70665 : Py_DECREF(marker);
70666 : Py_DECREF(fromlist);
70667 : return NULL;
70668 : }
70669 : #endif
70670 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
70671 0 : Py_DECREF(fromlist);
70672 0 : if (unlikely(!module)) goto ignore;
70673 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
70674 0 : Py_DECREF(module);
70675 0 : if (likely(op->func_is_coroutine)) {
70676 0 : return __Pyx_NewRef(op->func_is_coroutine);
70677 : }
70678 0 : ignore:
70679 0 : PyErr_Clear();
70680 : }
70681 : #endif
70682 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
70683 0 : return __Pyx_NewRef(op->func_is_coroutine);
70684 : }
70685 : #if CYTHON_COMPILING_IN_LIMITED_API
70686 : static PyObject *
70687 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
70688 : CYTHON_UNUSED_VAR(context);
70689 : return PyObject_GetAttrString(op->func, "__module__");
70690 : }
70691 : static int
70692 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
70693 : CYTHON_UNUSED_VAR(context);
70694 : return PyObject_SetAttrString(op->func, "__module__", value);
70695 : }
70696 : #endif
70697 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
70698 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
70699 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
70700 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
70701 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
70702 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
70703 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
70704 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
70705 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
70706 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
70707 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
70708 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
70709 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
70710 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
70711 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
70712 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
70713 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
70714 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
70715 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
70716 : #if CYTHON_COMPILING_IN_LIMITED_API
70717 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
70718 : #endif
70719 : {0, 0, 0, 0, 0}
70720 : };
70721 : static PyMemberDef __pyx_CyFunction_members[] = {
70722 : #if !CYTHON_COMPILING_IN_LIMITED_API
70723 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
70724 : #endif
70725 : #if CYTHON_USE_TYPE_SPECS
70726 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
70727 : #if CYTHON_METH_FASTCALL
70728 : #if CYTHON_BACKPORT_VECTORCALL
70729 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
70730 : #else
70731 : #if !CYTHON_COMPILING_IN_LIMITED_API
70732 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
70733 : #endif
70734 : #endif
70735 : #endif
70736 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
70737 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
70738 : #else
70739 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
70740 : #endif
70741 : #endif
70742 : {0, 0, 0, 0, 0}
70743 : };
70744 : static PyObject *
70745 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
70746 : {
70747 0 : CYTHON_UNUSED_VAR(args);
70748 : #if PY_MAJOR_VERSION >= 3
70749 0 : Py_INCREF(m->func_qualname);
70750 0 : return m->func_qualname;
70751 : #else
70752 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
70753 : #endif
70754 : }
70755 : static PyMethodDef __pyx_CyFunction_methods[] = {
70756 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
70757 : {0, 0, 0, 0}
70758 : };
70759 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
70760 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
70761 : #else
70762 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
70763 : #endif
70764 120 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
70765 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
70766 : #if !CYTHON_COMPILING_IN_LIMITED_API
70767 120 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
70768 : #endif
70769 120 : if (unlikely(op == NULL))
70770 : return NULL;
70771 : #if CYTHON_COMPILING_IN_LIMITED_API
70772 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
70773 : if (unlikely(!op->func)) return NULL;
70774 : #endif
70775 120 : op->flags = flags;
70776 120 : __Pyx_CyFunction_weakreflist(op) = NULL;
70777 : #if !CYTHON_COMPILING_IN_LIMITED_API
70778 120 : cf->m_ml = ml;
70779 120 : cf->m_self = (PyObject *) op;
70780 : #endif
70781 120 : Py_XINCREF(closure);
70782 120 : op->func_closure = closure;
70783 : #if !CYTHON_COMPILING_IN_LIMITED_API
70784 120 : Py_XINCREF(module);
70785 120 : cf->m_module = module;
70786 : #endif
70787 120 : op->func_dict = NULL;
70788 120 : op->func_name = NULL;
70789 120 : Py_INCREF(qualname);
70790 120 : op->func_qualname = qualname;
70791 120 : op->func_doc = NULL;
70792 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
70793 : op->func_classobj = NULL;
70794 : #else
70795 120 : ((PyCMethodObject*)op)->mm_class = NULL;
70796 : #endif
70797 120 : op->func_globals = globals;
70798 120 : Py_INCREF(op->func_globals);
70799 120 : Py_XINCREF(code);
70800 120 : op->func_code = code;
70801 120 : op->defaults_pyobjects = 0;
70802 120 : op->defaults_size = 0;
70803 120 : op->defaults = NULL;
70804 120 : op->defaults_tuple = NULL;
70805 120 : op->defaults_kwdict = NULL;
70806 120 : op->defaults_getter = NULL;
70807 120 : op->func_annotations = NULL;
70808 120 : op->func_is_coroutine = NULL;
70809 : #if CYTHON_METH_FASTCALL
70810 120 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
70811 0 : case METH_NOARGS:
70812 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
70813 0 : break;
70814 0 : case METH_O:
70815 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
70816 0 : break;
70817 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
70818 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
70819 0 : break;
70820 120 : case METH_FASTCALL | METH_KEYWORDS:
70821 120 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
70822 120 : break;
70823 0 : case METH_VARARGS | METH_KEYWORDS:
70824 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
70825 0 : break;
70826 0 : default:
70827 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
70828 0 : Py_DECREF(op);
70829 : return NULL;
70830 : }
70831 : #endif
70832 : return (PyObject *) op;
70833 : }
70834 : static int
70835 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
70836 : {
70837 0 : Py_CLEAR(m->func_closure);
70838 : #if CYTHON_COMPILING_IN_LIMITED_API
70839 : Py_CLEAR(m->func);
70840 : #else
70841 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
70842 : #endif
70843 0 : Py_CLEAR(m->func_dict);
70844 0 : Py_CLEAR(m->func_name);
70845 0 : Py_CLEAR(m->func_qualname);
70846 0 : Py_CLEAR(m->func_doc);
70847 0 : Py_CLEAR(m->func_globals);
70848 0 : Py_CLEAR(m->func_code);
70849 : #if !CYTHON_COMPILING_IN_LIMITED_API
70850 : #if PY_VERSION_HEX < 0x030900B1
70851 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
70852 : #else
70853 : {
70854 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
70855 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
70856 0 : Py_XDECREF(cls);
70857 : }
70858 : #endif
70859 : #endif
70860 0 : Py_CLEAR(m->defaults_tuple);
70861 0 : Py_CLEAR(m->defaults_kwdict);
70862 0 : Py_CLEAR(m->func_annotations);
70863 0 : Py_CLEAR(m->func_is_coroutine);
70864 0 : if (m->defaults) {
70865 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
70866 : int i;
70867 0 : for (i = 0; i < m->defaults_pyobjects; i++)
70868 0 : Py_XDECREF(pydefaults[i]);
70869 0 : PyObject_Free(m->defaults);
70870 0 : m->defaults = NULL;
70871 : }
70872 0 : return 0;
70873 : }
70874 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
70875 : {
70876 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
70877 0 : PyObject_ClearWeakRefs((PyObject *) m);
70878 0 : __Pyx_CyFunction_clear(m);
70879 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
70880 0 : }
70881 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
70882 : {
70883 0 : PyObject_GC_UnTrack(m);
70884 0 : __Pyx__CyFunction_dealloc(m);
70885 0 : }
70886 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
70887 : {
70888 0 : Py_VISIT(m->func_closure);
70889 : #if CYTHON_COMPILING_IN_LIMITED_API
70890 : Py_VISIT(m->func);
70891 : #else
70892 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
70893 : #endif
70894 0 : Py_VISIT(m->func_dict);
70895 0 : Py_VISIT(m->func_name);
70896 0 : Py_VISIT(m->func_qualname);
70897 0 : Py_VISIT(m->func_doc);
70898 0 : Py_VISIT(m->func_globals);
70899 0 : Py_VISIT(m->func_code);
70900 : #if !CYTHON_COMPILING_IN_LIMITED_API
70901 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
70902 : #endif
70903 0 : Py_VISIT(m->defaults_tuple);
70904 0 : Py_VISIT(m->defaults_kwdict);
70905 0 : Py_VISIT(m->func_is_coroutine);
70906 0 : if (m->defaults) {
70907 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
70908 : int i;
70909 0 : for (i = 0; i < m->defaults_pyobjects; i++)
70910 0 : Py_VISIT(pydefaults[i]);
70911 : }
70912 : return 0;
70913 : }
70914 : static PyObject*
70915 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
70916 : {
70917 : #if PY_MAJOR_VERSION >= 3
70918 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
70919 : op->func_qualname, (void *)op);
70920 : #else
70921 : return PyString_FromFormat("<cyfunction %s at %p>",
70922 : PyString_AsString(op->func_qualname), (void *)op);
70923 : #endif
70924 : }
70925 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
70926 : #if CYTHON_COMPILING_IN_LIMITED_API
70927 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
70928 : PyObject *py_name = NULL;
70929 : PyCFunction meth;
70930 : int flags;
70931 : meth = PyCFunction_GetFunction(f);
70932 : if (unlikely(!meth)) return NULL;
70933 : flags = PyCFunction_GetFlags(f);
70934 : if (unlikely(flags < 0)) return NULL;
70935 : #else
70936 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
70937 0 : PyCFunction meth = f->m_ml->ml_meth;
70938 0 : int flags = f->m_ml->ml_flags;
70939 : #endif
70940 0 : Py_ssize_t size;
70941 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
70942 0 : case METH_VARARGS:
70943 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
70944 0 : return (*meth)(self, arg);
70945 : break;
70946 0 : case METH_VARARGS | METH_KEYWORDS:
70947 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
70948 0 : case METH_NOARGS:
70949 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
70950 : #if CYTHON_ASSUME_SAFE_MACROS
70951 0 : size = PyTuple_GET_SIZE(arg);
70952 : #else
70953 : size = PyTuple_Size(arg);
70954 : if (unlikely(size < 0)) return NULL;
70955 : #endif
70956 0 : if (likely(size == 0))
70957 0 : return (*meth)(self, NULL);
70958 : #if CYTHON_COMPILING_IN_LIMITED_API
70959 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
70960 : if (!py_name) return NULL;
70961 : PyErr_Format(PyExc_TypeError,
70962 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
70963 : py_name, size);
70964 : Py_DECREF(py_name);
70965 : #else
70966 0 : PyErr_Format(PyExc_TypeError,
70967 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
70968 0 : f->m_ml->ml_name, size);
70969 : #endif
70970 0 : return NULL;
70971 : }
70972 : break;
70973 0 : case METH_O:
70974 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
70975 : #if CYTHON_ASSUME_SAFE_MACROS
70976 0 : size = PyTuple_GET_SIZE(arg);
70977 : #else
70978 : size = PyTuple_Size(arg);
70979 : if (unlikely(size < 0)) return NULL;
70980 : #endif
70981 0 : if (likely(size == 1)) {
70982 0 : PyObject *result, *arg0;
70983 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
70984 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
70985 : #else
70986 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
70987 : #endif
70988 0 : result = (*meth)(self, arg0);
70989 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
70990 : Py_DECREF(arg0);
70991 : #endif
70992 0 : return result;
70993 : }
70994 : #if CYTHON_COMPILING_IN_LIMITED_API
70995 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
70996 : if (!py_name) return NULL;
70997 : PyErr_Format(PyExc_TypeError,
70998 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
70999 : py_name, size);
71000 : Py_DECREF(py_name);
71001 : #else
71002 0 : PyErr_Format(PyExc_TypeError,
71003 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
71004 0 : f->m_ml->ml_name, size);
71005 : #endif
71006 0 : return NULL;
71007 : }
71008 : break;
71009 0 : default:
71010 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
71011 0 : return NULL;
71012 : }
71013 : #if CYTHON_COMPILING_IN_LIMITED_API
71014 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
71015 : if (!py_name) return NULL;
71016 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
71017 : py_name);
71018 : Py_DECREF(py_name);
71019 : #else
71020 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
71021 0 : f->m_ml->ml_name);
71022 : #endif
71023 0 : return NULL;
71024 : }
71025 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
71026 0 : PyObject *self, *result;
71027 : #if CYTHON_COMPILING_IN_LIMITED_API
71028 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
71029 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
71030 : #else
71031 0 : self = ((PyCFunctionObject*)func)->m_self;
71032 : #endif
71033 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
71034 0 : return result;
71035 : }
71036 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
71037 0 : PyObject *result;
71038 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
71039 : #if CYTHON_METH_FASTCALL
71040 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
71041 0 : if (vc) {
71042 : #if CYTHON_ASSUME_SAFE_MACROS
71043 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
71044 : #else
71045 : (void) &__Pyx_PyVectorcall_FastCallDict;
71046 : return PyVectorcall_Call(func, args, kw);
71047 : #endif
71048 : }
71049 : #endif
71050 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
71051 0 : Py_ssize_t argc;
71052 0 : PyObject *new_args;
71053 0 : PyObject *self;
71054 : #if CYTHON_ASSUME_SAFE_MACROS
71055 0 : argc = PyTuple_GET_SIZE(args);
71056 : #else
71057 : argc = PyTuple_Size(args);
71058 : if (unlikely(!argc) < 0) return NULL;
71059 : #endif
71060 0 : new_args = PyTuple_GetSlice(args, 1, argc);
71061 0 : if (unlikely(!new_args))
71062 : return NULL;
71063 0 : self = PyTuple_GetItem(args, 0);
71064 0 : if (unlikely(!self)) {
71065 0 : Py_DECREF(new_args);
71066 : #if PY_MAJOR_VERSION > 2
71067 0 : PyErr_Format(PyExc_TypeError,
71068 : "unbound method %.200S() needs an argument",
71069 : cyfunc->func_qualname);
71070 : #else
71071 : PyErr_SetString(PyExc_TypeError,
71072 : "unbound method needs an argument");
71073 : #endif
71074 0 : return NULL;
71075 : }
71076 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
71077 0 : Py_DECREF(new_args);
71078 : } else {
71079 0 : result = __Pyx_CyFunction_Call(func, args, kw);
71080 : }
71081 : return result;
71082 : }
71083 : #if CYTHON_METH_FASTCALL
71084 230 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
71085 : {
71086 230 : int ret = 0;
71087 230 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
71088 0 : if (unlikely(nargs < 1)) {
71089 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
71090 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
71091 0 : return -1;
71092 : }
71093 : ret = 1;
71094 : }
71095 230 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
71096 0 : PyErr_Format(PyExc_TypeError,
71097 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
71098 0 : return -1;
71099 : }
71100 : return ret;
71101 : }
71102 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
71103 : {
71104 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
71105 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
71106 : #if CYTHON_BACKPORT_VECTORCALL
71107 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
71108 : #else
71109 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
71110 : #endif
71111 0 : PyObject *self;
71112 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
71113 0 : case 1:
71114 0 : self = args[0];
71115 0 : args += 1;
71116 0 : nargs -= 1;
71117 0 : break;
71118 0 : case 0:
71119 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
71120 0 : break;
71121 : default:
71122 : return NULL;
71123 : }
71124 0 : if (unlikely(nargs != 0)) {
71125 0 : PyErr_Format(PyExc_TypeError,
71126 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
71127 : def->ml_name, nargs);
71128 0 : return NULL;
71129 : }
71130 0 : return def->ml_meth(self, NULL);
71131 : }
71132 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
71133 : {
71134 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
71135 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
71136 : #if CYTHON_BACKPORT_VECTORCALL
71137 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
71138 : #else
71139 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
71140 : #endif
71141 0 : PyObject *self;
71142 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
71143 0 : case 1:
71144 0 : self = args[0];
71145 0 : args += 1;
71146 0 : nargs -= 1;
71147 0 : break;
71148 0 : case 0:
71149 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
71150 0 : break;
71151 : default:
71152 : return NULL;
71153 : }
71154 0 : if (unlikely(nargs != 1)) {
71155 0 : PyErr_Format(PyExc_TypeError,
71156 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
71157 : def->ml_name, nargs);
71158 0 : return NULL;
71159 : }
71160 0 : return def->ml_meth(self, args[0]);
71161 : }
71162 230 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
71163 : {
71164 230 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
71165 230 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
71166 : #if CYTHON_BACKPORT_VECTORCALL
71167 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
71168 : #else
71169 230 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
71170 : #endif
71171 230 : PyObject *self;
71172 230 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
71173 0 : case 1:
71174 0 : self = args[0];
71175 0 : args += 1;
71176 0 : nargs -= 1;
71177 0 : break;
71178 230 : case 0:
71179 230 : self = ((PyCFunctionObject*)cyfunc)->m_self;
71180 230 : break;
71181 : default:
71182 : return NULL;
71183 : }
71184 230 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
71185 : }
71186 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
71187 : {
71188 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
71189 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
71190 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
71191 : #if CYTHON_BACKPORT_VECTORCALL
71192 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
71193 : #else
71194 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
71195 : #endif
71196 0 : PyObject *self;
71197 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
71198 0 : case 1:
71199 0 : self = args[0];
71200 0 : args += 1;
71201 0 : nargs -= 1;
71202 0 : break;
71203 0 : case 0:
71204 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
71205 0 : break;
71206 : default:
71207 : return NULL;
71208 : }
71209 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
71210 : }
71211 : #endif
71212 : #if CYTHON_USE_TYPE_SPECS
71213 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
71214 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
71215 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
71216 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
71217 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
71218 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
71219 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
71220 : {Py_tp_members, (void *)__pyx_CyFunction_members},
71221 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
71222 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
71223 : {0, 0},
71224 : };
71225 : static PyType_Spec __pyx_CyFunctionType_spec = {
71226 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
71227 : sizeof(__pyx_CyFunctionObject),
71228 : 0,
71229 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
71230 : Py_TPFLAGS_METHOD_DESCRIPTOR |
71231 : #endif
71232 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
71233 : _Py_TPFLAGS_HAVE_VECTORCALL |
71234 : #endif
71235 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
71236 : __pyx_CyFunctionType_slots
71237 : };
71238 : #else
71239 : static PyTypeObject __pyx_CyFunctionType_type = {
71240 : PyVarObject_HEAD_INIT(0, 0)
71241 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
71242 : sizeof(__pyx_CyFunctionObject),
71243 : 0,
71244 : (destructor) __Pyx_CyFunction_dealloc,
71245 : #if !CYTHON_METH_FASTCALL
71246 : 0,
71247 : #elif CYTHON_BACKPORT_VECTORCALL
71248 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
71249 : #else
71250 : offsetof(PyCFunctionObject, vectorcall),
71251 : #endif
71252 : 0,
71253 : 0,
71254 : #if PY_MAJOR_VERSION < 3
71255 : 0,
71256 : #else
71257 : 0,
71258 : #endif
71259 : (reprfunc) __Pyx_CyFunction_repr,
71260 : 0,
71261 : 0,
71262 : 0,
71263 : 0,
71264 : __Pyx_CyFunction_CallAsMethod,
71265 : 0,
71266 : 0,
71267 : 0,
71268 : 0,
71269 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
71270 : Py_TPFLAGS_METHOD_DESCRIPTOR |
71271 : #endif
71272 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
71273 : _Py_TPFLAGS_HAVE_VECTORCALL |
71274 : #endif
71275 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
71276 : 0,
71277 : (traverseproc) __Pyx_CyFunction_traverse,
71278 : (inquiry) __Pyx_CyFunction_clear,
71279 : 0,
71280 : #if PY_VERSION_HEX < 0x030500A0
71281 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
71282 : #else
71283 : offsetof(PyCFunctionObject, m_weakreflist),
71284 : #endif
71285 : 0,
71286 : 0,
71287 : __pyx_CyFunction_methods,
71288 : __pyx_CyFunction_members,
71289 : __pyx_CyFunction_getsets,
71290 : 0,
71291 : 0,
71292 : __Pyx_PyMethod_New,
71293 : 0,
71294 : offsetof(__pyx_CyFunctionObject, func_dict),
71295 : 0,
71296 : 0,
71297 : 0,
71298 : 0,
71299 : 0,
71300 : 0,
71301 : 0,
71302 : 0,
71303 : 0,
71304 : 0,
71305 : 0,
71306 : 0,
71307 : #if PY_VERSION_HEX >= 0x030400a1
71308 : 0,
71309 : #endif
71310 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
71311 : 0,
71312 : #endif
71313 : #if __PYX_NEED_TP_PRINT_SLOT
71314 : 0,
71315 : #endif
71316 : #if PY_VERSION_HEX >= 0x030C0000
71317 : 0,
71318 : #endif
71319 : #if PY_VERSION_HEX >= 0x030d00A4
71320 : 0,
71321 : #endif
71322 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
71323 : 0,
71324 : #endif
71325 : };
71326 : #endif
71327 3 : static int __pyx_CyFunction_init(PyObject *module) {
71328 : #if CYTHON_USE_TYPE_SPECS
71329 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
71330 : #else
71331 3 : CYTHON_UNUSED_VAR(module);
71332 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
71333 : #endif
71334 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
71335 0 : return -1;
71336 : }
71337 : return 0;
71338 : }
71339 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
71340 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71341 : m->defaults = PyObject_Malloc(size);
71342 : if (unlikely(!m->defaults))
71343 : return PyErr_NoMemory();
71344 : memset(m->defaults, 0, size);
71345 : m->defaults_pyobjects = pyobjects;
71346 : m->defaults_size = size;
71347 : return m->defaults;
71348 : }
71349 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
71350 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71351 : m->defaults_tuple = tuple;
71352 : Py_INCREF(tuple);
71353 : }
71354 12 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
71355 12 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71356 12 : m->defaults_kwdict = dict;
71357 12 : Py_INCREF(dict);
71358 : }
71359 78 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
71360 78 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71361 78 : m->func_annotations = dict;
71362 156 : Py_INCREF(dict);
71363 : }
71364 :
71365 : /* CythonFunction */
71366 120 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
71367 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
71368 120 : PyObject *op = __Pyx_CyFunction_Init(
71369 120 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
71370 : ml, flags, qualname, closure, module, globals, code
71371 : );
71372 120 : if (likely(op)) {
71373 120 : PyObject_GC_Track(op);
71374 : }
71375 120 : return op;
71376 : }
71377 :
71378 : /* CLineInTraceback */
71379 : #ifndef CYTHON_CLINE_IN_TRACEBACK
71380 0 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
71381 0 : PyObject *use_cline;
71382 0 : PyObject *ptype, *pvalue, *ptraceback;
71383 : #if CYTHON_COMPILING_IN_CPYTHON
71384 0 : PyObject **cython_runtime_dict;
71385 : #endif
71386 0 : CYTHON_MAYBE_UNUSED_VAR(tstate);
71387 0 : if (unlikely(!__pyx_cython_runtime)) {
71388 : return c_line;
71389 : }
71390 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
71391 : #if CYTHON_COMPILING_IN_CPYTHON
71392 0 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
71393 0 : if (likely(cython_runtime_dict)) {
71394 0 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
71395 : use_cline, *cython_runtime_dict,
71396 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
71397 : } else
71398 : #endif
71399 : {
71400 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
71401 0 : if (use_cline_obj) {
71402 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
71403 0 : Py_DECREF(use_cline_obj);
71404 : } else {
71405 0 : PyErr_Clear();
71406 0 : use_cline = NULL;
71407 : }
71408 : }
71409 0 : if (!use_cline) {
71410 0 : c_line = 0;
71411 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
71412 : }
71413 0 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
71414 : c_line = 0;
71415 : }
71416 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
71417 0 : return c_line;
71418 : }
71419 : #endif
71420 :
71421 : /* CodeObjectCache */
71422 : #if !CYTHON_COMPILING_IN_LIMITED_API
71423 0 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
71424 0 : int start = 0, mid = 0, end = count - 1;
71425 0 : if (end >= 0 && code_line > entries[end].code_line) {
71426 : return count;
71427 : }
71428 0 : while (start < end) {
71429 0 : mid = start + (end - start) / 2;
71430 0 : if (code_line < entries[mid].code_line) {
71431 : end = mid;
71432 0 : } else if (code_line > entries[mid].code_line) {
71433 0 : start = mid + 1;
71434 : } else {
71435 0 : return mid;
71436 : }
71437 : }
71438 0 : if (code_line <= entries[mid].code_line) {
71439 : return mid;
71440 : } else {
71441 0 : return mid + 1;
71442 : }
71443 : }
71444 0 : static PyCodeObject *__pyx_find_code_object(int code_line) {
71445 0 : PyCodeObject* code_object;
71446 0 : int pos;
71447 0 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
71448 : return NULL;
71449 : }
71450 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
71451 0 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
71452 : return NULL;
71453 : }
71454 0 : code_object = __pyx_code_cache.entries[pos].code_object;
71455 0 : Py_INCREF(code_object);
71456 : return code_object;
71457 : }
71458 0 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
71459 0 : int pos, i;
71460 0 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
71461 0 : if (unlikely(!code_line)) {
71462 : return;
71463 : }
71464 0 : if (unlikely(!entries)) {
71465 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
71466 0 : if (likely(entries)) {
71467 0 : __pyx_code_cache.entries = entries;
71468 0 : __pyx_code_cache.max_count = 64;
71469 0 : __pyx_code_cache.count = 1;
71470 0 : entries[0].code_line = code_line;
71471 0 : entries[0].code_object = code_object;
71472 0 : Py_INCREF(code_object);
71473 : }
71474 0 : return;
71475 : }
71476 0 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
71477 0 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
71478 0 : PyCodeObject* tmp = entries[pos].code_object;
71479 0 : entries[pos].code_object = code_object;
71480 0 : Py_DECREF(tmp);
71481 0 : return;
71482 : }
71483 0 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
71484 0 : int new_max = __pyx_code_cache.max_count + 64;
71485 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
71486 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
71487 0 : if (unlikely(!entries)) {
71488 : return;
71489 : }
71490 0 : __pyx_code_cache.entries = entries;
71491 0 : __pyx_code_cache.max_count = new_max;
71492 : }
71493 0 : for (i=__pyx_code_cache.count; i>pos; i--) {
71494 0 : entries[i] = entries[i-1];
71495 : }
71496 0 : entries[pos].code_line = code_line;
71497 0 : entries[pos].code_object = code_object;
71498 0 : __pyx_code_cache.count++;
71499 0 : Py_INCREF(code_object);
71500 : }
71501 : #endif
71502 :
71503 : /* AddTraceback */
71504 : #include "compile.h"
71505 : #include "frameobject.h"
71506 : #include "traceback.h"
71507 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
71508 : #ifndef Py_BUILD_CORE
71509 : #define Py_BUILD_CORE 1
71510 : #endif
71511 : #include "internal/pycore_frame.h"
71512 : #endif
71513 : #if CYTHON_COMPILING_IN_LIMITED_API
71514 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
71515 : PyObject *firstlineno, PyObject *name) {
71516 : PyObject *replace = NULL;
71517 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
71518 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
71519 : replace = PyObject_GetAttrString(code, "replace");
71520 : if (likely(replace)) {
71521 : PyObject *result;
71522 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
71523 : Py_DECREF(replace);
71524 : return result;
71525 : }
71526 : PyErr_Clear();
71527 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
71528 : {
71529 : PyObject *compiled = NULL, *result = NULL;
71530 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
71531 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
71532 : compiled = Py_CompileString(
71533 : "out = type(code)(\n"
71534 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
71535 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
71536 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
71537 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
71538 : if (!compiled) return NULL;
71539 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
71540 : Py_DECREF(compiled);
71541 : if (!result) PyErr_Print();
71542 : Py_DECREF(result);
71543 : result = PyDict_GetItemString(scratch_dict, "out");
71544 : if (result) Py_INCREF(result);
71545 : return result;
71546 : }
71547 : #else
71548 : return NULL;
71549 : #endif
71550 : }
71551 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
71552 : int py_line, const char *filename) {
71553 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
71554 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
71555 : PyObject *exc_type, *exc_value, *exc_traceback;
71556 : int success = 0;
71557 : if (c_line) {
71558 : (void) __pyx_cfilenm;
71559 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
71560 : }
71561 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
71562 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
71563 : if (unlikely(!code_object)) goto bad;
71564 : py_py_line = PyLong_FromLong(py_line);
71565 : if (unlikely(!py_py_line)) goto bad;
71566 : py_funcname = PyUnicode_FromString(funcname);
71567 : if (unlikely(!py_funcname)) goto bad;
71568 : dict = PyDict_New();
71569 : if (unlikely(!dict)) goto bad;
71570 : {
71571 : PyObject *old_code_object = code_object;
71572 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
71573 : Py_DECREF(old_code_object);
71574 : }
71575 : if (unlikely(!code_object)) goto bad;
71576 : getframe = PySys_GetObject("_getframe");
71577 : if (unlikely(!getframe)) goto bad;
71578 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
71579 : frame = PyEval_EvalCode(code_object, dict, dict);
71580 : if (unlikely(!frame) || frame == Py_None) goto bad;
71581 : success = 1;
71582 : bad:
71583 : PyErr_Restore(exc_type, exc_value, exc_traceback);
71584 : Py_XDECREF(code_object);
71585 : Py_XDECREF(py_py_line);
71586 : Py_XDECREF(py_funcname);
71587 : Py_XDECREF(dict);
71588 : Py_XDECREF(replace);
71589 : if (success) {
71590 : PyTraceBack_Here(
71591 : (struct _frame*)frame);
71592 : }
71593 : Py_XDECREF(frame);
71594 : }
71595 : #else
71596 0 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
71597 : const char *funcname, int c_line,
71598 : int py_line, const char *filename) {
71599 0 : PyCodeObject *py_code = NULL;
71600 0 : PyObject *py_funcname = NULL;
71601 : #if PY_MAJOR_VERSION < 3
71602 : PyObject *py_srcfile = NULL;
71603 : py_srcfile = PyString_FromString(filename);
71604 : if (!py_srcfile) goto bad;
71605 : #endif
71606 0 : if (c_line) {
71607 : #if PY_MAJOR_VERSION < 3
71608 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
71609 : if (!py_funcname) goto bad;
71610 : #else
71611 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
71612 0 : if (!py_funcname) goto bad;
71613 0 : funcname = PyUnicode_AsUTF8(py_funcname);
71614 0 : if (!funcname) goto bad;
71615 : #endif
71616 : }
71617 : else {
71618 : #if PY_MAJOR_VERSION < 3
71619 : py_funcname = PyString_FromString(funcname);
71620 : if (!py_funcname) goto bad;
71621 : #endif
71622 0 : }
71623 : #if PY_MAJOR_VERSION < 3
71624 : py_code = __Pyx_PyCode_New(
71625 : 0,
71626 : 0,
71627 : 0,
71628 : 0,
71629 : 0,
71630 : 0,
71631 : __pyx_empty_bytes, /*PyObject *code,*/
71632 : __pyx_empty_tuple, /*PyObject *consts,*/
71633 : __pyx_empty_tuple, /*PyObject *names,*/
71634 : __pyx_empty_tuple, /*PyObject *varnames,*/
71635 : __pyx_empty_tuple, /*PyObject *freevars,*/
71636 : __pyx_empty_tuple, /*PyObject *cellvars,*/
71637 : py_srcfile, /*PyObject *filename,*/
71638 : py_funcname, /*PyObject *name,*/
71639 : py_line,
71640 : __pyx_empty_bytes /*PyObject *lnotab*/
71641 : );
71642 : Py_DECREF(py_srcfile);
71643 : #else
71644 0 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
71645 : #endif
71646 0 : Py_XDECREF(py_funcname);
71647 0 : return py_code;
71648 0 : bad:
71649 0 : Py_XDECREF(py_funcname);
71650 : #if PY_MAJOR_VERSION < 3
71651 : Py_XDECREF(py_srcfile);
71652 : #endif
71653 0 : return NULL;
71654 : }
71655 0 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
71656 : int py_line, const char *filename) {
71657 0 : PyCodeObject *py_code = 0;
71658 0 : PyFrameObject *py_frame = 0;
71659 0 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
71660 0 : PyObject *ptype, *pvalue, *ptraceback;
71661 0 : if (c_line) {
71662 0 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
71663 : }
71664 0 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
71665 0 : if (!py_code) {
71666 0 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
71667 0 : py_code = __Pyx_CreateCodeObjectForTraceback(
71668 : funcname, c_line, py_line, filename);
71669 0 : if (!py_code) {
71670 : /* If the code object creation fails, then we should clear the
71671 : fetched exception references and propagate the new exception */
71672 0 : Py_XDECREF(ptype);
71673 0 : Py_XDECREF(pvalue);
71674 0 : Py_XDECREF(ptraceback);
71675 0 : goto bad;
71676 : }
71677 0 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
71678 0 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
71679 : }
71680 0 : py_frame = PyFrame_New(
71681 : tstate, /*PyThreadState *tstate,*/
71682 : py_code, /*PyCodeObject *code,*/
71683 0 : __pyx_d, /*PyObject *globals,*/
71684 : 0 /*PyObject *locals*/
71685 : );
71686 0 : if (!py_frame) goto bad;
71687 0 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
71688 0 : PyTraceBack_Here(py_frame);
71689 0 : bad:
71690 0 : Py_XDECREF(py_code);
71691 0 : Py_XDECREF(py_frame);
71692 0 : }
71693 : #endif
71694 :
71695 : #if PY_MAJOR_VERSION < 3
71696 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
71697 : __Pyx_TypeName obj_type_name;
71698 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
71699 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
71700 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
71701 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
71702 : PyErr_Format(PyExc_TypeError,
71703 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
71704 : obj_type_name);
71705 : __Pyx_DECREF_TypeName(obj_type_name);
71706 : return -1;
71707 : }
71708 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
71709 : PyObject *obj = view->obj;
71710 : if (!obj) return;
71711 : if (PyObject_CheckBuffer(obj)) {
71712 : PyBuffer_Release(view);
71713 : return;
71714 : }
71715 : if ((0)) {}
71716 : view->obj = NULL;
71717 : Py_DECREF(obj);
71718 : }
71719 : #endif
71720 :
71721 :
71722 : /* MemviewSliceIsContig */
71723 : static int
71724 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
71725 : {
71726 0 : int i, index, step, start;
71727 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
71728 0 : if (order == 'F') {
71729 : step = 1;
71730 : start = 0;
71731 : } else {
71732 0 : step = -1;
71733 0 : start = ndim - 1;
71734 : }
71735 0 : for (i = 0; i < ndim; i++) {
71736 0 : index = start + step * i;
71737 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
71738 : return 0;
71739 0 : itemsize *= mvs.shape[index];
71740 : }
71741 : return 1;
71742 : }
71743 :
71744 : /* OverlappingSlices */
71745 : static void
71746 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
71747 : void **out_start, void **out_end,
71748 : int ndim, size_t itemsize)
71749 : {
71750 0 : char *start, *end;
71751 0 : int i;
71752 0 : start = end = slice->data;
71753 0 : for (i = 0; i < ndim; i++) {
71754 0 : Py_ssize_t stride = slice->strides[i];
71755 0 : Py_ssize_t extent = slice->shape[i];
71756 0 : if (extent == 0) {
71757 0 : *out_start = *out_end = start;
71758 0 : return;
71759 : } else {
71760 0 : if (stride > 0)
71761 0 : end += stride * (extent - 1);
71762 : else
71763 0 : start += stride * (extent - 1);
71764 : }
71765 : }
71766 0 : *out_start = start;
71767 0 : *out_end = end + itemsize;
71768 : }
71769 : static int
71770 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
71771 : __Pyx_memviewslice *slice2,
71772 : int ndim, size_t itemsize)
71773 : {
71774 0 : void *start1, *end1, *start2, *end2;
71775 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
71776 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
71777 0 : return (start1 < end2) && (start2 < end1);
71778 : }
71779 :
71780 : /* Declarations */
71781 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
71782 : #ifdef __cplusplus
71783 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71784 : return ::std::complex< double >(x, y);
71785 : }
71786 : #else
71787 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71788 : return x + y*(__pyx_t_double_complex)_Complex_I;
71789 : }
71790 : #endif
71791 : #else
71792 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71793 : __pyx_t_double_complex z;
71794 736 : z.real = x;
71795 733 : z.imag = y;
71796 : return z;
71797 : }
71798 : #endif
71799 :
71800 : /* Arithmetic */
71801 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
71802 : #else
71803 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71804 : return (a.real == b.real) && (a.imag == b.imag);
71805 : }
71806 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71807 : __pyx_t_double_complex z;
71808 : z.real = a.real + b.real;
71809 : z.imag = a.imag + b.imag;
71810 : return z;
71811 : }
71812 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71813 : __pyx_t_double_complex z;
71814 : z.real = a.real - b.real;
71815 : z.imag = a.imag - b.imag;
71816 : return z;
71817 : }
71818 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71819 : __pyx_t_double_complex z;
71820 : z.real = a.real * b.real - a.imag * b.imag;
71821 : z.imag = a.real * b.imag + a.imag * b.real;
71822 : return z;
71823 : }
71824 : #if 1
71825 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71826 : if (b.imag == 0) {
71827 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
71828 : } else if (fabs(b.real) >= fabs(b.imag)) {
71829 : if (b.real == 0 && b.imag == 0) {
71830 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
71831 : } else {
71832 : double r = b.imag / b.real;
71833 : double s = (double)(1.0) / (b.real + b.imag * r);
71834 : return __pyx_t_double_complex_from_parts(
71835 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
71836 : }
71837 : } else {
71838 : double r = b.real / b.imag;
71839 : double s = (double)(1.0) / (b.imag + b.real * r);
71840 : return __pyx_t_double_complex_from_parts(
71841 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
71842 : }
71843 : }
71844 : #else
71845 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71846 : if (b.imag == 0) {
71847 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
71848 : } else {
71849 : double denom = b.real * b.real + b.imag * b.imag;
71850 : return __pyx_t_double_complex_from_parts(
71851 : (a.real * b.real + a.imag * b.imag) / denom,
71852 : (a.imag * b.real - a.real * b.imag) / denom);
71853 : }
71854 : }
71855 : #endif
71856 0 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
71857 0 : __pyx_t_double_complex z;
71858 0 : z.real = -a.real;
71859 0 : z.imag = -a.imag;
71860 0 : return z;
71861 : }
71862 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
71863 : return (a.real == 0) && (a.imag == 0);
71864 : }
71865 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
71866 : __pyx_t_double_complex z;
71867 : z.real = a.real;
71868 : z.imag = -a.imag;
71869 : return z;
71870 : }
71871 : #if 1
71872 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
71873 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
71874 : return sqrt(z.real*z.real + z.imag*z.imag);
71875 : #else
71876 : return hypot(z.real, z.imag);
71877 : #endif
71878 : }
71879 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71880 : __pyx_t_double_complex z;
71881 : double r, lnr, theta, z_r, z_theta;
71882 : if (b.imag == 0 && b.real == (int)b.real) {
71883 : if (b.real < 0) {
71884 : double denom = a.real * a.real + a.imag * a.imag;
71885 : a.real = a.real / denom;
71886 : a.imag = -a.imag / denom;
71887 : b.real = -b.real;
71888 : }
71889 : switch ((int)b.real) {
71890 : case 0:
71891 : z.real = 1;
71892 : z.imag = 0;
71893 : return z;
71894 : case 1:
71895 : return a;
71896 : case 2:
71897 : return __Pyx_c_prod_double(a, a);
71898 : case 3:
71899 : z = __Pyx_c_prod_double(a, a);
71900 : return __Pyx_c_prod_double(z, a);
71901 : case 4:
71902 : z = __Pyx_c_prod_double(a, a);
71903 : return __Pyx_c_prod_double(z, z);
71904 : }
71905 : }
71906 : if (a.imag == 0) {
71907 : if (a.real == 0) {
71908 : return a;
71909 : } else if ((b.imag == 0) && (a.real >= 0)) {
71910 : z.real = pow(a.real, b.real);
71911 : z.imag = 0;
71912 : return z;
71913 : } else if (a.real > 0) {
71914 : r = a.real;
71915 : theta = 0;
71916 : } else {
71917 : r = -a.real;
71918 : theta = atan2(0.0, -1.0);
71919 : }
71920 : } else {
71921 : r = __Pyx_c_abs_double(a);
71922 : theta = atan2(a.imag, a.real);
71923 : }
71924 : lnr = log(r);
71925 : z_r = exp(lnr * b.real - theta * b.imag);
71926 : z_theta = theta * b.real + lnr * b.imag;
71927 : z.real = z_r * cos(z_theta);
71928 : z.imag = z_r * sin(z_theta);
71929 : return z;
71930 : }
71931 : #endif
71932 : #endif
71933 :
71934 : /* CIntFromPyVerify */
71935 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
71936 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
71937 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
71938 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
71939 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
71940 : {\
71941 : func_type value = func_value;\
71942 : if (sizeof(target_type) < sizeof(func_type)) {\
71943 : if (unlikely(value != (func_type) (target_type) value)) {\
71944 : func_type zero = 0;\
71945 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
71946 : return (target_type) -1;\
71947 : if (is_unsigned && unlikely(value < zero))\
71948 : goto raise_neg_overflow;\
71949 : else\
71950 : goto raise_overflow;\
71951 : }\
71952 : }\
71953 : return (target_type) value;\
71954 : }
71955 :
71956 : /* TypeInfoCompare */
71957 : static int
71958 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
71959 : {
71960 0 : int i;
71961 0 : if (!a || !b)
71962 : return 0;
71963 0 : if (a == b)
71964 : return 1;
71965 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
71966 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
71967 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
71968 0 : return a->size == b->size;
71969 : } else {
71970 : return 0;
71971 : }
71972 : }
71973 0 : if (a->ndim) {
71974 0 : for (i = 0; i < a->ndim; i++)
71975 0 : if (a->arraysize[i] != b->arraysize[i])
71976 : return 0;
71977 : }
71978 0 : if (a->typegroup == 'S') {
71979 0 : if (a->flags != b->flags)
71980 : return 0;
71981 0 : if (a->fields || b->fields) {
71982 0 : if (!(a->fields && b->fields))
71983 : return 0;
71984 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
71985 0 : __Pyx_StructField *field_a = a->fields + i;
71986 0 : __Pyx_StructField *field_b = b->fields + i;
71987 0 : if (field_a->offset != field_b->offset ||
71988 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
71989 0 : return 0;
71990 : }
71991 0 : return !a->fields[i].type && !b->fields[i].type;
71992 : }
71993 : }
71994 : return 1;
71995 : }
71996 :
71997 : /* MemviewSliceValidateAndInit */
71998 : static int
71999 230 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
72000 : {
72001 230 : if (buf->shape[dim] <= 1)
72002 : return 1;
72003 230 : if (buf->strides) {
72004 230 : if (spec & __Pyx_MEMVIEW_CONTIG) {
72005 219 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
72006 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
72007 0 : PyErr_Format(PyExc_ValueError,
72008 : "Buffer is not indirectly contiguous "
72009 : "in dimension %d.", dim);
72010 0 : goto fail;
72011 : }
72012 219 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
72013 0 : PyErr_SetString(PyExc_ValueError,
72014 : "Buffer and memoryview are not contiguous "
72015 : "in the same dimension.");
72016 0 : goto fail;
72017 : }
72018 : }
72019 230 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
72020 11 : Py_ssize_t stride = buf->strides[dim];
72021 11 : if (stride < 0)
72022 : stride = -stride;
72023 11 : if (unlikely(stride < buf->itemsize)) {
72024 0 : PyErr_SetString(PyExc_ValueError,
72025 : "Buffer and memoryview are not contiguous "
72026 : "in the same dimension.");
72027 0 : goto fail;
72028 : }
72029 : }
72030 : } else {
72031 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
72032 0 : PyErr_Format(PyExc_ValueError,
72033 : "C-contiguous buffer is not contiguous in "
72034 : "dimension %d", dim);
72035 0 : goto fail;
72036 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
72037 0 : PyErr_Format(PyExc_ValueError,
72038 : "C-contiguous buffer is not indirect in "
72039 : "dimension %d", dim);
72040 0 : goto fail;
72041 0 : } else if (unlikely(buf->suboffsets)) {
72042 0 : PyErr_SetString(PyExc_ValueError,
72043 : "Buffer exposes suboffsets but no strides");
72044 0 : goto fail;
72045 : }
72046 : }
72047 : return 1;
72048 : fail:
72049 : return 0;
72050 : }
72051 : static int
72052 230 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
72053 : {
72054 230 : CYTHON_UNUSED_VAR(ndim);
72055 230 : if (spec & __Pyx_MEMVIEW_DIRECT) {
72056 230 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
72057 0 : PyErr_Format(PyExc_ValueError,
72058 : "Buffer not compatible with direct access "
72059 : "in dimension %d.", dim);
72060 0 : goto fail;
72061 : }
72062 : }
72063 230 : if (spec & __Pyx_MEMVIEW_PTR) {
72064 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
72065 0 : PyErr_Format(PyExc_ValueError,
72066 : "Buffer is not indirectly accessible "
72067 : "in dimension %d.", dim);
72068 0 : goto fail;
72069 : }
72070 : }
72071 : return 1;
72072 : fail:
72073 : return 0;
72074 : }
72075 : static int
72076 219 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
72077 : {
72078 219 : int i;
72079 219 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
72080 : Py_ssize_t stride = 1;
72081 0 : for (i = 0; i < ndim; i++) {
72082 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
72083 0 : PyErr_SetString(PyExc_ValueError,
72084 : "Buffer not fortran contiguous.");
72085 0 : goto fail;
72086 : }
72087 0 : stride = stride * buf->shape[i];
72088 : }
72089 219 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
72090 219 : Py_ssize_t stride = 1;
72091 449 : for (i = ndim - 1; i >- 1; i--) {
72092 230 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
72093 0 : PyErr_SetString(PyExc_ValueError,
72094 : "Buffer not C contiguous.");
72095 0 : goto fail;
72096 : }
72097 230 : stride = stride * buf->shape[i];
72098 : }
72099 : }
72100 : return 1;
72101 : fail:
72102 : return 0;
72103 : }
72104 219 : static int __Pyx_ValidateAndInit_memviewslice(
72105 : int *axes_specs,
72106 : int c_or_f_flag,
72107 : int buf_flags,
72108 : int ndim,
72109 : __Pyx_TypeInfo *dtype,
72110 : __Pyx_BufFmt_StackElem stack[],
72111 : __Pyx_memviewslice *memviewslice,
72112 : PyObject *original_obj)
72113 : {
72114 219 : struct __pyx_memoryview_obj *memview, *new_memview;
72115 : __Pyx_RefNannyDeclarations
72116 219 : Py_buffer *buf;
72117 219 : int i, spec = 0, retval = -1;
72118 219 : __Pyx_BufFmt_Context ctx;
72119 219 : int from_memoryview = __pyx_memoryview_check(original_obj);
72120 219 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
72121 219 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
72122 : original_obj)->typeinfo)) {
72123 : memview = (struct __pyx_memoryview_obj *) original_obj;
72124 : new_memview = NULL;
72125 : } else {
72126 219 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
72127 : original_obj, buf_flags, 0, dtype);
72128 219 : new_memview = memview;
72129 219 : if (unlikely(!memview))
72130 0 : goto fail;
72131 : }
72132 219 : buf = &memview->view;
72133 219 : if (unlikely(buf->ndim != ndim)) {
72134 0 : PyErr_Format(PyExc_ValueError,
72135 : "Buffer has wrong number of dimensions (expected %d, got %d)",
72136 : ndim, buf->ndim);
72137 0 : goto fail;
72138 : }
72139 219 : if (new_memview) {
72140 219 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
72141 219 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
72142 : }
72143 219 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
72144 0 : PyErr_Format(PyExc_ValueError,
72145 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
72146 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
72147 : buf->itemsize,
72148 : (buf->itemsize > 1) ? "s" : "",
72149 : dtype->name,
72150 : dtype->size,
72151 : (dtype->size > 1) ? "s" : "");
72152 0 : goto fail;
72153 : }
72154 219 : if (buf->len > 0) {
72155 449 : for (i = 0; i < ndim; i++) {
72156 230 : spec = axes_specs[i];
72157 230 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
72158 0 : goto fail;
72159 230 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
72160 0 : goto fail;
72161 : }
72162 219 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
72163 0 : goto fail;
72164 : }
72165 219 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
72166 : new_memview != NULL) == -1)) {
72167 0 : goto fail;
72168 : }
72169 219 : retval = 0;
72170 219 : goto no_fail;
72171 0 : fail:
72172 0 : Py_XDECREF(new_memview);
72173 0 : retval = -1;
72174 219 : no_fail:
72175 219 : __Pyx_RefNannyFinishContext();
72176 219 : return retval;
72177 : }
72178 :
72179 : /* ObjectToMemviewSlice */
72180 6 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
72181 6 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
72182 6 : __Pyx_BufFmt_StackElem stack[1];
72183 6 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
72184 6 : int retcode;
72185 6 : if (obj == Py_None) {
72186 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
72187 0 : return result;
72188 : }
72189 6 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
72190 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
72191 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
72192 : &result, obj);
72193 6 : if (unlikely(retcode == -1))
72194 0 : goto __pyx_fail;
72195 6 : return result;
72196 0 : __pyx_fail:
72197 0 : result.memview = NULL;
72198 0 : result.data = NULL;
72199 0 : return result;
72200 : }
72201 :
72202 : /* ObjectToMemviewSlice */
72203 116 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
72204 116 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
72205 116 : __Pyx_BufFmt_StackElem stack[1];
72206 116 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
72207 116 : int retcode;
72208 116 : if (obj == Py_None) {
72209 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
72210 0 : return result;
72211 : }
72212 116 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
72213 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
72214 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
72215 : &result, obj);
72216 116 : if (unlikely(retcode == -1))
72217 0 : goto __pyx_fail;
72218 116 : return result;
72219 0 : __pyx_fail:
72220 0 : result.memview = NULL;
72221 0 : result.data = NULL;
72222 0 : return result;
72223 : }
72224 :
72225 : /* ObjectToMemviewSlice */
72226 5 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
72227 5 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
72228 5 : __Pyx_BufFmt_StackElem stack[1];
72229 5 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
72230 5 : int retcode;
72231 5 : if (obj == Py_None) {
72232 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
72233 0 : return result;
72234 : }
72235 5 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
72236 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
72237 : &__Pyx_TypeInfo___pyx_t_double_complex, stack,
72238 : &result, obj);
72239 5 : if (unlikely(retcode == -1))
72240 0 : goto __pyx_fail;
72241 5 : return result;
72242 0 : __pyx_fail:
72243 0 : result.memview = NULL;
72244 0 : result.data = NULL;
72245 0 : return result;
72246 : }
72247 :
72248 : /* ObjectToMemviewSlice */
72249 92 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex(PyObject *obj, int writable_flag) {
72250 92 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
72251 92 : __Pyx_BufFmt_StackElem stack[1];
72252 92 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
72253 92 : int retcode;
72254 92 : if (obj == Py_None) {
72255 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
72256 0 : return result;
72257 : }
72258 92 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
72259 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
72260 : &__Pyx_TypeInfo___pyx_t_double_complex, stack,
72261 : &result, obj);
72262 92 : if (unlikely(retcode == -1))
72263 0 : goto __pyx_fail;
72264 92 : return result;
72265 0 : __pyx_fail:
72266 0 : result.memview = NULL;
72267 0 : result.data = NULL;
72268 0 : return result;
72269 : }
72270 :
72271 : /* Declarations */
72272 : #if CYTHON_CCOMPLEX && (1) && (!1 || __cplusplus)
72273 : #ifdef __cplusplus
72274 : static CYTHON_INLINE __pyx_t_npy_float64_complex __pyx_t_npy_float64_complex_from_parts(npy_float64 x, npy_float64 y) {
72275 : return ::std::complex< npy_float64 >(x, y);
72276 : }
72277 : #else
72278 : static CYTHON_INLINE __pyx_t_npy_float64_complex __pyx_t_npy_float64_complex_from_parts(npy_float64 x, npy_float64 y) {
72279 : return x + y*(__pyx_t_npy_float64_complex)_Complex_I;
72280 : }
72281 : #endif
72282 : #else
72283 : static CYTHON_INLINE __pyx_t_npy_float64_complex __pyx_t_npy_float64_complex_from_parts(npy_float64 x, npy_float64 y) {
72284 : __pyx_t_npy_float64_complex z;
72285 59 : z.real = x;
72286 59 : z.imag = y;
72287 : return z;
72288 : }
72289 : #endif
72290 :
72291 : /* Arithmetic */
72292 : #if CYTHON_CCOMPLEX && (1) && (!1 || __cplusplus)
72293 : #else
72294 : static CYTHON_INLINE int __Pyx_c_eq_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72295 : return (a.real == b.real) && (a.imag == b.imag);
72296 : }
72297 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_sum_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72298 : __pyx_t_npy_float64_complex z;
72299 : z.real = a.real + b.real;
72300 : z.imag = a.imag + b.imag;
72301 : return z;
72302 : }
72303 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_diff_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72304 : __pyx_t_npy_float64_complex z;
72305 : z.real = a.real - b.real;
72306 : z.imag = a.imag - b.imag;
72307 : return z;
72308 : }
72309 59 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_prod_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72310 59 : __pyx_t_npy_float64_complex z;
72311 59 : z.real = a.real * b.real - a.imag * b.imag;
72312 59 : z.imag = a.real * b.imag + a.imag * b.real;
72313 59 : return z;
72314 : }
72315 : #if 1
72316 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_quot_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72317 : if (b.imag == 0) {
72318 : return __pyx_t_npy_float64_complex_from_parts(a.real / b.real, a.imag / b.real);
72319 : } else if (fabs(b.real) >= fabs(b.imag)) {
72320 : if (b.real == 0 && b.imag == 0) {
72321 : return __pyx_t_npy_float64_complex_from_parts(a.real / b.real, a.imag / b.imag);
72322 : } else {
72323 : npy_float64 r = b.imag / b.real;
72324 : npy_float64 s = (npy_float64)(1.0) / (b.real + b.imag * r);
72325 : return __pyx_t_npy_float64_complex_from_parts(
72326 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
72327 : }
72328 : } else {
72329 : npy_float64 r = b.real / b.imag;
72330 : npy_float64 s = (npy_float64)(1.0) / (b.imag + b.real * r);
72331 : return __pyx_t_npy_float64_complex_from_parts(
72332 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
72333 : }
72334 : }
72335 : #else
72336 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_quot_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72337 : if (b.imag == 0) {
72338 : return __pyx_t_npy_float64_complex_from_parts(a.real / b.real, a.imag / b.real);
72339 : } else {
72340 : npy_float64 denom = b.real * b.real + b.imag * b.imag;
72341 : return __pyx_t_npy_float64_complex_from_parts(
72342 : (a.real * b.real + a.imag * b.imag) / denom,
72343 : (a.imag * b.real - a.real * b.imag) / denom);
72344 : }
72345 : }
72346 : #endif
72347 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_neg_npy_float64(__pyx_t_npy_float64_complex a) {
72348 : __pyx_t_npy_float64_complex z;
72349 : z.real = -a.real;
72350 : z.imag = -a.imag;
72351 : return z;
72352 : }
72353 : static CYTHON_INLINE int __Pyx_c_is_zero_npy_float64(__pyx_t_npy_float64_complex a) {
72354 : return (a.real == 0) && (a.imag == 0);
72355 : }
72356 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_conj_npy_float64(__pyx_t_npy_float64_complex a) {
72357 : __pyx_t_npy_float64_complex z;
72358 : z.real = a.real;
72359 : z.imag = -a.imag;
72360 : return z;
72361 : }
72362 : #if 1
72363 : static CYTHON_INLINE npy_float64 __Pyx_c_abs_npy_float64(__pyx_t_npy_float64_complex z) {
72364 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
72365 : return sqrt(z.real*z.real + z.imag*z.imag);
72366 : #else
72367 : return hypot(z.real, z.imag);
72368 : #endif
72369 : }
72370 : static CYTHON_INLINE __pyx_t_npy_float64_complex __Pyx_c_pow_npy_float64(__pyx_t_npy_float64_complex a, __pyx_t_npy_float64_complex b) {
72371 : __pyx_t_npy_float64_complex z;
72372 : npy_float64 r, lnr, theta, z_r, z_theta;
72373 : if (b.imag == 0 && b.real == (int)b.real) {
72374 : if (b.real < 0) {
72375 : npy_float64 denom = a.real * a.real + a.imag * a.imag;
72376 : a.real = a.real / denom;
72377 : a.imag = -a.imag / denom;
72378 : b.real = -b.real;
72379 : }
72380 : switch ((int)b.real) {
72381 : case 0:
72382 : z.real = 1;
72383 : z.imag = 0;
72384 : return z;
72385 : case 1:
72386 : return a;
72387 : case 2:
72388 : return __Pyx_c_prod_npy_float64(a, a);
72389 : case 3:
72390 : z = __Pyx_c_prod_npy_float64(a, a);
72391 : return __Pyx_c_prod_npy_float64(z, a);
72392 : case 4:
72393 : z = __Pyx_c_prod_npy_float64(a, a);
72394 : return __Pyx_c_prod_npy_float64(z, z);
72395 : }
72396 : }
72397 : if (a.imag == 0) {
72398 : if (a.real == 0) {
72399 : return a;
72400 : } else if ((b.imag == 0) && (a.real >= 0)) {
72401 : z.real = pow(a.real, b.real);
72402 : z.imag = 0;
72403 : return z;
72404 : } else if (a.real > 0) {
72405 : r = a.real;
72406 : theta = 0;
72407 : } else {
72408 : r = -a.real;
72409 : theta = atan2(0.0, -1.0);
72410 : }
72411 : } else {
72412 : r = __Pyx_c_abs_npy_float64(a);
72413 : theta = atan2(a.imag, a.real);
72414 : }
72415 : lnr = log(r);
72416 : z_r = exp(lnr * b.real - theta * b.imag);
72417 : z_theta = theta * b.real + lnr * b.imag;
72418 : z.real = z_r * cos(z_theta);
72419 : z.imag = z_r * sin(z_theta);
72420 : return z;
72421 : }
72422 : #endif
72423 : #endif
72424 :
72425 : /* Declarations */
72426 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
72427 : #ifdef __cplusplus
72428 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
72429 : return ::std::complex< float >(x, y);
72430 : }
72431 : #else
72432 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
72433 : return x + y*(__pyx_t_float_complex)_Complex_I;
72434 : }
72435 : #endif
72436 : #else
72437 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
72438 : __pyx_t_float_complex z;
72439 : z.real = x;
72440 : z.imag = y;
72441 : return z;
72442 : }
72443 : #endif
72444 :
72445 : /* Arithmetic */
72446 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
72447 : #else
72448 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72449 : return (a.real == b.real) && (a.imag == b.imag);
72450 : }
72451 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72452 : __pyx_t_float_complex z;
72453 : z.real = a.real + b.real;
72454 : z.imag = a.imag + b.imag;
72455 : return z;
72456 : }
72457 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72458 : __pyx_t_float_complex z;
72459 : z.real = a.real - b.real;
72460 : z.imag = a.imag - b.imag;
72461 : return z;
72462 : }
72463 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72464 : __pyx_t_float_complex z;
72465 : z.real = a.real * b.real - a.imag * b.imag;
72466 : z.imag = a.real * b.imag + a.imag * b.real;
72467 : return z;
72468 : }
72469 : #if 1
72470 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72471 : if (b.imag == 0) {
72472 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
72473 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
72474 : if (b.real == 0 && b.imag == 0) {
72475 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
72476 : } else {
72477 : float r = b.imag / b.real;
72478 : float s = (float)(1.0) / (b.real + b.imag * r);
72479 : return __pyx_t_float_complex_from_parts(
72480 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
72481 : }
72482 : } else {
72483 : float r = b.real / b.imag;
72484 : float s = (float)(1.0) / (b.imag + b.real * r);
72485 : return __pyx_t_float_complex_from_parts(
72486 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
72487 : }
72488 : }
72489 : #else
72490 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72491 : if (b.imag == 0) {
72492 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
72493 : } else {
72494 : float denom = b.real * b.real + b.imag * b.imag;
72495 : return __pyx_t_float_complex_from_parts(
72496 : (a.real * b.real + a.imag * b.imag) / denom,
72497 : (a.imag * b.real - a.real * b.imag) / denom);
72498 : }
72499 : }
72500 : #endif
72501 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
72502 : __pyx_t_float_complex z;
72503 : z.real = -a.real;
72504 : z.imag = -a.imag;
72505 : return z;
72506 : }
72507 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
72508 : return (a.real == 0) && (a.imag == 0);
72509 : }
72510 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
72511 : __pyx_t_float_complex z;
72512 : z.real = a.real;
72513 : z.imag = -a.imag;
72514 : return z;
72515 : }
72516 : #if 1
72517 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
72518 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
72519 : return sqrtf(z.real*z.real + z.imag*z.imag);
72520 : #else
72521 : return hypotf(z.real, z.imag);
72522 : #endif
72523 : }
72524 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
72525 : __pyx_t_float_complex z;
72526 : float r, lnr, theta, z_r, z_theta;
72527 : if (b.imag == 0 && b.real == (int)b.real) {
72528 : if (b.real < 0) {
72529 : float denom = a.real * a.real + a.imag * a.imag;
72530 : a.real = a.real / denom;
72531 : a.imag = -a.imag / denom;
72532 : b.real = -b.real;
72533 : }
72534 : switch ((int)b.real) {
72535 : case 0:
72536 : z.real = 1;
72537 : z.imag = 0;
72538 : return z;
72539 : case 1:
72540 : return a;
72541 : case 2:
72542 : return __Pyx_c_prod_float(a, a);
72543 : case 3:
72544 : z = __Pyx_c_prod_float(a, a);
72545 : return __Pyx_c_prod_float(z, a);
72546 : case 4:
72547 : z = __Pyx_c_prod_float(a, a);
72548 : return __Pyx_c_prod_float(z, z);
72549 : }
72550 : }
72551 : if (a.imag == 0) {
72552 : if (a.real == 0) {
72553 : return a;
72554 : } else if ((b.imag == 0) && (a.real >= 0)) {
72555 : z.real = powf(a.real, b.real);
72556 : z.imag = 0;
72557 : return z;
72558 : } else if (a.real > 0) {
72559 : r = a.real;
72560 : theta = 0;
72561 : } else {
72562 : r = -a.real;
72563 : theta = atan2f(0.0, -1.0);
72564 : }
72565 : } else {
72566 : r = __Pyx_c_abs_float(a);
72567 : theta = atan2f(a.imag, a.real);
72568 : }
72569 : lnr = logf(r);
72570 : z_r = expf(lnr * b.real - theta * b.imag);
72571 : z_theta = theta * b.real + lnr * b.imag;
72572 : z.real = z_r * cosf(z_theta);
72573 : z.imag = z_r * sinf(z_theta);
72574 : return z;
72575 : }
72576 : #endif
72577 : #endif
72578 :
72579 : /* Declarations */
72580 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
72581 : #ifdef __cplusplus
72582 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
72583 : return ::std::complex< long double >(x, y);
72584 : }
72585 : #else
72586 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
72587 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
72588 : }
72589 : #endif
72590 : #else
72591 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
72592 : __pyx_t_long_double_complex z;
72593 : z.real = x;
72594 : z.imag = y;
72595 : return z;
72596 : }
72597 : #endif
72598 :
72599 : /* Arithmetic */
72600 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
72601 : #else
72602 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72603 : return (a.real == b.real) && (a.imag == b.imag);
72604 : }
72605 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72606 : __pyx_t_long_double_complex z;
72607 : z.real = a.real + b.real;
72608 : z.imag = a.imag + b.imag;
72609 : return z;
72610 : }
72611 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72612 : __pyx_t_long_double_complex z;
72613 : z.real = a.real - b.real;
72614 : z.imag = a.imag - b.imag;
72615 : return z;
72616 : }
72617 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72618 : __pyx_t_long_double_complex z;
72619 : z.real = a.real * b.real - a.imag * b.imag;
72620 : z.imag = a.real * b.imag + a.imag * b.real;
72621 : return z;
72622 : }
72623 : #if 1
72624 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72625 : if (b.imag == 0) {
72626 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
72627 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
72628 : if (b.real == 0 && b.imag == 0) {
72629 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
72630 : } else {
72631 : long double r = b.imag / b.real;
72632 : long double s = (long double)(1.0) / (b.real + b.imag * r);
72633 : return __pyx_t_long_double_complex_from_parts(
72634 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
72635 : }
72636 : } else {
72637 : long double r = b.real / b.imag;
72638 : long double s = (long double)(1.0) / (b.imag + b.real * r);
72639 : return __pyx_t_long_double_complex_from_parts(
72640 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
72641 : }
72642 : }
72643 : #else
72644 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72645 : if (b.imag == 0) {
72646 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
72647 : } else {
72648 : long double denom = b.real * b.real + b.imag * b.imag;
72649 : return __pyx_t_long_double_complex_from_parts(
72650 : (a.real * b.real + a.imag * b.imag) / denom,
72651 : (a.imag * b.real - a.real * b.imag) / denom);
72652 : }
72653 : }
72654 : #endif
72655 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
72656 : __pyx_t_long_double_complex z;
72657 : z.real = -a.real;
72658 : z.imag = -a.imag;
72659 : return z;
72660 : }
72661 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
72662 : return (a.real == 0) && (a.imag == 0);
72663 : }
72664 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
72665 : __pyx_t_long_double_complex z;
72666 : z.real = a.real;
72667 : z.imag = -a.imag;
72668 : return z;
72669 : }
72670 : #if 1
72671 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
72672 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
72673 : return sqrtl(z.real*z.real + z.imag*z.imag);
72674 : #else
72675 : return hypotl(z.real, z.imag);
72676 : #endif
72677 : }
72678 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
72679 : __pyx_t_long_double_complex z;
72680 : long double r, lnr, theta, z_r, z_theta;
72681 : if (b.imag == 0 && b.real == (int)b.real) {
72682 : if (b.real < 0) {
72683 : long double denom = a.real * a.real + a.imag * a.imag;
72684 : a.real = a.real / denom;
72685 : a.imag = -a.imag / denom;
72686 : b.real = -b.real;
72687 : }
72688 : switch ((int)b.real) {
72689 : case 0:
72690 : z.real = 1;
72691 : z.imag = 0;
72692 : return z;
72693 : case 1:
72694 : return a;
72695 : case 2:
72696 : return __Pyx_c_prod_long__double(a, a);
72697 : case 3:
72698 : z = __Pyx_c_prod_long__double(a, a);
72699 : return __Pyx_c_prod_long__double(z, a);
72700 : case 4:
72701 : z = __Pyx_c_prod_long__double(a, a);
72702 : return __Pyx_c_prod_long__double(z, z);
72703 : }
72704 : }
72705 : if (a.imag == 0) {
72706 : if (a.real == 0) {
72707 : return a;
72708 : } else if ((b.imag == 0) && (a.real >= 0)) {
72709 : z.real = powl(a.real, b.real);
72710 : z.imag = 0;
72711 : return z;
72712 : } else if (a.real > 0) {
72713 : r = a.real;
72714 : theta = 0;
72715 : } else {
72716 : r = -a.real;
72717 : theta = atan2l(0.0, -1.0);
72718 : }
72719 : } else {
72720 : r = __Pyx_c_abs_long__double(a);
72721 : theta = atan2l(a.imag, a.real);
72722 : }
72723 : lnr = logl(r);
72724 : z_r = expl(lnr * b.real - theta * b.imag);
72725 : z_theta = theta * b.real + lnr * b.imag;
72726 : z.real = z_r * cosl(z_theta);
72727 : z.imag = z_r * sinl(z_theta);
72728 : return z;
72729 : }
72730 : #endif
72731 : #endif
72732 :
72733 : /* MemviewSliceCopyTemplate */
72734 : static __Pyx_memviewslice
72735 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
72736 : const char *mode, int ndim,
72737 : size_t sizeof_dtype, int contig_flag,
72738 : int dtype_is_object)
72739 : {
72740 : __Pyx_RefNannyDeclarations
72741 0 : int i;
72742 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
72743 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
72744 0 : Py_buffer *buf = &from_memview->view;
72745 0 : PyObject *shape_tuple = NULL;
72746 0 : PyObject *temp_int = NULL;
72747 0 : struct __pyx_array_obj *array_obj = NULL;
72748 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
72749 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
72750 0 : for (i = 0; i < ndim; i++) {
72751 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
72752 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
72753 : "indirect dimensions (axis %d)", i);
72754 0 : goto fail;
72755 : }
72756 : }
72757 0 : shape_tuple = PyTuple_New(ndim);
72758 0 : if (unlikely(!shape_tuple)) {
72759 0 : goto fail;
72760 : }
72761 : __Pyx_GOTREF(shape_tuple);
72762 0 : for(i = 0; i < ndim; i++) {
72763 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
72764 0 : if(unlikely(!temp_int)) {
72765 0 : goto fail;
72766 : } else {
72767 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
72768 0 : temp_int = NULL;
72769 : }
72770 : }
72771 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
72772 0 : if (unlikely(!array_obj)) {
72773 0 : goto fail;
72774 : }
72775 0 : __Pyx_GOTREF(array_obj);
72776 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
72777 : (PyObject *) array_obj, contig_flag,
72778 : dtype_is_object,
72779 0 : from_mvs->memview->typeinfo);
72780 0 : if (unlikely(!memview_obj))
72781 0 : goto fail;
72782 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
72783 0 : goto fail;
72784 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
72785 : dtype_is_object) < 0))
72786 0 : goto fail;
72787 0 : goto no_fail;
72788 0 : fail:
72789 0 : __Pyx_XDECREF(new_mvs.memview);
72790 0 : new_mvs.memview = NULL;
72791 0 : new_mvs.data = NULL;
72792 0 : no_fail:
72793 0 : __Pyx_XDECREF(shape_tuple);
72794 0 : __Pyx_XDECREF(temp_int);
72795 0 : __Pyx_XDECREF(array_obj);
72796 0 : __Pyx_RefNannyFinishContext();
72797 0 : return new_mvs;
72798 : }
72799 :
72800 : /* MemviewSliceInit */
72801 : static int
72802 219 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
72803 : int ndim,
72804 : __Pyx_memviewslice *memviewslice,
72805 : int memview_is_new_reference)
72806 : {
72807 : __Pyx_RefNannyDeclarations
72808 219 : int i, retval=-1;
72809 219 : Py_buffer *buf = &memview->view;
72810 219 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
72811 219 : if (unlikely(memviewslice->memview || memviewslice->data)) {
72812 0 : PyErr_SetString(PyExc_ValueError,
72813 : "memviewslice is already initialized!");
72814 0 : goto fail;
72815 : }
72816 219 : if (buf->strides) {
72817 449 : for (i = 0; i < ndim; i++) {
72818 230 : memviewslice->strides[i] = buf->strides[i];
72819 : }
72820 : } else {
72821 0 : Py_ssize_t stride = buf->itemsize;
72822 0 : for (i = ndim - 1; i >= 0; i--) {
72823 0 : memviewslice->strides[i] = stride;
72824 0 : stride *= buf->shape[i];
72825 : }
72826 : }
72827 449 : for (i = 0; i < ndim; i++) {
72828 230 : memviewslice->shape[i] = buf->shape[i];
72829 230 : if (buf->suboffsets) {
72830 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
72831 : } else {
72832 230 : memviewslice->suboffsets[i] = -1;
72833 : }
72834 : }
72835 219 : memviewslice->memview = memview;
72836 219 : memviewslice->data = (char *)buf->buf;
72837 219 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
72838 0 : Py_INCREF(memview);
72839 : }
72840 219 : retval = 0;
72841 219 : goto no_fail;
72842 0 : fail:
72843 0 : memviewslice->memview = 0;
72844 0 : memviewslice->data = 0;
72845 0 : retval = -1;
72846 219 : no_fail:
72847 219 : __Pyx_RefNannyFinishContext();
72848 219 : return retval;
72849 : }
72850 : #ifndef Py_NO_RETURN
72851 : #define Py_NO_RETURN
72852 : #endif
72853 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
72854 0 : va_list vargs;
72855 0 : char msg[200];
72856 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
72857 0 : va_start(vargs, fmt);
72858 : #else
72859 : va_start(vargs);
72860 : #endif
72861 0 : vsnprintf(msg, 200, fmt, vargs);
72862 0 : va_end(vargs);
72863 0 : Py_FatalError(msg);
72864 : }
72865 : static CYTHON_INLINE int
72866 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
72867 : PyThread_type_lock lock)
72868 : {
72869 : int result;
72870 : PyThread_acquire_lock(lock, 1);
72871 : result = (*acquisition_count)++;
72872 : PyThread_release_lock(lock);
72873 : return result;
72874 : }
72875 : static CYTHON_INLINE int
72876 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
72877 : PyThread_type_lock lock)
72878 : {
72879 : int result;
72880 : PyThread_acquire_lock(lock, 1);
72881 : result = (*acquisition_count)--;
72882 : PyThread_release_lock(lock);
72883 : return result;
72884 : }
72885 : static CYTHON_INLINE void
72886 0 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
72887 : {
72888 0 : __pyx_nonatomic_int_type old_acquisition_count;
72889 0 : struct __pyx_memoryview_obj *memview = memslice->memview;
72890 0 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
72891 : return;
72892 : }
72893 0 : old_acquisition_count = __pyx_add_acquisition_count(memview);
72894 0 : if (unlikely(old_acquisition_count <= 0)) {
72895 0 : if (likely(old_acquisition_count == 0)) {
72896 0 : if (have_gil) {
72897 0 : Py_INCREF((PyObject *) memview);
72898 : } else {
72899 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
72900 0 : Py_INCREF((PyObject *) memview);
72901 0 : PyGILState_Release(_gilstate);
72902 : }
72903 : } else {
72904 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
72905 : old_acquisition_count+1, lineno);
72906 : }
72907 : }
72908 : }
72909 219 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
72910 : int have_gil, int lineno) {
72911 219 : __pyx_nonatomic_int_type old_acquisition_count;
72912 219 : struct __pyx_memoryview_obj *memview = memslice->memview;
72913 219 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
72914 0 : memslice->memview = NULL;
72915 0 : return;
72916 : }
72917 219 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
72918 219 : memslice->data = NULL;
72919 219 : if (likely(old_acquisition_count > 1)) {
72920 0 : memslice->memview = NULL;
72921 219 : } else if (likely(old_acquisition_count == 1)) {
72922 219 : if (have_gil) {
72923 219 : Py_CLEAR(memslice->memview);
72924 : } else {
72925 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
72926 0 : Py_CLEAR(memslice->memview);
72927 0 : PyGILState_Release(_gilstate);
72928 : }
72929 : } else {
72930 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
72931 : old_acquisition_count-1, lineno);
72932 : }
72933 : }
72934 :
72935 : /* CIntFromPy */
72936 3516 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
72937 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
72938 : #pragma GCC diagnostic push
72939 : #pragma GCC diagnostic ignored "-Wconversion"
72940 : #endif
72941 3516 : const int neg_one = (int) -1, const_zero = (int) 0;
72942 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
72943 : #pragma GCC diagnostic pop
72944 : #endif
72945 3516 : const int is_unsigned = neg_one > const_zero;
72946 : #if PY_MAJOR_VERSION < 3
72947 : if (likely(PyInt_Check(x))) {
72948 : if ((sizeof(int) < sizeof(long))) {
72949 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
72950 : } else {
72951 : long val = PyInt_AS_LONG(x);
72952 : if (is_unsigned && unlikely(val < 0)) {
72953 : goto raise_neg_overflow;
72954 : }
72955 : return (int) val;
72956 : }
72957 : }
72958 : #endif
72959 3516 : if (unlikely(!PyLong_Check(x))) {
72960 1538 : int val;
72961 1538 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
72962 1538 : if (!tmp) return (int) -1;
72963 1538 : val = __Pyx_PyInt_As_int(tmp);
72964 1538 : Py_DECREF(tmp);
72965 1538 : return val;
72966 : }
72967 1978 : if (is_unsigned) {
72968 : #if CYTHON_USE_PYLONG_INTERNALS
72969 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
72970 : goto raise_neg_overflow;
72971 : } else if (__Pyx_PyLong_IsCompact(x)) {
72972 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
72973 : } else {
72974 : const digit* digits = __Pyx_PyLong_Digits(x);
72975 : assert(__Pyx_PyLong_DigitCount(x) > 1);
72976 : switch (__Pyx_PyLong_DigitCount(x)) {
72977 : case 2:
72978 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
72979 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
72980 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72981 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
72982 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
72983 : }
72984 : }
72985 : break;
72986 : case 3:
72987 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
72988 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
72989 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72990 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
72991 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
72992 : }
72993 : }
72994 : break;
72995 : case 4:
72996 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
72997 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
72998 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72999 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
73000 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
73001 : }
73002 : }
73003 : break;
73004 : }
73005 : }
73006 : #endif
73007 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
73008 : if (unlikely(Py_SIZE(x) < 0)) {
73009 : goto raise_neg_overflow;
73010 : }
73011 : #else
73012 : {
73013 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
73014 : if (unlikely(result < 0))
73015 : return (int) -1;
73016 : if (unlikely(result == 1))
73017 : goto raise_neg_overflow;
73018 : }
73019 : #endif
73020 : if ((sizeof(int) <= sizeof(unsigned long))) {
73021 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
73022 : #ifdef HAVE_LONG_LONG
73023 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
73024 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
73025 : #endif
73026 : }
73027 : } else {
73028 : #if CYTHON_USE_PYLONG_INTERNALS
73029 1978 : if (__Pyx_PyLong_IsCompact(x)) {
73030 1978 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
73031 : } else {
73032 0 : const digit* digits = __Pyx_PyLong_Digits(x);
73033 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
73034 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
73035 : case -2:
73036 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
73037 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73038 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73039 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
73040 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73041 : }
73042 : }
73043 : break;
73044 : case 2:
73045 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
73046 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73047 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73048 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
73049 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73050 : }
73051 : }
73052 : break;
73053 : case -3:
73054 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
73055 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73056 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73057 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
73058 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73059 : }
73060 : }
73061 : break;
73062 : case 3:
73063 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
73064 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73065 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73066 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
73067 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73068 : }
73069 : }
73070 : break;
73071 : case -4:
73072 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
73073 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73074 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73075 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
73076 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73077 : }
73078 : }
73079 : break;
73080 : case 4:
73081 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
73082 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73083 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73084 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
73085 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
73086 : }
73087 : }
73088 : break;
73089 : }
73090 : }
73091 : #endif
73092 0 : if ((sizeof(int) <= sizeof(long))) {
73093 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
73094 : #ifdef HAVE_LONG_LONG
73095 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
73096 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
73097 : #endif
73098 : }
73099 : }
73100 : {
73101 : int val;
73102 : int ret = -1;
73103 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
73104 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
73105 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
73106 : if (unlikely(bytes_copied == -1)) {
73107 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
73108 : goto raise_overflow;
73109 : } else {
73110 : ret = 0;
73111 : }
73112 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
73113 : int one = 1; int is_little = (int)*(unsigned char *)&one;
73114 : unsigned char *bytes = (unsigned char *)&val;
73115 : ret = _PyLong_AsByteArray((PyLongObject *)x,
73116 : bytes, sizeof(val),
73117 : is_little, !is_unsigned);
73118 : #else
73119 : PyObject *v;
73120 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
73121 : int bits, remaining_bits, is_negative = 0;
73122 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
73123 : if (likely(PyLong_CheckExact(x))) {
73124 : v = __Pyx_NewRef(x);
73125 : } else {
73126 : v = PyNumber_Long(x);
73127 : if (unlikely(!v)) return (int) -1;
73128 : assert(PyLong_CheckExact(v));
73129 : }
73130 : {
73131 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
73132 : if (unlikely(result < 0)) {
73133 : Py_DECREF(v);
73134 : return (int) -1;
73135 : }
73136 : is_negative = result == 1;
73137 : }
73138 : if (is_unsigned && unlikely(is_negative)) {
73139 : Py_DECREF(v);
73140 : goto raise_neg_overflow;
73141 : } else if (is_negative) {
73142 : stepval = PyNumber_Invert(v);
73143 : Py_DECREF(v);
73144 : if (unlikely(!stepval))
73145 : return (int) -1;
73146 : } else {
73147 : stepval = v;
73148 : }
73149 : v = NULL;
73150 : val = (int) 0;
73151 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
73152 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
73153 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
73154 : PyObject *tmp, *digit;
73155 : long idigit;
73156 : digit = PyNumber_And(stepval, mask);
73157 : if (unlikely(!digit)) goto done;
73158 : idigit = PyLong_AsLong(digit);
73159 : Py_DECREF(digit);
73160 : if (unlikely(idigit < 0)) goto done;
73161 : val |= ((int) idigit) << bits;
73162 : tmp = PyNumber_Rshift(stepval, shift);
73163 : if (unlikely(!tmp)) goto done;
73164 : Py_DECREF(stepval); stepval = tmp;
73165 : }
73166 : Py_DECREF(shift); shift = NULL;
73167 : Py_DECREF(mask); mask = NULL;
73168 : {
73169 : long idigit = PyLong_AsLong(stepval);
73170 : if (unlikely(idigit < 0)) goto done;
73171 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
73172 : if (unlikely(idigit >= (1L << remaining_bits)))
73173 : goto raise_overflow;
73174 : val |= ((int) idigit) << bits;
73175 : }
73176 : if (!is_unsigned) {
73177 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
73178 : goto raise_overflow;
73179 : if (is_negative)
73180 : val = ~val;
73181 : }
73182 : ret = 0;
73183 : done:
73184 : Py_XDECREF(shift);
73185 : Py_XDECREF(mask);
73186 : Py_XDECREF(stepval);
73187 : #endif
73188 : if (unlikely(ret))
73189 : return (int) -1;
73190 : return val;
73191 : }
73192 0 : raise_overflow:
73193 0 : PyErr_SetString(PyExc_OverflowError,
73194 : "value too large to convert to int");
73195 0 : return (int) -1;
73196 : raise_neg_overflow:
73197 : PyErr_SetString(PyExc_OverflowError,
73198 : "can't convert negative value to int");
73199 : return (int) -1;
73200 : }
73201 :
73202 : /* CIntToPy */
73203 48191 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
73204 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73205 : #pragma GCC diagnostic push
73206 : #pragma GCC diagnostic ignored "-Wconversion"
73207 : #endif
73208 48191 : const int neg_one = (int) -1, const_zero = (int) 0;
73209 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73210 : #pragma GCC diagnostic pop
73211 : #endif
73212 48191 : const int is_unsigned = neg_one > const_zero;
73213 48191 : if (is_unsigned) {
73214 : if (sizeof(int) < sizeof(long)) {
73215 : return PyInt_FromLong((long) value);
73216 : } else if (sizeof(int) <= sizeof(unsigned long)) {
73217 : return PyLong_FromUnsignedLong((unsigned long) value);
73218 : #ifdef HAVE_LONG_LONG
73219 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
73220 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
73221 : #endif
73222 : }
73223 : } else {
73224 48191 : if (sizeof(int) <= sizeof(long)) {
73225 48191 : return PyInt_FromLong((long) value);
73226 : #ifdef HAVE_LONG_LONG
73227 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
73228 : return PyLong_FromLongLong((PY_LONG_LONG) value);
73229 : #endif
73230 : }
73231 : }
73232 : {
73233 : unsigned char *bytes = (unsigned char *)&value;
73234 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
73235 : if (is_unsigned) {
73236 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
73237 : } else {
73238 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
73239 : }
73240 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
73241 : int one = 1; int little = (int)*(unsigned char *)&one;
73242 : return _PyLong_FromByteArray(bytes, sizeof(int),
73243 : little, !is_unsigned);
73244 : #else
73245 : int one = 1; int little = (int)*(unsigned char *)&one;
73246 : PyObject *from_bytes, *result = NULL;
73247 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
73248 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
73249 : if (!from_bytes) return NULL;
73250 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
73251 : if (!py_bytes) goto limited_bad;
73252 : order_str = PyUnicode_FromString(little ? "little" : "big");
73253 : if (!order_str) goto limited_bad;
73254 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
73255 : if (!arg_tuple) goto limited_bad;
73256 : if (!is_unsigned) {
73257 : kwds = PyDict_New();
73258 : if (!kwds) goto limited_bad;
73259 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
73260 : }
73261 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
73262 : limited_bad:
73263 : Py_XDECREF(kwds);
73264 : Py_XDECREF(arg_tuple);
73265 : Py_XDECREF(order_str);
73266 : Py_XDECREF(py_bytes);
73267 : Py_XDECREF(from_bytes);
73268 : return result;
73269 : #endif
73270 : }
73271 : }
73272 :
73273 : /* CIntToPy */
73274 17638 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
73275 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73276 : #pragma GCC diagnostic push
73277 : #pragma GCC diagnostic ignored "-Wconversion"
73278 : #endif
73279 17638 : const long neg_one = (long) -1, const_zero = (long) 0;
73280 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73281 : #pragma GCC diagnostic pop
73282 : #endif
73283 17638 : const int is_unsigned = neg_one > const_zero;
73284 17638 : if (is_unsigned) {
73285 : if (sizeof(long) < sizeof(long)) {
73286 : return PyInt_FromLong((long) value);
73287 : } else if (sizeof(long) <= sizeof(unsigned long)) {
73288 : return PyLong_FromUnsignedLong((unsigned long) value);
73289 : #ifdef HAVE_LONG_LONG
73290 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
73291 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
73292 : #endif
73293 : }
73294 : } else {
73295 17638 : if (sizeof(long) <= sizeof(long)) {
73296 17638 : return PyInt_FromLong((long) value);
73297 : #ifdef HAVE_LONG_LONG
73298 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
73299 : return PyLong_FromLongLong((PY_LONG_LONG) value);
73300 : #endif
73301 : }
73302 : }
73303 : {
73304 : unsigned char *bytes = (unsigned char *)&value;
73305 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
73306 : if (is_unsigned) {
73307 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
73308 : } else {
73309 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
73310 : }
73311 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
73312 : int one = 1; int little = (int)*(unsigned char *)&one;
73313 : return _PyLong_FromByteArray(bytes, sizeof(long),
73314 : little, !is_unsigned);
73315 : #else
73316 : int one = 1; int little = (int)*(unsigned char *)&one;
73317 : PyObject *from_bytes, *result = NULL;
73318 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
73319 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
73320 : if (!from_bytes) return NULL;
73321 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
73322 : if (!py_bytes) goto limited_bad;
73323 : order_str = PyUnicode_FromString(little ? "little" : "big");
73324 : if (!order_str) goto limited_bad;
73325 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
73326 : if (!arg_tuple) goto limited_bad;
73327 : if (!is_unsigned) {
73328 : kwds = PyDict_New();
73329 : if (!kwds) goto limited_bad;
73330 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
73331 : }
73332 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
73333 : limited_bad:
73334 : Py_XDECREF(kwds);
73335 : Py_XDECREF(arg_tuple);
73336 : Py_XDECREF(order_str);
73337 : Py_XDECREF(py_bytes);
73338 : Py_XDECREF(from_bytes);
73339 : return result;
73340 : #endif
73341 : }
73342 : }
73343 :
73344 : /* CIntToPy */
73345 812 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
73346 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73347 : #pragma GCC diagnostic push
73348 : #pragma GCC diagnostic ignored "-Wconversion"
73349 : #endif
73350 812 : const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
73351 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73352 : #pragma GCC diagnostic pop
73353 : #endif
73354 812 : const int is_unsigned = neg_one > const_zero;
73355 812 : if (is_unsigned) {
73356 : if (sizeof(npy_int64) < sizeof(long)) {
73357 : return PyInt_FromLong((long) value);
73358 : } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
73359 : return PyLong_FromUnsignedLong((unsigned long) value);
73360 : #ifdef HAVE_LONG_LONG
73361 : } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
73362 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
73363 : #endif
73364 : }
73365 : } else {
73366 812 : if (sizeof(npy_int64) <= sizeof(long)) {
73367 812 : return PyInt_FromLong((long) value);
73368 : #ifdef HAVE_LONG_LONG
73369 : } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
73370 : return PyLong_FromLongLong((PY_LONG_LONG) value);
73371 : #endif
73372 : }
73373 : }
73374 : {
73375 : unsigned char *bytes = (unsigned char *)&value;
73376 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
73377 : if (is_unsigned) {
73378 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
73379 : } else {
73380 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
73381 : }
73382 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
73383 : int one = 1; int little = (int)*(unsigned char *)&one;
73384 : return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
73385 : little, !is_unsigned);
73386 : #else
73387 : int one = 1; int little = (int)*(unsigned char *)&one;
73388 : PyObject *from_bytes, *result = NULL;
73389 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
73390 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
73391 : if (!from_bytes) return NULL;
73392 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64));
73393 : if (!py_bytes) goto limited_bad;
73394 : order_str = PyUnicode_FromString(little ? "little" : "big");
73395 : if (!order_str) goto limited_bad;
73396 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
73397 : if (!arg_tuple) goto limited_bad;
73398 : if (!is_unsigned) {
73399 : kwds = PyDict_New();
73400 : if (!kwds) goto limited_bad;
73401 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
73402 : }
73403 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
73404 : limited_bad:
73405 : Py_XDECREF(kwds);
73406 : Py_XDECREF(arg_tuple);
73407 : Py_XDECREF(order_str);
73408 : Py_XDECREF(py_bytes);
73409 : Py_XDECREF(from_bytes);
73410 : return result;
73411 : #endif
73412 : }
73413 : }
73414 :
73415 : /* CIntFromPy */
73416 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
73417 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73418 : #pragma GCC diagnostic push
73419 : #pragma GCC diagnostic ignored "-Wconversion"
73420 : #endif
73421 0 : const long neg_one = (long) -1, const_zero = (long) 0;
73422 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73423 : #pragma GCC diagnostic pop
73424 : #endif
73425 0 : const int is_unsigned = neg_one > const_zero;
73426 : #if PY_MAJOR_VERSION < 3
73427 : if (likely(PyInt_Check(x))) {
73428 : if ((sizeof(long) < sizeof(long))) {
73429 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
73430 : } else {
73431 : long val = PyInt_AS_LONG(x);
73432 : if (is_unsigned && unlikely(val < 0)) {
73433 : goto raise_neg_overflow;
73434 : }
73435 : return (long) val;
73436 : }
73437 : }
73438 : #endif
73439 0 : if (unlikely(!PyLong_Check(x))) {
73440 0 : long val;
73441 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
73442 0 : if (!tmp) return (long) -1;
73443 0 : val = __Pyx_PyInt_As_long(tmp);
73444 0 : Py_DECREF(tmp);
73445 0 : return val;
73446 : }
73447 0 : if (is_unsigned) {
73448 : #if CYTHON_USE_PYLONG_INTERNALS
73449 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
73450 : goto raise_neg_overflow;
73451 : } else if (__Pyx_PyLong_IsCompact(x)) {
73452 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
73453 : } else {
73454 : const digit* digits = __Pyx_PyLong_Digits(x);
73455 : assert(__Pyx_PyLong_DigitCount(x) > 1);
73456 : switch (__Pyx_PyLong_DigitCount(x)) {
73457 : case 2:
73458 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
73459 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73460 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73461 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
73462 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
73463 : }
73464 : }
73465 : break;
73466 : case 3:
73467 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
73468 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73469 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73470 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
73471 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
73472 : }
73473 : }
73474 : break;
73475 : case 4:
73476 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
73477 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73478 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73479 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
73480 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
73481 : }
73482 : }
73483 : break;
73484 : }
73485 : }
73486 : #endif
73487 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
73488 : if (unlikely(Py_SIZE(x) < 0)) {
73489 : goto raise_neg_overflow;
73490 : }
73491 : #else
73492 : {
73493 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
73494 : if (unlikely(result < 0))
73495 : return (long) -1;
73496 : if (unlikely(result == 1))
73497 : goto raise_neg_overflow;
73498 : }
73499 : #endif
73500 : if ((sizeof(long) <= sizeof(unsigned long))) {
73501 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
73502 : #ifdef HAVE_LONG_LONG
73503 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
73504 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
73505 : #endif
73506 : }
73507 : } else {
73508 : #if CYTHON_USE_PYLONG_INTERNALS
73509 0 : if (__Pyx_PyLong_IsCompact(x)) {
73510 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
73511 : } else {
73512 0 : const digit* digits = __Pyx_PyLong_Digits(x);
73513 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
73514 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
73515 : case -2:
73516 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
73517 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73518 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73519 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
73520 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73521 : }
73522 : }
73523 : break;
73524 : case 2:
73525 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
73526 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73527 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73528 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
73529 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73530 : }
73531 : }
73532 : break;
73533 : case -3:
73534 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
73535 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73536 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73537 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
73538 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73539 : }
73540 : }
73541 : break;
73542 : case 3:
73543 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
73544 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73545 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73546 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
73547 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73548 : }
73549 : }
73550 : break;
73551 : case -4:
73552 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
73553 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73554 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73555 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
73556 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73557 : }
73558 : }
73559 : break;
73560 : case 4:
73561 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
73562 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73563 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73564 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
73565 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
73566 : }
73567 : }
73568 : break;
73569 : }
73570 : }
73571 : #endif
73572 0 : if ((sizeof(long) <= sizeof(long))) {
73573 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
73574 : #ifdef HAVE_LONG_LONG
73575 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
73576 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
73577 : #endif
73578 : }
73579 : }
73580 : {
73581 : long val;
73582 : int ret = -1;
73583 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
73584 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
73585 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
73586 : if (unlikely(bytes_copied == -1)) {
73587 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
73588 : goto raise_overflow;
73589 : } else {
73590 : ret = 0;
73591 : }
73592 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
73593 : int one = 1; int is_little = (int)*(unsigned char *)&one;
73594 : unsigned char *bytes = (unsigned char *)&val;
73595 : ret = _PyLong_AsByteArray((PyLongObject *)x,
73596 : bytes, sizeof(val),
73597 : is_little, !is_unsigned);
73598 : #else
73599 : PyObject *v;
73600 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
73601 : int bits, remaining_bits, is_negative = 0;
73602 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
73603 : if (likely(PyLong_CheckExact(x))) {
73604 : v = __Pyx_NewRef(x);
73605 : } else {
73606 : v = PyNumber_Long(x);
73607 : if (unlikely(!v)) return (long) -1;
73608 : assert(PyLong_CheckExact(v));
73609 : }
73610 : {
73611 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
73612 : if (unlikely(result < 0)) {
73613 : Py_DECREF(v);
73614 : return (long) -1;
73615 : }
73616 : is_negative = result == 1;
73617 : }
73618 : if (is_unsigned && unlikely(is_negative)) {
73619 : Py_DECREF(v);
73620 : goto raise_neg_overflow;
73621 : } else if (is_negative) {
73622 : stepval = PyNumber_Invert(v);
73623 : Py_DECREF(v);
73624 : if (unlikely(!stepval))
73625 : return (long) -1;
73626 : } else {
73627 : stepval = v;
73628 : }
73629 : v = NULL;
73630 : val = (long) 0;
73631 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
73632 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
73633 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
73634 : PyObject *tmp, *digit;
73635 : long idigit;
73636 : digit = PyNumber_And(stepval, mask);
73637 : if (unlikely(!digit)) goto done;
73638 : idigit = PyLong_AsLong(digit);
73639 : Py_DECREF(digit);
73640 : if (unlikely(idigit < 0)) goto done;
73641 : val |= ((long) idigit) << bits;
73642 : tmp = PyNumber_Rshift(stepval, shift);
73643 : if (unlikely(!tmp)) goto done;
73644 : Py_DECREF(stepval); stepval = tmp;
73645 : }
73646 : Py_DECREF(shift); shift = NULL;
73647 : Py_DECREF(mask); mask = NULL;
73648 : {
73649 : long idigit = PyLong_AsLong(stepval);
73650 : if (unlikely(idigit < 0)) goto done;
73651 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
73652 : if (unlikely(idigit >= (1L << remaining_bits)))
73653 : goto raise_overflow;
73654 : val |= ((long) idigit) << bits;
73655 : }
73656 : if (!is_unsigned) {
73657 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
73658 : goto raise_overflow;
73659 : if (is_negative)
73660 : val = ~val;
73661 : }
73662 : ret = 0;
73663 : done:
73664 : Py_XDECREF(shift);
73665 : Py_XDECREF(mask);
73666 : Py_XDECREF(stepval);
73667 : #endif
73668 : if (unlikely(ret))
73669 : return (long) -1;
73670 : return val;
73671 : }
73672 : raise_overflow:
73673 : PyErr_SetString(PyExc_OverflowError,
73674 : "value too large to convert to long");
73675 : return (long) -1;
73676 : raise_neg_overflow:
73677 : PyErr_SetString(PyExc_OverflowError,
73678 : "can't convert negative value to long");
73679 : return (long) -1;
73680 : }
73681 :
73682 : /* CIntFromPy */
73683 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
73684 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73685 : #pragma GCC diagnostic push
73686 : #pragma GCC diagnostic ignored "-Wconversion"
73687 : #endif
73688 : const char neg_one = (char) -1, const_zero = (char) 0;
73689 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
73690 : #pragma GCC diagnostic pop
73691 : #endif
73692 : const int is_unsigned = neg_one > const_zero;
73693 : #if PY_MAJOR_VERSION < 3
73694 : if (likely(PyInt_Check(x))) {
73695 : if ((sizeof(char) < sizeof(long))) {
73696 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
73697 : } else {
73698 : long val = PyInt_AS_LONG(x);
73699 : if (is_unsigned && unlikely(val < 0)) {
73700 : goto raise_neg_overflow;
73701 : }
73702 : return (char) val;
73703 : }
73704 : }
73705 : #endif
73706 : if (unlikely(!PyLong_Check(x))) {
73707 : char val;
73708 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
73709 : if (!tmp) return (char) -1;
73710 : val = __Pyx_PyInt_As_char(tmp);
73711 : Py_DECREF(tmp);
73712 : return val;
73713 : }
73714 : if (is_unsigned) {
73715 : #if CYTHON_USE_PYLONG_INTERNALS
73716 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
73717 : goto raise_neg_overflow;
73718 : } else if (__Pyx_PyLong_IsCompact(x)) {
73719 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
73720 : } else {
73721 : const digit* digits = __Pyx_PyLong_Digits(x);
73722 : assert(__Pyx_PyLong_DigitCount(x) > 1);
73723 : switch (__Pyx_PyLong_DigitCount(x)) {
73724 : case 2:
73725 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
73726 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73727 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73728 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
73729 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
73730 : }
73731 : }
73732 : break;
73733 : case 3:
73734 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
73735 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73736 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73737 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
73738 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
73739 : }
73740 : }
73741 : break;
73742 : case 4:
73743 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
73744 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73745 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73746 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
73747 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
73748 : }
73749 : }
73750 : break;
73751 : }
73752 : }
73753 : #endif
73754 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
73755 : if (unlikely(Py_SIZE(x) < 0)) {
73756 : goto raise_neg_overflow;
73757 : }
73758 : #else
73759 : {
73760 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
73761 : if (unlikely(result < 0))
73762 : return (char) -1;
73763 : if (unlikely(result == 1))
73764 : goto raise_neg_overflow;
73765 : }
73766 : #endif
73767 : if ((sizeof(char) <= sizeof(unsigned long))) {
73768 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
73769 : #ifdef HAVE_LONG_LONG
73770 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
73771 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
73772 : #endif
73773 : }
73774 : } else {
73775 : #if CYTHON_USE_PYLONG_INTERNALS
73776 : if (__Pyx_PyLong_IsCompact(x)) {
73777 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
73778 : } else {
73779 : const digit* digits = __Pyx_PyLong_Digits(x);
73780 : assert(__Pyx_PyLong_DigitCount(x) > 1);
73781 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
73782 : case -2:
73783 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
73784 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73785 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73786 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
73787 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73788 : }
73789 : }
73790 : break;
73791 : case 2:
73792 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
73793 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
73794 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73795 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
73796 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73797 : }
73798 : }
73799 : break;
73800 : case -3:
73801 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
73802 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73803 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73804 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
73805 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73806 : }
73807 : }
73808 : break;
73809 : case 3:
73810 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
73811 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
73812 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73813 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
73814 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73815 : }
73816 : }
73817 : break;
73818 : case -4:
73819 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
73820 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73821 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73822 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
73823 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73824 : }
73825 : }
73826 : break;
73827 : case 4:
73828 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
73829 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
73830 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
73831 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
73832 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
73833 : }
73834 : }
73835 : break;
73836 : }
73837 : }
73838 : #endif
73839 : if ((sizeof(char) <= sizeof(long))) {
73840 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
73841 : #ifdef HAVE_LONG_LONG
73842 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
73843 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
73844 : #endif
73845 : }
73846 : }
73847 : {
73848 : char val;
73849 : int ret = -1;
73850 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
73851 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
73852 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
73853 : if (unlikely(bytes_copied == -1)) {
73854 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
73855 : goto raise_overflow;
73856 : } else {
73857 : ret = 0;
73858 : }
73859 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
73860 : int one = 1; int is_little = (int)*(unsigned char *)&one;
73861 : unsigned char *bytes = (unsigned char *)&val;
73862 : ret = _PyLong_AsByteArray((PyLongObject *)x,
73863 : bytes, sizeof(val),
73864 : is_little, !is_unsigned);
73865 : #else
73866 : PyObject *v;
73867 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
73868 : int bits, remaining_bits, is_negative = 0;
73869 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
73870 : if (likely(PyLong_CheckExact(x))) {
73871 : v = __Pyx_NewRef(x);
73872 : } else {
73873 : v = PyNumber_Long(x);
73874 : if (unlikely(!v)) return (char) -1;
73875 : assert(PyLong_CheckExact(v));
73876 : }
73877 : {
73878 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
73879 : if (unlikely(result < 0)) {
73880 : Py_DECREF(v);
73881 : return (char) -1;
73882 : }
73883 : is_negative = result == 1;
73884 : }
73885 : if (is_unsigned && unlikely(is_negative)) {
73886 : Py_DECREF(v);
73887 : goto raise_neg_overflow;
73888 : } else if (is_negative) {
73889 : stepval = PyNumber_Invert(v);
73890 : Py_DECREF(v);
73891 : if (unlikely(!stepval))
73892 : return (char) -1;
73893 : } else {
73894 : stepval = v;
73895 : }
73896 : v = NULL;
73897 : val = (char) 0;
73898 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
73899 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
73900 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
73901 : PyObject *tmp, *digit;
73902 : long idigit;
73903 : digit = PyNumber_And(stepval, mask);
73904 : if (unlikely(!digit)) goto done;
73905 : idigit = PyLong_AsLong(digit);
73906 : Py_DECREF(digit);
73907 : if (unlikely(idigit < 0)) goto done;
73908 : val |= ((char) idigit) << bits;
73909 : tmp = PyNumber_Rshift(stepval, shift);
73910 : if (unlikely(!tmp)) goto done;
73911 : Py_DECREF(stepval); stepval = tmp;
73912 : }
73913 : Py_DECREF(shift); shift = NULL;
73914 : Py_DECREF(mask); mask = NULL;
73915 : {
73916 : long idigit = PyLong_AsLong(stepval);
73917 : if (unlikely(idigit < 0)) goto done;
73918 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
73919 : if (unlikely(idigit >= (1L << remaining_bits)))
73920 : goto raise_overflow;
73921 : val |= ((char) idigit) << bits;
73922 : }
73923 : if (!is_unsigned) {
73924 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
73925 : goto raise_overflow;
73926 : if (is_negative)
73927 : val = ~val;
73928 : }
73929 : ret = 0;
73930 : done:
73931 : Py_XDECREF(shift);
73932 : Py_XDECREF(mask);
73933 : Py_XDECREF(stepval);
73934 : #endif
73935 : if (unlikely(ret))
73936 : return (char) -1;
73937 : return val;
73938 : }
73939 : raise_overflow:
73940 : PyErr_SetString(PyExc_OverflowError,
73941 : "value too large to convert to char");
73942 : return (char) -1;
73943 : raise_neg_overflow:
73944 : PyErr_SetString(PyExc_OverflowError,
73945 : "can't convert negative value to char");
73946 : return (char) -1;
73947 : }
73948 :
73949 : /* FormatTypeName */
73950 : #if CYTHON_COMPILING_IN_LIMITED_API
73951 : static __Pyx_TypeName
73952 : __Pyx_PyType_GetName(PyTypeObject* tp)
73953 : {
73954 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
73955 : __pyx_n_s_name_2);
73956 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
73957 : PyErr_Clear();
73958 : Py_XDECREF(name);
73959 : name = __Pyx_NewRef(__pyx_n_s__102);
73960 : }
73961 : return name;
73962 : }
73963 : #endif
73964 :
73965 : /* CheckBinaryVersion */
73966 3 : static unsigned long __Pyx_get_runtime_version(void) {
73967 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
73968 3 : return Py_Version & ~0xFFUL;
73969 : #else
73970 : const char* rt_version = Py_GetVersion();
73971 : unsigned long version = 0;
73972 : unsigned long factor = 0x01000000UL;
73973 : unsigned int digit = 0;
73974 : int i = 0;
73975 : while (factor) {
73976 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
73977 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
73978 : ++i;
73979 : }
73980 : version += factor * digit;
73981 : if (rt_version[i] != '.')
73982 : break;
73983 : digit = 0;
73984 : factor >>= 8;
73985 : ++i;
73986 : }
73987 : return version;
73988 : #endif
73989 : }
73990 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
73991 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
73992 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
73993 : return 0;
73994 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
73995 : return 1;
73996 : {
73997 0 : char message[200];
73998 0 : PyOS_snprintf(message, sizeof(message),
73999 : "compile time Python version %d.%d "
74000 : "of module '%.100s' "
74001 : "%s "
74002 : "runtime version %d.%d",
74003 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
74004 : __Pyx_MODULE_NAME,
74005 : (allow_newer) ? "was newer than" : "does not match",
74006 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
74007 : );
74008 0 : return PyErr_WarnEx(NULL, message, 1);
74009 : }
74010 : }
74011 :
74012 : /* FunctionImport */
74013 : #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11
74014 : #define __PYX_HAVE_RT_ImportFunction_3_0_11
74015 24 : static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
74016 24 : PyObject *d = 0;
74017 24 : PyObject *cobj = 0;
74018 24 : union {
74019 : void (*fp)(void);
74020 : void *p;
74021 : } tmp;
74022 24 : d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
74023 24 : if (!d)
74024 0 : goto bad;
74025 24 : cobj = PyDict_GetItemString(d, funcname);
74026 24 : if (!cobj) {
74027 0 : PyErr_Format(PyExc_ImportError,
74028 : "%.200s does not export expected C function %.200s",
74029 : PyModule_GetName(module), funcname);
74030 0 : goto bad;
74031 : }
74032 24 : if (!PyCapsule_IsValid(cobj, sig)) {
74033 0 : PyErr_Format(PyExc_TypeError,
74034 : "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
74035 : PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
74036 0 : goto bad;
74037 : }
74038 24 : tmp.p = PyCapsule_GetPointer(cobj, sig);
74039 24 : *f = tmp.fp;
74040 24 : if (!(*f))
74041 0 : goto bad;
74042 24 : Py_DECREF(d);
74043 : return 0;
74044 0 : bad:
74045 0 : Py_XDECREF(d);
74046 0 : return -1;
74047 : }
74048 : #endif
74049 :
74050 : /* InitStrings */
74051 : #if PY_MAJOR_VERSION >= 3
74052 1146 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
74053 1146 : if (t.is_unicode | t.is_str) {
74054 1143 : if (t.intern) {
74055 987 : *str = PyUnicode_InternFromString(t.s);
74056 156 : } else if (t.encoding) {
74057 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
74058 : } else {
74059 156 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
74060 : }
74061 : } else {
74062 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
74063 : }
74064 1146 : if (!*str)
74065 : return -1;
74066 1146 : if (PyObject_Hash(*str) == -1)
74067 : return -1;
74068 : return 0;
74069 : }
74070 : #endif
74071 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
74072 1149 : while (t->p) {
74073 : #if PY_MAJOR_VERSION >= 3
74074 1146 : __Pyx_InitString(*t, t->p);
74075 : #else
74076 : if (t->is_unicode) {
74077 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
74078 : } else if (t->intern) {
74079 : *t->p = PyString_InternFromString(t->s);
74080 : } else {
74081 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
74082 : }
74083 : if (!*t->p)
74084 : return -1;
74085 : if (PyObject_Hash(*t->p) == -1)
74086 : return -1;
74087 : #endif
74088 1146 : ++t;
74089 : }
74090 3 : return 0;
74091 : }
74092 :
74093 : #include <string.h>
74094 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
74095 0 : size_t len = strlen(s);
74096 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
74097 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
74098 : return -1;
74099 : }
74100 : return (Py_ssize_t) len;
74101 : }
74102 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
74103 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
74104 : if (unlikely(len < 0)) return NULL;
74105 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
74106 : }
74107 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
74108 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
74109 : if (unlikely(len < 0)) return NULL;
74110 : return PyByteArray_FromStringAndSize(c_str, len);
74111 : }
74112 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
74113 : Py_ssize_t ignore;
74114 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
74115 : }
74116 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
74117 : #if !CYTHON_PEP393_ENABLED
74118 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
74119 : char* defenc_c;
74120 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
74121 : if (!defenc) return NULL;
74122 : defenc_c = PyBytes_AS_STRING(defenc);
74123 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
74124 : {
74125 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
74126 : char* c;
74127 : for (c = defenc_c; c < end; c++) {
74128 : if ((unsigned char) (*c) >= 128) {
74129 : PyUnicode_AsASCIIString(o);
74130 : return NULL;
74131 : }
74132 : }
74133 : }
74134 : #endif
74135 : *length = PyBytes_GET_SIZE(defenc);
74136 : return defenc_c;
74137 : }
74138 : #else
74139 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
74140 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
74141 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
74142 : if (likely(PyUnicode_IS_ASCII(o))) {
74143 : *length = PyUnicode_GET_LENGTH(o);
74144 : return PyUnicode_AsUTF8(o);
74145 : } else {
74146 : PyUnicode_AsASCIIString(o);
74147 : return NULL;
74148 : }
74149 : #else
74150 : return PyUnicode_AsUTF8AndSize(o, length);
74151 : #endif
74152 : }
74153 : #endif
74154 : #endif
74155 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
74156 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
74157 : if (
74158 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
74159 : __Pyx_sys_getdefaultencoding_not_ascii &&
74160 : #endif
74161 : PyUnicode_Check(o)) {
74162 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
74163 : } else
74164 : #endif
74165 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
74166 : if (PyByteArray_Check(o)) {
74167 : *length = PyByteArray_GET_SIZE(o);
74168 : return PyByteArray_AS_STRING(o);
74169 : } else
74170 : #endif
74171 : {
74172 : char* result;
74173 : int r = PyBytes_AsStringAndSize(o, &result, length);
74174 : if (unlikely(r < 0)) {
74175 : return NULL;
74176 : } else {
74177 : return result;
74178 : }
74179 : }
74180 : }
74181 2487 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
74182 2487 : int is_true = x == Py_True;
74183 2487 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
74184 138 : else return PyObject_IsTrue(x);
74185 : }
74186 0 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
74187 0 : int retval;
74188 0 : if (unlikely(!x)) return -1;
74189 0 : retval = __Pyx_PyObject_IsTrue(x);
74190 0 : Py_DECREF(x);
74191 : return retval;
74192 : }
74193 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
74194 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
74195 : #if PY_MAJOR_VERSION >= 3
74196 0 : if (PyLong_Check(result)) {
74197 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
74198 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
74199 : "The ability to return an instance of a strict subclass of int is deprecated, "
74200 : "and may be removed in a future version of Python.",
74201 : result_type_name)) {
74202 0 : __Pyx_DECREF_TypeName(result_type_name);
74203 0 : Py_DECREF(result);
74204 0 : return NULL;
74205 : }
74206 : __Pyx_DECREF_TypeName(result_type_name);
74207 : return result;
74208 : }
74209 : #endif
74210 0 : PyErr_Format(PyExc_TypeError,
74211 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
74212 : type_name, type_name, result_type_name);
74213 0 : __Pyx_DECREF_TypeName(result_type_name);
74214 0 : Py_DECREF(result);
74215 : return NULL;
74216 : }
74217 1538 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
74218 : #if CYTHON_USE_TYPE_SLOTS
74219 1538 : PyNumberMethods *m;
74220 : #endif
74221 1538 : const char *name = NULL;
74222 1538 : PyObject *res = NULL;
74223 : #if PY_MAJOR_VERSION < 3
74224 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
74225 : #else
74226 1538 : if (likely(PyLong_Check(x)))
74227 : #endif
74228 0 : return __Pyx_NewRef(x);
74229 : #if CYTHON_USE_TYPE_SLOTS
74230 1538 : m = Py_TYPE(x)->tp_as_number;
74231 : #if PY_MAJOR_VERSION < 3
74232 : if (m && m->nb_int) {
74233 : name = "int";
74234 : res = m->nb_int(x);
74235 : }
74236 : else if (m && m->nb_long) {
74237 : name = "long";
74238 : res = m->nb_long(x);
74239 : }
74240 : #else
74241 1538 : if (likely(m && m->nb_int)) {
74242 1538 : name = "int";
74243 1538 : res = m->nb_int(x);
74244 : }
74245 : #endif
74246 : #else
74247 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
74248 : res = PyNumber_Int(x);
74249 : }
74250 : #endif
74251 1538 : if (likely(res)) {
74252 : #if PY_MAJOR_VERSION < 3
74253 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
74254 : #else
74255 1538 : if (unlikely(!PyLong_CheckExact(res))) {
74256 : #endif
74257 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
74258 : }
74259 : }
74260 0 : else if (!PyErr_Occurred()) {
74261 0 : PyErr_SetString(PyExc_TypeError,
74262 : "an integer is required");
74263 : }
74264 : return res;
74265 : }
74266 0 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
74267 0 : Py_ssize_t ival;
74268 0 : PyObject *x;
74269 : #if PY_MAJOR_VERSION < 3
74270 : if (likely(PyInt_CheckExact(b))) {
74271 : if (sizeof(Py_ssize_t) >= sizeof(long))
74272 : return PyInt_AS_LONG(b);
74273 : else
74274 : return PyInt_AsSsize_t(b);
74275 : }
74276 : #endif
74277 0 : if (likely(PyLong_CheckExact(b))) {
74278 : #if CYTHON_USE_PYLONG_INTERNALS
74279 0 : if (likely(__Pyx_PyLong_IsCompact(b))) {
74280 0 : return __Pyx_PyLong_CompactValue(b);
74281 : } else {
74282 0 : const digit* digits = __Pyx_PyLong_Digits(b);
74283 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
74284 0 : switch (size) {
74285 : case 2:
74286 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
74287 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74288 : }
74289 : break;
74290 : case -2:
74291 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
74292 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74293 : }
74294 : break;
74295 : case 3:
74296 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
74297 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74298 : }
74299 : break;
74300 : case -3:
74301 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
74302 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74303 : }
74304 : break;
74305 : case 4:
74306 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
74307 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74308 : }
74309 : break;
74310 : case -4:
74311 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
74312 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
74313 : }
74314 : break;
74315 : }
74316 : }
74317 : #endif
74318 0 : return PyLong_AsSsize_t(b);
74319 : }
74320 0 : x = PyNumber_Index(b);
74321 0 : if (!x) return -1;
74322 0 : ival = PyInt_AsSsize_t(x);
74323 0 : Py_DECREF(x);
74324 : return ival;
74325 : }
74326 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
74327 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
74328 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
74329 : #if PY_MAJOR_VERSION < 3
74330 : } else if (likely(PyInt_CheckExact(o))) {
74331 : return PyInt_AS_LONG(o);
74332 : #endif
74333 : } else {
74334 : Py_ssize_t ival;
74335 : PyObject *x;
74336 : x = PyNumber_Index(o);
74337 : if (!x) return -1;
74338 : ival = PyInt_AsLong(x);
74339 : Py_DECREF(x);
74340 : return ival;
74341 : }
74342 : }
74343 219 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
74344 219 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
74345 : }
74346 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
74347 : return PyInt_FromSize_t(ival);
74348 : }
74349 :
74350 :
74351 : /* #### Code section: utility_code_pragmas_end ### */
74352 : #ifdef _MSC_VER
74353 : #pragma warning( pop )
74354 : #endif
74355 :
74356 :
74357 :
74358 : /* #### Code section: end ### */
74359 : #endif /* Py_PYTHON_H */
|